Showing posts with label KVM. Show all posts
Showing posts with label KVM. Show all posts

KVM commands

To install with prompt

virt-install --prompt


List virtual machine
virsh list


Stop virtual machine
virsh destroy 


Configure VM autostart
virsh autostart 


Unconfigure VM autostart
virsh autostart --disable 


To install using kickstart
virt-install --name=rhel03.localdomain -r 768 --disk path=/var/lib/libvirt/images/rhel03.localdomain.img,size=8 -l http://192.168.122.1/pub/inst -x "ks=http://192.168.122.1/pub/ks/rhel03.cfg"


To create VM snapshot
virsh save centos01 centos01.snap.$(date +%y%m%d)


To restore VM snapshot
virsh shutdown centos01
virsh restore centos01.snap


Clone vm
virt-clone --original centos01 --name centos02 --file /home/penoycentral/images/centos02.img


Troubleshooting KVM

Error when starting the VM snapshot
error restoring domain unable to read from monitor


To fix
virsh managedsave-remove domain-name

By penoi on Monday, April 30, 2012 | | A comment?

Corrupted Virtual Machine snapshot in KVM

Got this error when booting up my Virtual Machine in KVM

error restoring domain unable to read from monitor

To fix and remove the corrupted suspended session:
virsh managedsave-remove domain-name

then restart your VM

 

ref: http://johnpoelstra.com/2011/10/19/resuming-corrupted-suspended-guests/

By penoi on Sunday, February 5, 2012 | , | A comment?