Bug 1435814

Summary: [VMWARE]Auto_placement provision fails if best_fit host doesn't have selected VM Network
Product: Red Hat CloudForms Management Engine Reporter: Leo Khomenko <lkhomenk>
Component: ProvisioningAssignee: Lucy Fu <lufu>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: cpelland, jhardy, lufu, obarenbo, saali, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: vmware:provision
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1458363 (view as bug list) Environment:
Last Closed: 2018-03-06 15:38:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: VMware Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1458363    

Description Leo Khomenko 2017-03-24 21:14:57 UTC
Description of problem: VM provision with auto_placement fails if best_fit host doesn't have selected VM Network

[EVM] VM [test_vlan_lkhom_3] Step [CheckProvisioned] Status [[MiqException::MiqProvisionError]: Port group [DPortGroup] is not available on target] Message [[MiqException::MiqProvisionError]: Port group [DPortGroup] is not available on target]


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


How reproducible:100%


Steps to Reproduce:
1.Prepare env on which host A won't have VM Network B
2.Host A also should be the best choice for provisioning
3.Provision VM with auto_placement and select VM Network B

Actual results:provision fails


Expected results:auto_placement should affect VM Network also


Additional info:this issue is not reproducible with manual Host/Datastore selection as selected Host limits VM network options

Comment 2 Greg McCullough 2017-04-26 18:25:52 UTC
Lucy, VMware best-fit for ManageIQ uses the eligible_hosts method, which means it calls allowed_hosts on the workflow

See here: https://github.com/ManageIQ/manageiq-content/blob/master/content/automate/ManageIQ/Infrastructure/VM/Provisioning/Placement.class/__methods__/vmware_best_fit_least_utilized.rb#L18

We need to look into having the VMware allowed_hosts method filter the hosts if a network is already selected.  Adam would be a good resource here.

Comment 4 CFME Bot 2017-05-01 14:21:43 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/4c807454c8398b476f21bbba21addd94400debfd

commit 4c807454c8398b476f21bbba21addd94400debfd
Author:     Lucy Fu <lufu>
AuthorDate: Fri Apr 28 15:43:04 2017 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Fri Apr 28 15:46:09 2017 -0400

    Filter out the hosts with the selected network.
    
    Once a network is selected, the available hosts should be filtered out to the hosts that are on the selected network.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1435814

 app/models/miq_provision_virt_workflow.rb       |  9 +++++++
 spec/models/miq_provision_virt_workflow_spec.rb | 31 +++++++++++++++++++++++++
 2 files changed, 40 insertions(+)