Bug 1414975

Summary: vCenter DVS network selection after upgrade to CloudForms 4.2 fails
Product: Red Hat CloudForms Management Engine Reporter: myoder
Component: ProvisioningAssignee: Adam Grare <agrare>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: medium Docs Contact:
Priority: high    
Version: 5.7.0CC: agrare, brant.evans, gmccullo, jhardy, jocarter, myoder, obarenbo, saali, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: vmware:sdn
Fixed In Version: 5.8.0.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1427298 (view as bug list) Environment:
Last Closed: 2017-06-12 16:47:46 UTC Type: Bug
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:    
Bug Blocks: 1427298    
Attachments:
Description Flags
cfme-4.1 provision/container/network.rb
none
5.7.0.17 dvPortgroup uid_ems hotfix none

Description myoder 2017-01-19 21:13:54 UTC
Description of problem: 

Trying to provision a VM through automate and the following methods are not working.  These methods worked in CloudForms 4.1 and are failing after the upgrade to CloudForms 4.2 

selected_network = "dvs_FCS Cloud Network"
prov.set_option(:vlan , selected_network )


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

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 6 Adam Grare 2017-01-20 20:47:16 UTC
We found that the DistributedVirtualPortgroup MOR and the key while typically are equal do not have to be.  When they are not equal we are setting the portgroupKey to be the MOR and VMware fails to find the portgroup.

We need to store the dvportgroup.key in uid_ems instead of dvportgroup.MOR.

Comment 7 Adam Grare 2017-01-20 20:49:19 UTC
Created attachment 1242996 [details]
cfme-4.1 provision/container/network.rb

Workaround is to revert the app/models/manageiq/providers/vmware/infra_manager/provision/configuration/network.rb file back to 4.1 (attached) which looks up the dvportgroup from the VC instead of the database.

Comment 8 Adam Grare 2017-01-25 18:26:56 UTC
I was able to reproduce this issue by importing a DVSwitch from another VC and selecting Preserve original switch and port identifiers.

I have a PR to fix the issue, https://github.com/ManageIQ/manageiq-providers-vmware/pull/5

I'm attaching a refresh_parser.rb file from 5.7 with the change from that PR included, can you have the customer copy this file to /var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb, restart evmserver, and try to reproduce?

Comment 9 Adam Grare 2017-01-25 18:28:34 UTC
Created attachment 1244342 [details]
5.7.0.17 dvPortgroup uid_ems hotfix

app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb from 5.7.0.17 with https://github.com/ManageIQ/manageiq-providers-vmware/pull/5 applied