Bug 1430642

Summary: [RFE] virt-install: add snapshot attribute for disk
Product: Red Hat Enterprise Linux 7 Reporter: Han Han <hhan>
Component: virt-managerAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: juzhou, kuwei, mxie, tzeng, xiaodwan, xuzhang
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-manager-1.4.3-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 11:40:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Han Han 2017-03-09 08:11:03 UTC
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.

Comment 2 Pavel Hrdina 2017-09-06 07:18:44 UTC
Upstream patch posted:

https://www.redhat.com/archives/virt-tools-list/2017-September/msg00031.html

Comment 3 Pavel Hrdina 2017-09-12 07:02:13 UTC
Upstream commit:

commit af91d51fc8d2cb14b0a4b82b8bd671fa9dfc088f
Author: Pavel Hrdina <phrdina>
Date:   Wed Sep 6 09:13:44 2017 +0200

    cli: introduce snapshot_policy parameter for disk device

Comment 5 zhoujunqin 2017-09-25 09:38:39 UTC
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

Comment 8 errata-xmlrpc 2018-04-10 11:40:46 UTC
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