Skip to content
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

ovirt-networking: using profiles #14991

Merged
merged 1 commit into from
Jun 6, 2017

Conversation

AlonaKaplan
Copy link
Contributor

@AlonaKaplan AlonaKaplan commented May 4, 2017

This patch fixes some issues in oVirt vm provision network tab.

  1. Changing the 'vLan' label to 'Network'
  2. Displaying the vnic profiles instead of the host/hosts networks (only
    profiles configured in the cluster).
  3. Using OvirtSDK4.

Changes relevant to version 4 only.

@AlonaKaplan
Copy link
Contributor Author

@borod108 @masayag please review

@AlonaKaplan
Copy link
Contributor Author

@Ladas please review

@masayag
Copy link
Contributor

masayag commented May 9, 2017

Shouldn't it be labelled with 'enhancement' instead of 'bug' ?

@@ -418,8 +418,8 @@
:dvs: true
:vlans: true
:method: :allowed_vlans
:description: vLan
:required: true
:description: Virtual Nic Profile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the 'Virtual Nic Profile' be used as a header as a dependency of the provider highest supported version ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be NIC not Nic since it is an acronym?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, changed to Network

rails_logger('allowed_vlans', 1)
end

return vlans, hosts
end

def load_allowed_vlans(hosts, vlans)
hosts.each do |h|
h.lans.each { |l| vlans[l.name] = l.name if @vlan_options[:dvs] || !l.switch.shared? }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you pass @vlan_options as a parameter?

def load_allowed_vlans(hosts, vlans, vlan_options = [])

@agrare ^ this should not break VMware? Not sure if we have specs for this particular case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't break VMware because we override the whole available_vlans_and_hosts method here

Why did you add back in the if @vlan_options[:dvs]? I removed this in this PR #14292 because we moved all dvs handling to vmware here ManageIQ/manageiq-providers-vmware#25

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this more I don't think you need to touch this at all, its just moving code around and its just three lines so I don't think it helps readability, unless you're planning on overriding the load_allowed_vlans method in a subclass I think you should just leave it the way it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha so I just noticed you did exactly that here https://github.com/ManageIQ/manageiq-providers-ovirt/pull/27/files#diff-9be4bb7e189cb01956b975459128cc04R96 so completely ignore https://github.com/ManageIQ/manageiq/pull/14991/files#r115488788 :)

Still you should leave the unless l.switch.shared? from the original method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@AlonaKaplan
Copy link
Contributor Author

@borod108 @masayag @agrare @Ladas please review.

@masayag
Copy link
Contributor

masayag commented Jun 5, 2017

@miq-bot remove_label bug
@miq_bot add_label enhancement

@miq-bot miq-bot removed the bug label Jun 5, 2017
@masayag
Copy link
Contributor

masayag commented Jun 5, 2017

@miq_bot add_label enhancement

@masayag
Copy link
Contributor

masayag commented Jun 5, 2017

@AlonaKaplan please update the PR message:

Changing the 'vLan' label to 'Virtual Nic Profile'

According to this commit the new name is 'Network'.
Also pls fix typo in

overdding

or omit that part completely as it is irrelevant for this specific PR.

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one small change

load_hosts_networks(hosts, vlans)
end

def load_hosts_networks(hosts, vlans)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave this as _vlans instead of _networks for consistency? I don't agree with us using vlans here (I like networks better personally) but the concept is called vlans everywhere else here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This patch fixes some issues in oVirt vm provision network tab.
1. Changing the 'vLan' label to 'Network'
2. Displaying the vnic profiles instead of the host/hosts networks (only
profiles configured in the cluster).
3. Using OvirtSDK4.

Changes relevant to version 4 only.
@miq-bot
Copy link
Member

miq-bot commented Jun 6, 2017

Checked commit AlonaKaplan@7049afa with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great 👍

@durandom
Copy link
Member

durandom commented Jun 6, 2017

@miq-bot add_label enhancement

@agrare agrare merged commit e831cbe into ManageIQ:master Jun 6, 2017
@agrare agrare added this to the Sprint 62 Ending Jun 5, 2017 milestone Jun 6, 2017
@gmcculloug
Copy link
Member

@oourfali @AlonaKaplan Do you see any issue with back-porting this PR to the Fine branch? We are running into conflicts back-porting PR ManageIQ/manageiq-providers-vmware#78 which builds on these changes.

simaishi added a commit that referenced this pull request Aug 9, 2017
ovirt-networking: using profiles
(cherry picked from commit e831cbe)
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2017

As per conversation with @gmcculloug, only taking the changes in miq_provision_virt_workflow.rb in backport.

Fine backport details:

$ git log -1
commit 3682e0fda839b73ca175e17bbb8eb50e24010352
Author: Satoe Imaishi <simaishi@redhat.com>
Date:   Wed Aug 9 09:22:47 2017 -0400

    Merge pull request #14991 from AlonaKaplan/ovirt_networking_2
    
    ovirt-networking: using profiles
    (cherry picked from commit e831cbe3f4b0d4bcdbdbae082a174e38f794a842)

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
ovirt-networking: using profiles
(cherry picked from commit e831cbe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.