Bug 1529394

Summary: [DR] - detaching of a storage domain with existing VM leases for VMs in down status fails which affect the failback flow
Product: [oVirt] ovirt-engine Reporter: Maor <mlipchuk>
Component: Backend.CoreAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: high Docs Contact:
Priority: high    
Version: 4.2.0CC: amureini, bugs, ratamir, tnisan, ylavi
Target Milestone: ovirt-4.2.3Flags: rule-engine: ovirt-4.2+
ylavi: exception+
Target Release: 4.2.3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.3.2 Doc Type: If docs needed, set a value
Doc Text:
Detaching of a storage domain that contains VM leases of templates and VMs in the system is now allowed. The domain will be detached without the actual leases removed from the storage, also the VMs and templates will still contain the lease association and will not run until they are manually removed (this is by design)
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-10 06:28:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maor 2017-12-27 22:40:12 UTC
Description of problem:
in commit 26b57d4c0926ae97e86e20c1ea41f8feea83efd2 we introduced a behavior which blocks the detach of a storage domain when any VM contains a lease on a storage domain.
This behavior might be problematic for the support of DR site-to-site related to the fail-back scenario.

Version-Release number of selected component (if applicable):
4.2

How reproducible:
100%

Steps to Reproduce:
1. Add a VM lease on a storage domain
2. Move the storage domain to maintenance
3. Detach that storage domain

Actual results:
The detach operation is blocked

Expected results:
IMHO leases should be treated the same as we do with VM's disks.
If the VM is down we allow to detach the storage domain and the VM's disks are removed from the DB and can be restored once the VM will be registered again to the setup.

I think that the same behavior should apply for VM leases.
The engine should be able to detach the storage domain containing that lease and eventually restore it once the VM will be registered.

Currently, the VM leases are not part of the VM's/Template's OVF, so until they do, I think that we should avoid block the detach operation

Additional info:

Comment 1 Tal Nisan 2017-12-28 10:17:05 UTC
That's an option although the thing is that we cannot "register" those leases later, can we circumvent it while fall-backing or is it a must to change the behavior?

Comment 2 Maor 2017-12-28 11:54:38 UTC
(In reply to Tal Nisan from comment #1)
> That's an option although the thing is that we cannot "register" those
> leases later

Why not? We need to add this info in the OVF and once VM will be registered we will add it as part of the vm_static.
I think that we should support recovery of leases eventually, if the user will encounter a disaster he/she will probably want to have their leases back.

> , can we circumvent it while fall-backing or is it a must to
> change the behavior?

I thought about it but then we will need to manage that through ansible which I don't want to go there because it will complex the entire playbook.
For example we will have to remove those leases, what if it will fail? What if we will fail to add them on register?

Comment 3 Tal Nisan 2017-12-28 15:15:28 UTC
OK, will handle that, thanks for the input

Comment 4 Kevin Alon Goldblatt 2018-04-24 12:44:54 UTC
Verified with the following code:
-------------------------------------------
ovirt-engine-4.2.3-0.1.el7.noarch
vdsm-4.20.25-1.el7ev.x86_64

Verified with the following scenario:
-------------------------------------------

Steps to Reproduce:
1. Add a VM lease on a storage domain
2. Move the storage domain to maintenance
3. Detach that storage domain >>>>> works fine
4. Attach the storage domain again >>>> works fine

Actual results:
The detach operation is successfull


Moving to VERIFIED

Comment 5 Sandro Bonazzola 2018-05-10 06:28:07 UTC
This bugzilla is included in oVirt 4.2.3 release, published on May 4th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.3 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.