Displaying information about a virtual server

View information about a virtual server, its state, its devices, or scheduling properties.

Procedure

You can display information about a defined virtual server using one of the following commands:
Displayed information Command Comments
General information dominfo  
Current state domstate Display the reason of the current state by using the --reason option.
Scheduling information schedinfo  
Number of virtual CPUs vcpucount  
Virtual block devices domblkstat To retrieve the device name, use the virsh domblklist command.
Virtual Ethernet interfaces domifstat To retrieve the interface name, use the virsh domiflist command.
I/O threads iothreadinfo  

Example

  • View information about a defined virtual server:
    # virsh dominfo vserv2
    Id:             8
    Name:           vserv2
    UUID:           f4fbc391-717d-4c58-80d5-1cae505f89c8
    OS Type:        hvm
    State:          running
    CPU(s):         4
    CPU time:       164.6s
    Max memory:     2097152 KiB
    Used memory:    2097152 KiB
    Persistent:     yes
    Autostart:      disable
    Managed save:   no
    Security model: selinux
    Security DOI:   0
    Security label: system_u:system_r:svirt_t:s0:c383,c682 (enforcing)
  • View information about the current state:
    # virsh domstate vserv2
    running
    
    # virsh domstate vserv2 --reason
    running (unpaused)
  • View scheduling information:
    # virsh schedinfo vserv1
    Scheduler      : posix
    cpu_shares     : 1024
    vcpu_period    : 100000
    vcpu_quota     : -1
    emulator_period: 100000
    emulator_quota : -1
  • Display the number of virtual CPUs:
    # virsh vcpucount vserv1
    maximum      config         5
    maximum      live           5
    current      config         3
    current      live           3
  • View information about the virtual block devices:
    # virsh domblklist vserv1
    Target     Source
    ------------------------------------------------
    vda        /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc
    
    # virsh domblkstat vserv1 /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc rd_req 17866
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc rd_bytes 180311040
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc wr_req 11896
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc wr_bytes 126107648
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc flush_operations 3884
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc rd_total_times 14496884715
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc wr_total_times 9834388979
    /dev/disk/by-id/dm-uuid-mpath-36005076305ffc1ae00000000000023bc flush_total_times 755568088
  • View information about the virtual Ethernet interfaces:
    # virsh domiflist vserv1
    Interface  Type       Source     Model       MAC
    -------------------------------------------------------
    vnet0      network    iedn       virtio      02:17:12:01:ff:01
    
    # virsh domifstat vserv1 vnet0
    vnet0 rx_bytes 2377970
    vnet0 rx_packets 55653
    vnet0 rx_errs 0
    vnet0 rx_drop 0
    vnet0 tx_bytes 831453
    vnet0 tx_packets 18690
    vnet0 tx_errs 0
    vnet0 tx_drop 0
  • View information about the I/O threads of a virtual server with 8 virtual CPUs:
    # virsh iothreadinfo vserv1
      IOThread ID     CPU Affinity
      ---------------------------------------------------
       1               0-7
       2               0-7
       3               0-7