virsh -h 或者
virsh --helpvim
ls /etc/libvirt/qemudom
virsh list --allide
virsh shutdown c7-1 //關機
virsh start c7-1 //開機3d
virsh destroy c7-1code
virsh create /etc/libvirt/qemu/c7-1.xml
virsh list --all //查看啓動狀態xml
virsh suspend c7-1
virsh list --allblog
virsh resume c7-1
virsh list --allip
virsh autostart c7-1內存
virsh dumpxml c7-1 > /etc/libvirt/qemu/c7-2.xmlci
virsh shutdown c7-1
virsh undefine c7-1
virsh list --all
cd /etc/libvirt/qemu
mv c7-2.xml c7-1.xml
virsh define c7-1.xml
virsh list --all
vim /etc/libvirt/qemu/c7-1.xml
virsh edit c7-1
qemu-img info /vdir/c7-1.raw
virsh shutdown c7-1
qemu-img convert -f raw -O qcow2 /vdir/c7-1.raw /vdir/c7-1.qcow2
...... <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/vdir/c7-1.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> ......
yum install libguestfs-tools -y
virt-cat -a /vdir/c7-1.qcow2 /etc/sysconfig/network
virt-cat -a /vdir/c7-1.qcow2 /etc/sysctl.conf
virt-edit /vdir/c7-1.qcow2 /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="dhcp" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="eth0" UUID="65cab493-29f8-40d5-aab0-bbfff3e958b5" DEVICE="eth0" ONBOOT="yes"
virt-df -h c7-1
virsh snapshot-create c7-1
virsh snapshot-current c7-1
virsh snapshot-list c7-1
virsh snapshot-create c7-1
virsh snapshot-revent c7-1 1382572463
virsh snapshot-delete c7-1 1382572463