Bug 1452823

Summary: [Microsoft]Auto_placement provision fails due to selecting Host in Maintenance state
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ProvisioningAssignee: William Fitzgerald <wfitzger>
Status: CLOSED ERRATA QA Contact: Jeff Teehan <jteehan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: cpelland, dajo, gblomqui, gmccullo, jfrey, jhardy, jteehan, lkhomenk, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: provider:scvmm::provision:auto
Fixed In Version: 5.8.0.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1452820 Environment:
Last Closed: 2017-05-31 15:13:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: VMware Target Upstream Version:
Embargoed:
Bug Depends On: 1452820, 1454880    
Bug Blocks:    

Comment 2 dajohnso@redhat.com 2017-05-22 20:29:28 UTC
Satoe, is the fixed in version field right here?

Comment 3 Satoe Imaishi 2017-05-22 20:32:00 UTC
Yes, 5.8.0.9 includes the fix.

Comment 4 Jeff Teehan 2017-05-23 16:54:11 UTC
This is never going to work.  We're not collecting the Host state from get_inventory.ps  Need HyperVStateString, not OverallState

Name                                                   OverallState HyperVStateString
----                                                   ------------ -----------------
dhcp129-212.brq.redhat.com                           NeedsAttention Unknown
qeblade26.cfme-qe-vmm-ad.rhq.lab.eng.bos.redhat.com MaintenanceMode Running
qeblade33.cfme-qe-vmm-ad.rhq.lab.eng.bos.redhat.com              OK Running

Dan is working on it. ManageIQ/manageiq#15202

Comment 5 Greg McCullough 2017-05-23 17:13:46 UTC
Let's be clear here, the PR for automate is correct in that we should be checking the maintenance flag during provisioning best-fit.

The issue that Jeff raises is that it has a dependency on the provider to properly set the maintenance flag during inventory refresh which is being addressed in the referenced PR https://github.com/ManageIQ/manageiq/pull/15202.

Comment 6 Jeff Teehan 2017-05-23 17:50:24 UTC
Greg is correct.  Sorry about that first line.  I applied Dan's patch to the test machine and now see this in the log:

[----] E, [2017-05-23T13:30:54.409156 #39368:b8914c] ERROR -- : Q-task_id([miq_provision_12]) <SCVMM> MIQ(Class#log_dos_error_results) Virtual machine jt523a cannot be deployed or migrated to host qeblade26.cfme-qe-vmm-ad.rhq.lab.eng.bos.redhat.com because the host is in maintenance mode.

There is a follow-on issue in the it fails right after because it still attempts start_clone_task even though it already failed.  Here is the line immediately after the above line:

[----] E, [2017-05-23T13:30:54.640847 #39368:b8914c] ERROR -- : Q-task_id([miq_provision_12]) MIQ(ManageIQ::Providers::Microsoft::InfraManager::Provision#provision_error) [[JSON::ParserError]: 743: unexpected token at ''] encountered during phase [start_clone_task]

I need guidance on whether this is something else or part of this bz.  My guess is that the task_id([xyz}) should be terminated at the maintenance mode check, and the maintenance mode text should be placed into the requests last message.

Comment 7 Jeff Teehan 2017-05-25 19:26:12 UTC
When I applied 15202, this particular issue does not occur.  I'm moving it to verified based on that and discussion with dev.

Comment 9 errata-xmlrpc 2017-05-31 15:13:38 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/RHSA-2017:1367