[libvirt-users] snapshot-create error

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

On 07/10/2014 01:15 AM, Hong-Hua.Yin@freescale.com wrote:
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
This created an offline internal snapshot. You can do the same with libvirt (which basically calls qemu-img under the hood for an offline guest).
Is there any special qemu command options or kernel configurations to allow libvirt create snapshot?
No, if you are using libvirt to create the snapshot, then it should just work, provided you used libvirt correctly.
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
This says to create a default snapshot of the domain named 'snap'; since you didn't specify any xml file, that default implies an internal snapshot. Is your guest running or offline at the time you attempted this?
# cat sdk.xml <domain type='kvm'> ...
<devices> <emulator>/usr/bin/qemu-system-ppc</emulator> <controller type='usb' index='0'/> <controller type='pci' index='0' model='pci-root'/>
What? No <disk> element? You have to have a qcow2 disk associated with your domain before you can create an internal snapshot, regardless of whether the guest is online or offline. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Hong-Hua.Yin@freescale.com