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

Skip "none" vApp network when inventoring #198

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

miha-plesko
Copy link
Contributor

@miha-plesko miha-plesko commented Mar 1, 2018

With this commit we prevent NetworkManager from crashing is case when there is a special network "none" listed in vApp network configuration section. This "none" network is a reserved vApp network name which is for some reason present in case when at least one NIC of the vApp VMs is not connected to any network.

Following XML is present for such "none" networks:

<vcloud:NetworkConfig networkName="none">
    <vcloud:Description>This is a special place-holder used for disconnected network interfaces.</vcloud:Description>
    <vcloud:Configuration>
        <vcloud:IpScopes>
            <vcloud:IpScope>
                <vcloud:IsInherited>false</vcloud:IsInherited>
                <vcloud:Gateway>196.254.254.254</vcloud:Gateway>
                <vcloud:Netmask>255.255.0.0</vcloud:Netmask>
                <vcloud:Dns1>196.254.254.254</vcloud:Dns1>
            </vcloud:IpScope>
        </vcloud:IpScopes>
        <vcloud:FenceMode>isolated</vcloud:FenceMode>
    </vcloud:Configuration>
    <vcloud:IsDeployed>false</vcloud:IsDeployed>
</vcloud:NetworkConfig>

and it must be ignored when inventoring.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1520372

@miq-bot add_label enhancement
@miq-bot assign @agrare

With this commit we prevent NetworkManager from crashing is case when there
is a special network "none" listed in vApp network configuration section. This
"none" network is a reserved vApp network name which is for some reason present
in case when at least one NIC of the vApp VMs is not connected to any network.

Following XML is present for such "none" networks:

```
<vcloud:NetworkConfig networkName="none">
    <vcloud:Description>This is a special place-holder used for disconnected network interfaces.</vcloud:Description>
    <vcloud:Configuration>
        <vcloud:IpScopes>
            <vcloud:IpScope>
                <vcloud:IsInherited>false</vcloud:IsInherited>
                <vcloud:Gateway>196.254.254.254</vcloud:Gateway>
                <vcloud:Netmask>255.255.0.0</vcloud:Netmask>
                <vcloud:Dns1>196.254.254.254</vcloud:Dns1>
            </vcloud:IpScope>
        </vcloud:IpScopes>
        <vcloud:FenceMode>isolated</vcloud:FenceMode>
    </vcloud:Configuration>
    <vcloud:IsDeployed>false</vcloud:IsDeployed>
</vcloud:NetworkConfig>
```

and it must be ignored when inventoring.

Signed-off-by: Miha Pleško <[email protected]>
@miha-plesko
Copy link
Contributor Author

@agrare playing with networking customization via vApp template provisioning I just discovered that our NetworkManager inventoring crashes hard in case there is a VM with NIC that is not connected to any network. Turns out it's because vCD then automatically includes a special placeholder "none" which should just be ingored by our refresher.

@miq-bot add_label gaprindashvili/yes

@miq-bot
Copy link
Member

miq-bot commented Mar 1, 2018

Checked commit miha-plesko@5fd5d12 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Yaml - missing config files

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.

👍 LGTM

@agrare agrare added bug and removed enhancement labels Mar 2, 2018
@agrare agrare added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 2, 2018
@agrare agrare merged commit 5fd5d12 into ManageIQ:master Mar 2, 2018
agrare added a commit that referenced this pull request Mar 2, 2018
Skip "none" vApp network when inventoring
simaishi pushed a commit that referenced this pull request Mar 7, 2018
@simaishi
Copy link
Contributor

simaishi commented Mar 7, 2018

Gaprindashvili backport details:

$ git log -1
commit a582070305d6eebe30072731db94bad02e03c0a2
Author: Adam Grare <[email protected]>
Date:   Fri Mar 2 09:04:32 2018 -0500

    Merge pull request #198 from miha-plesko/exclude-none-network
    
    Skip "none" vApp network when inventoring
    (cherry picked from commit a0417bb420e5bf358d936e33845e99a3f73af137)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1552673

@simaishi
Copy link
Contributor

simaishi commented Apr 9, 2018

@miha-plesko @agrare Assume this needs to be fine/yes as well?

@miha-plesko
Copy link
Contributor Author

@simaishi it can't hurt, although we're targeting GA and later. Do you need a separate BZ for fine?

@miq-bot add_label fine/yes

@simaishi
Copy link
Contributor

@miha-plesko I asked because #161 is set to fine/yes and this PR is a followup for that PR as per BZ comment. So both of them don't need to go to Fine branch??

simaishi pushed a commit that referenced this pull request Apr 10, 2018
@miha-plesko
Copy link
Contributor Author

@simaishi thanks for asking. We actually needn't support fine anymore. Reason for confusion is that we were first told 4.5 (fine) needs to be supported, but it was later agreed that 4.6 (GA) will be targeted instead. Marking as fine/no.

@miq-bot remove_label fine/yes
@miq-bot add_label fine/no

@simaishi
Copy link
Contributor

Looks I accidentally had the backport pushed to Fine branch a few days ago... reverted now.

@miha-plesko miha-plesko deleted the exclude-none-network branch January 7, 2019 08:25
agrare pushed a commit to agrare/manageiq-providers-vmware that referenced this pull request Apr 15, 2019
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.

4 participants