This is a collection of basic XEN and KVM-QEMU command usefull when you have to manage Virtual Machine on Linux.
Virtual Machine XEN and KVM-QEMU basic command
KVM-Qemu
Virtual Machine configuration files are stored in:
/etc/libvirt/qemu/
Virtual Machine list:
[root@localhost ~]# virsh list Id Nome Stato ---------------------------------------------------- 25 NMX_VM2 in esecuzione 26 NMX_VM3 in esecuzione 28 NMX_VM1 in esecuzione
Start Virtual Machine:
virsh create /etc/libvirt/qemu/file.xml
Shutdown Virtual Machine (even if the command is “destroy” don’t be scared it doesn’t destroy your VM, only stop it):
virsh destroy virtual-machine-name
Clone Virtual Machine:
virt-clone --original name-sorg --name name-dest 2 --file disco
es:
virt-clone –original NMX_VM1 –name NMX_VM2 –file /dev/VolGroup01/LV_NMX_VM2
Create and edit Virtual Machine
virsh dumpxml virsh edit
XEN (not supported on Centos 6 – 64bit)
VM File location:
/etc/xen/cluster/
Basic Command
xm list xm destroy VM xm create /etc/xen/VM xm top