Bug 1298748

Summary: ISO provisioning always fails because it can't start the VM while the disk is locked
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: AutomateAssignee: Drew Bomhof <dbomhof>
Status: CLOSED ERRATA QA Contact: Shveta <sshveta>
Severity: medium Docs Contact:
Priority: high    
Version: 5.5.0CC: cpelland, dbomhof, jhardy, jprause, mfeifer, mkanoor, obarenbo, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.6.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1301660 1301662 (view as bug list) Environment:
Last Closed: 2016-06-29 15:30:27 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:
Bug Depends On:    
Bug Blocks: 1301660, 1301662    

Description Josh Carter 2016-01-14 22:25:02 UTC
Description of problem:

When ISO provisioning from CloudForms 4.0, the automation state machine exits on Error with [Ovirt::Error]: [Cannot run VM: The following disks are locked: cfme-template_Disk1. Please try again in a few minutes.]. I'm not sure if the problem is with RHEV reporting a READY state prematurely or if CloudForms is not properly checking state.

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


How reproducible:
very

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Greg McCullough 2016-01-14 22:44:31 UTC
Drew - The customize_destination state in rhev native provisioning calls destination_image_locked? and re-queues the state if the provider returns that the image is locked.  Both ISO and PXE provisioning override this method and do not have the destination_image_locked? check.

Might be worth investigating if there is a way to make the first part of customize_destination common that could handle the image locked check and then transition to a state that can be overridden for the different provisioning types (native, iso, pxe) which all do different actions in the customize_destination method today.

Comment 4 CFME Bot 2016-01-21 14:50:56 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ccee4be4278e46999e7498bbff10929d1a602f95

commit ccee4be4278e46999e7498bbff10929d1a602f95
Author:     Drew Bomhof <dbomhof>
AuthorDate: Tue Jan 19 15:35:12 2016 -0500
Commit:     Drew Bomhof <dbomhof>
CommitDate: Tue Jan 19 15:54:35 2016 -0500

    Added destination_image_locked? check to RHEV iso/pxe provisioning
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298748
    
    The destination_image_locked? method was only being
    called on native RHEV provisioning.  This change slightly
    refactors the customize_destination method to enable
    the destination_image_locked? check for all RHEV
    provisioning types

 .../infra_manager/provision/state_machine.rb       |  9 ++++---
 .../provision_via_iso/state_machine.rb             |  8 +-----
 .../provision_via_pxe/state_machine.rb             |  7 +-----
 .../infra_manager/provision/state_machine_spec.rb  |  9 +++++--
 .../provision_via_iso/state_machine_spec.rb        |  9 +++++--
 .../provision_via_pxe/state_machine_spec.rb        | 29 ++++++++++++++++++++++
 6 files changed, 51 insertions(+), 20 deletions(-)
 create mode 100644 spec/models/manageiq/providers/redhat/infra_manager/provision_via_pxe/state_machine_spec.rb

Comment 5 Drew Bomhof 2016-01-25 16:16:54 UTC
*** Bug 1301662 has been marked as a duplicate of this bug. ***

Comment 6 CFME Bot 2016-02-10 19:54:06 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=d547fbc7ccb8202f1f6fcaf798d3ead9615c0bb2

commit d547fbc7ccb8202f1f6fcaf798d3ead9615c0bb2
Author:     Drew Bomhof <dbomhof>
AuthorDate: Tue Jan 19 15:35:12 2016 -0500
Commit:     Drew Bomhof <dbomhof>
CommitDate: Mon Jan 25 15:05:16 2016 -0500

    Added destination_image_locked? check to RHEV iso/pxe provisioning
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298748
    
    The destination_image_locked? method was only being
    called on native RHEV provisioning.  This change slightly
    refactors the customize_destination method to enable
    the destination_image_locked? check for all RHEV
    provisioning types

 .../infra_manager/provision/state_machine.rb       |  9 +++--
 .../provision_via_iso/state_machine.rb             |  8 +---
 .../provision_via_pxe/state_machine.rb             |  7 +---
 .../infra_manager/provision/state_machine_spec.rb  | 44 ++++++++++++----------
 .../provision_via_iso/state_machine_spec.rb        | 15 +++++---
 .../provision_via_pxe/state_machine_spec.rb        | 29 ++++++++++++++
 6 files changed, 72 insertions(+), 40 deletions(-)
 create mode 100644 spec/models/manageiq/providers/redhat/infra_manager/provision_via_pxe/state_machine_spec.rb

Comment 7 Shveta 2016-04-19 01:47:08 UTC
Fixed.
Verified in 5.6.0.1-beta2.20160413141124_e25ac0e

Comment 9 errata-xmlrpc 2016-06-29 15:30:27 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-2016:1348