Bug 1524424 - [downstream clone - 4.1.9] Localdisk hook must prevent VM from being snapshot.
Summary: [downstream clone - 4.1.9] Localdisk hook must prevent VM from being snapshot.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.1.7
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ovirt-4.1.9
: ---
Assignee: Fred Rolland
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On: 1513800
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-11 13:28 UTC by rhev-integ
Modified: 2021-09-09 12:59 UTC (History)
14 users (show)

Fixed In Version: ovirt-engine-4.1.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1513800
Environment:
Last Closed: 2018-01-24 14:43:33 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-43469 0 None None None 2021-09-09 12:59:30 UTC
Red Hat Product Errata RHBA-2018:0135 0 normal SHIPPED_LIVE org.ovirt.engine-root bug fix and enhancement update 2018-01-24 19:39:03 UTC
oVirt gerrit 85103 0 master MERGED engine: Block snapshots on VM with localdisk 2017-12-11 13:29:34 UTC
oVirt gerrit 85273 0 ovirt-engine-4.1 MERGED engine: Block snapshots on VM with localdisk 2017-12-11 14:20:52 UTC

Description rhev-integ 2017-12-11 13:28:34 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1513800 +++
======================================================================

Description of problem:

VDSM localdisk hook[1] does not prevent a VM from being snapshot.
This breaks the chain, merge fails and if shutdown VM wont start. It's also complex to fix.

Apparently would be easy if we had "before_vm_snapshot" hook infra.

Version-Release number of selected component (if applicable):
RHV 4.0, vdsm-4.18

How reproducible:
100%

Steps to Reproduce:
1. Install he hook
2. Snapshot the VM

Actual results:
jsonrpc.Executor/4::DEBUG::2017-11-12 04:02:37,169::storage::315::virt.vm::(path) vmId=`b54f9aa2-c060-4fc6-9879-d33ad87accaa`::Drive vda moved from u'/dev/ovirt-local/ae207ffa-ad36-4927-b634-5ec5c6c284b0' to u'/rhev/data-center/78a89f5e-e88a-40dc-9467-9ccbb77f59d6/c2ba9087-43d9-44b5-a862-32f3a4dafb95/images/1c27de0d-a56c-4bd0-96ed-4e54843b0b4b/ca99bf43-daf9-440a-9469-37cbe8abb76d'

Expected results:
Fail to snapshot

(Originally by Germano Veit Michel)

Comment 4 rhev-integ 2017-12-11 13:28:57 UTC
Missing from initial comment:
[1] https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/localdisk

(Originally by Germano Veit Michel)

Comment 6 rhev-integ 2017-12-11 13:29:08 UTC
Current fix is to basically collapse the chain down to the base image on the local host, then adjust the DB.

Example:

   Volume AAA is the raw  , local to the host, image (i.e.: /dev/ovirt-local/...)
   Volume BBB is the qcow2, on nfs storage   , image (i.e.: /rhev/data-center/...)
   Chain is: [BBB - leaf]
             [AAA - base]
Steps:
1) VM shutdown (!!!)
2) unsafe rebase of image BBB, make it point to AAA's path (so that step 3 can succeed, otherwise qemu-img commit fails to build the chain)
   qemu-img rebase -f qcow2 -t none -u -b AAA -F raw BBB
3) image commit, commit BBB into AAA
   qemu-img commit -f qcow2 -t none -b AAA -d -p BBB
4) metadata fix for AAA
   sed -i 's/VOLTYPE=INTERNAL/VOLTYPE=LEAF/g' AAA.meta
5) Remove BBB (optional, probably safer to do later)
   # rm -rf BBB*
6) Adjust images and snapshots in the DB to make VM with no snapshots and use AAA to start.

(Originally by Germano Veit Michel)

Comment 9 rhev-integ 2017-12-11 13:29:23 UTC
Merged for oVirt 4.2.1 (will be part of RHV 4.2 GA).

Fred/Tal - the patch seems simple enough - let's please clone this and provide a fix for 4.1.9 too.

(Originally by Allon Mureinik)

Comment 10 Kevin Alon Goldblatt 2018-01-21 10:10:18 UTC
Verified with the following code:
------------------------------------------
ovirt-engine-4.1.9-0.2.el7.noarch
vdsm-4.19.44-1.el7ev.x86_64


Verified with the following scenario:
------------------------------------------
1. Create VM with local hook
2. Create snapshot >>>>> fails with message indicating that snapshots are not supported on local hook disks


Moving to VERIFIED!

Comment 13 errata-xmlrpc 2018-01-24 14:43:33 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/RHBA-2018:0135

Comment 14 Franta Kust 2019-05-16 12:54:48 UTC
BZ<2>Jira re-sync


Note You need to log in before you can comment on or make changes to this bug.