Virsh Commands CheatSheet Intro

Virsh Commands CheatSheet

Virsh interacts with Libviry which is a library aimed at providing a long-term stable C API. It currently supports Xen, QEMU, KVM, LXC, OpenVZ, VirtualBox and VMware ESX.

1
$ virsh [OPTION]… <command> <domain> [ARG]…
    1. Virsh displat node information
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      [blocface@centos ~]$ sudo virsh nodeinfo
      setlocale: No such file or directory
      CPU model: x86_64
      CPU(s): 48
      CPU frequency: 1883 MHz
      CPU socket(s): 1
      Core(s) per socket: 12
      Thread(s) per core: 2
      NUMA cell(s): 2
      Memory size: 131608380 KiB
    1. Virsh list all domains
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      [blocface@centos ~]$ sudo virsh list --all
      setlocale: No such file or directory
      Id Name State
      ----------------------------------------------------
      4 node4 running
      14 node1 running
      15 node5 running
      17 node3 running
      18 node2 running
      - centos shut off
      - template shut off
    1. Virsh rename domain
      1

参考手册