Bug 1463780

Summary: Smart state analysis on a running vm on Azure doesn't work
Product: Red Hat CloudForms Management Engine Reporter: mlessard
Component: SmartState AnalysisAssignee: Jerry Keselman <jkeselma>
Status: CLOSED CURRENTRELEASE QA Contact: Satyajit Bulage <sbulage>
Severity: high Docs Contact:
Priority: high    
Version: 5.8.0CC: dajohnso, jcutter, jhardy, mlessard, obarenbo, roliveri, sbulage, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: azure:ssa
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1491310 (view as bug list) Environment:
Last Closed: 2018-03-06 15:00:23 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: 1491310    

Description mlessard 2017-06-21 18:17:39 UTC
Description of problem:
When we launch a smart state analysis on a running vm on Azure, we are getting an error and the smart state analysis doesn't retrieve vm information. If we shutdown the vm, the smart state analysis works. 

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

How reproducible:


Steps to Reproduce:
1. Launch a RHEL vm on Azure
2. In Cloudforms, launch a smart state analysis
3.

Actual results:

The error we are getting is : 
Unable to mount filesystem. Reason:[[409]    <?xml version="1.0" encoding="utf-8"?> <Error><Code>SystemInUse</Code><Message>This blob is being used by the system. RequestId:33b30ab1-001c-0065-3098-eaba42000000 Time:2017-06-21T14:16:00.6238188Z</Message></Error> (cause: 409 Conflict) - https://mlessarddisks645.blob.core.windows.net/vhds/RHEL7320170621095236.vhd

Expected results:

This should run without any error 

Additional info:

Comment 7 Jerry Keselman 2017-09-11 18:20:26 UTC
PRs 

https://github.com/ManageIQ/manageiq-smartstate/pull/26
https://github.com/ManageIQ/manageiq-providers-azure/pull/122
and
https://github.com/ManageIQ/manageiq

support fixing this issue.  They are in the process of being reviewed.

Comment 8 Jerry Keselman 2017-09-12 13:14:48 UTC
The last PR above should be https://github.com/ManageIQ/manageiq/pull/15960

Comment 9 Jerry Keselman 2017-09-12 18:42:43 UTC
All PRs are merged.  This fix will be back-ported to Fine and a Hotfix released.

Comment 11 Satoe Imaishi 2017-09-13 13:38:30 UTC
Putting back to ON_DEV as new version of manageiq-smartstate gem needs to be released for this.

Comment 12 Jerry Keselman 2017-09-13 13:50:13 UTC
We also need to put similar wait functionality in for the blob snapshot as in the managed disk scenario.  Testing now.

Comment 13 Jerry Keselman 2017-09-13 17:33:09 UTC
https://github.com/ManageIQ/manageiq/pull/15970 bumps the manageiq-smartstate gem version to 0.1.4.  Not needed for FINE since that functionality lives in manageiq-gems-pending at that point.  Already merged.

https://github.com/ManageIQ/manageiq-providers-azure/pull/125 has been pushed to add the wait functionality specified above.  Waiting for review and merge.

Comment 15 CFME Bot 2017-09-15 21:08:07 UTC
New commit detected on ManageIQ/manageiq-providers-azure/master:
https://github.com/ManageIQ/manageiq-providers-azure/commit/dda46b223ee4f3123662d3297e9c859b49e893f2

commit dda46b223ee4f3123662d3297e9c859b49e893f2
Author:     Richard Oliveri <roliveri>
AuthorDate: Fri Sep 15 16:36:34 2017 -0400
Commit:     Richard Oliveri <roliveri>
CommitDate: Fri Sep 15 16:36:34 2017 -0400

    Changes to wait for snapshot completion.
    
    Loosened check for success. Added debugging to help determine the problem.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1463780
    https://bugzilla.redhat.com/show_bug.cgi?id=1475540

 app/models/manageiq/providers/azure/cloud_manager.rb | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Comment 16 Satyajit Bulage 2017-11-29 15:00:59 UTC
Able to perform SSA on Power ON as well as Power OFF instance.

Verified Version: 5.9.0.11.20171127204214_e316988