[libvirt-users] snapshot-create error
by Hong-Hua.Yin@freescale.com
Hi,
What's the difference between QEMU snapshot and libvirt snapshot?
# qemu-img create -f qcow2 disk.img 512
Formatting 'disk.img', fmt=qcow2 size=512 encryption=off cluster_size=65536 lazy_refcounts=off
# qemu-img info disk.img
image: disk.img
file format: qcow2
virtual size: 512 (512 bytes)
disk size: 136K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
# /usr/bin/qemu-system-ppc -M ppce500 -enable-kvm -m 512 -nographic -kernel /dev/shm/uImage -initrd /dev/shm/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4444,server,telnet -snapshot -hda disk.img
QEMU 1.7.0 monitor - type 'help' for more information
(qemu) QEMU waiting for connection on: telnet:0.0.0.0:4444,server
(qemu) savevm
(qemu) info snapshot
unknown command: 'info snapshot'
(qemu) info snapshots
ID TAG VM SIZE DATE VM CLOCK
1 vm-20140709035738 173M 2014-07-09 03:57:38 00:00:07.401
Is there any special qemu command options or kernel configurations to allow libvirt create snapshot?
I got the error as below:
virsh # snapshot-create snap
error: unsupported configuration: internal snapshots and checkpoints require all disks to be selected for snapshot
The domain XML file is converted as below steps.
# cat >snap.args <<EOF
/usr/bin/qemu-system-ppc -name snap -M ppce500 -enable-kvm -m 512 -nographic -kernel /dev/shm/uImage -initrd /dev/shm/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial pty
# virsh domxml-from-native qemu-argv snap.args >snap.xml
# cat sdk.xml
<domain type='kvm'>
<name>sdk</name>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc' machine='ppce500'>hvm</type>
<kernel>/dev/shm/uImage</kernel>
<initrd>/dev/shm/ramdisk</initrd>
<cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-ppc</emulator>
<controller type='usb' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon>
</devices>
</domain>
Best Regards,
Olivia