Bug 1347731

Summary: The engine refuses to change the disk editing the engine VM - blocking hosted-engine upgrade flow from 3.6/el6 to 4.0/el7
Product: [oVirt] ovirt-engine Reporter: Simone Tiraboschi <stirabos>
Component: BLL.HostedEngineAssignee: Roy Golan <rgolan>
Status: CLOSED WONTFIX QA Contact: Jiri Belka <jbelka>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.0.0CC: bmcclain, bugs, dfediuck, lsurette, pstehlik, rbalakri, rgolan, Rhev-m-bugs, srevivo, stirabos, ykaul, ylavi
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 10:18:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1343593    

Description Simone Tiraboschi 2016-06-17 13:40:14 UTC
Description of problem:
The engine refuses to change the disk editing the engine VM.
This is needed by the upgrade flow of hosted-engine from 3.6/el6 to 4.0/el7: 
in the upgrade flow we are creating a new floating disk and we are deploying here the 4.0 appliance were we'll restore the engine backup.
Only at the end, if and only if everything id fine, we use engine 4.0 to edit the engine VM to permanently point to the new disk.

2016-06-17 06:58:15,075 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-16) [35a97f3d] Lock Acquired to object 'EngineLock:{exclusiveLocks='[HostedEngine=<VM_NAME, ACTION_TYPE_FAILED_VM_IS_BEING_UPDATED>]', sharedLocks='[65064c09-fdd3-4f21-9cf5-33a965f0e122=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_UPDATED>]'}'
2016-06-17 06:58:15,079 WARN  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-16) [35a97f3d] Validation of action 'UpdateVm' failed for user admin@internal-authz. Reasons: VAR__ACTION__UPDATE,VAR__TYPE__VM,VM_CANNOT_UPDATE_HOSTED_ENGINE_FIELD
2016-06-17 06:58:15,080 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (default task-16) [35a97f3d] Lock freed to object 'EngineLock:{exclusiveLocks='[HostedEngine=<VM_NAME, ACTION_TYPE_FAILED_VM_IS_BEING_UPDATED>]', sharedLocks='[65064c09-fdd3-4f21-9cf5-33a965f0e122=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_UPDATED>]'}'
2016-06-17 06:58:15,094 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-16) [] Operation Failed: [There was an attempt to change Hosted Engine VM values that are locked.]

We saw it only since 4.0.0.4-0.1.el7ev, in previous releases it was working for spice and silently failing for vnc.
Marking it as regression.

Version-Release number of selected component (if applicable):
4.0.0.4-0.1.el7ev

How reproducible:
100%

Steps to Reproduce:
1. deploy hosted-engine 3.6
2. try upgrading to 4.0
3.

Actual results:
it fails with: Operation Failed: [There was an attempt to change Hosted Engine VM values that are locked.]

Expected results:
The engine correctly switch the engine VM disk.

Additional info:
This blocks the hosted-engine upgrade flow from 3.6/el6 to 4.0/el7

All the relevant sos reports (engine vm with 3.6/el6 disk, engine vm with 4.0/el7 disk) are on https://bugzilla.redhat.com/1343593

Comment 1 Red Hat Bugzilla Rules Engine 2016-06-17 14:19:05 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Roy Golan 2016-06-19 06:29:07 UTC
This was working by mistake, and probably due to a bug.

BTW is adding a disk was tested before and properly supported by the ovf2VmParams ?

Comment 3 Simone Tiraboschi 2016-06-19 13:55:54 UTC
Here we are not adding a second disk, we are simply changing the boot disk with a floating one from the same storage domain.

Comment 4 Roy Golan 2016-06-20 12:17:40 UTC
So far I added AddDisk and HotPlugDiskToVm to the list of actions HE VM is allowed to perform. It works but the OVF conversion in ovirt-ha-agent needs a fix to properly support > 1 disk.

Comment 5 Roy Golan 2016-06-23 10:18:50 UTC
The hosted engine disks upgrade will be performed differently, generally by swapping the disk content with the new one. The disk, with its ID remains the same.

So the functionality of adding/removing disks for the HE VM is off the table, we don't need that. If needed we should open a proper RFE for that.