-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent a DVPortGroup from overwriting a LAN with the same name in provisioning #14292
Prevent a DVPortGroup from overwriting a LAN with the same name in provisioning #14292
Conversation
h.lans.each do |l| | ||
next if l.switch.shared? && !@vlan_options[:dvs] | ||
|
||
key = if l.switch.shared? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agrare The logic here looks correct, but I am wondering if it should be moved to the ManageIQ/manageiq-providers-vmware repo?
Is there any reason to keep this as base provision_workflow logic? No other providers need this that I am aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole method or just the DVS handling?
The issue I had with just moving the DVS stuff was that by the time it got to manageiq-providers-vmware
the regular network and the dvs network had already collided so there was only one entry in the hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DVS
is specific to VMware so wondering if we can move that into that provider while retaining basic network logic here for the other infra providers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that would be great...could we skip any shared switches here and handle them on the vmware side? Either that or use the uid_ems
instead of the name as the key?
Keep DVPortGroups with the same name as a standard Network from colliding in the vlans hash https://bugzilla.redhat.com/show_bug.cgi?id=1430709
d02183e
to
8eb552c
Compare
Checked commit agrare@8eb552c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@gmcculloug I changed the base method to skip over all DVPortGroups so the Can you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ended up looking better then I thought it would. Nice job! 🌟
During the provisioning workflow we return the list of allowed_vlans as a hash with the name of the network as the key.
If you have a DVPortGroup and a normal network with the same name they will have only one entry in the
vlans
hash.Later we change the
vlans
key of a DVS to be"dvs_#{name}
and delete the old key: https://github.com/ManageIQ/manageiq-providers-vmware/blob/master/app/models/manageiq/providers/vmware/infra_manager/provision_workflow.rb#L141-L142This leads to only one entry in the
vlans
hash and it is the dvportgroup, the standard network is deleted.This change will set the key of a dvportgroup to have the
dvs_
prefix initially so it will not collide with non dvportgroups and both will be returned.VC Networks:
Before:
After:
Related: ManageIQ/manageiq-providers-vmware#25
https://bugzilla.redhat.com/show_bug.cgi?id=1430709