Red Hat Bugzilla – Bug 1430642
[RFE] virt-install: add snapshot attribute for disk
Last modified: 2018-04-10 07:42:12 EDT
Description of problem: In libvirt disk xml, there is a snapshot attribute to disable VM creating disk snapshot: <disk type='file' device='disk' snapshot='no'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/BZ1106416.qcow2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> But currently this attribute is not in virt-install: # virt-install --disk=\?|grep snapshot It's better to introduce this attribute so that we can create an VM disabling snapshot by default.
Upstream patch posted: https://www.redhat.com/archives/virt-tools-list/2017-September/msg00031.html
Upstream commit: commit af91d51fc8d2cb14b0a4b82b8bd671fa9dfc088f Author: Pavel Hrdina <phrdina@redhat.com> Date: Wed Sep 6 09:13:44 2017 +0200 cli: introduce snapshot_policy parameter for disk device
Try to verify this bug with new build: virt-manager-1.4.3-1.el7.noarch Steps: 1. Introduce snapshot_policy parameter for disk device # virt-install --disk=\?|grep snapshot snapshot_policy 2. Create a new VM with disabling snasphot for disk: # virt-install --name test-snap --memory 1024 \ --location /root/Downloads/RHEL-7.4-20170711.0-Server-x86_64-dvd1.iso \ --disk path=/var/lib/libvirt/images/test-qcow2-yes.img,size=8,format=qcow2,snapshot_policy=no \ --graphics vnc Result: Installation finshed successfully. 2.1 Check VM xml file, finding snapshot='no' in xml <disk type='file' device='disk' snapshot='no'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/test-qcow2-yes.img'/> <backingStore/> -- 2.2 Try to create internal snapshot when VM is inactive: Launch virt-manager and connect to VM console, select 'Manage VM Snapshots', then click 'Create new snapshot' button(keep default setting and click 'Finish'). Result: Error creating snapshot: unsupported configuration: nothing selected for snapshot The result is expected. 2.3 Try to create internal snapshot when VM is active:(steps same as step2.2) Result: Error creating snapshot: unsupported configuration: internal snapshots and checkpoints require all disks to be selected for snapshot The result is expected. As a summary, newly added attribute "snapshot_policy=yes" works well, so move this bug from ON_QA to VERIFIED, thanks
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0726