Skip to content

Conversation

@simonjbeaumont
Copy link
Contributor

Any IPs on the non-primary bond-slaves would be lost.

An example of the old and new behaviour:

[root@dt04 ~]# xe pif-list device=eth1 --minimal
f628a46c-f483-897b-3234-aecc3c107d84
[root@dt04 ~]# xe pif-list device=eth2 --minimal
76472575-ef64-001f-4305-234e2dfc6f7c
[root@dt04 ~]# xe network-create name-label=bond-network
e7c98ee2-d000-477f-1692-2b6fd741dc3d

Before this patch

[root@dt04 ~]# xe pif-reconfigure-ip uuid=f628a46c-f483-897b-3234-aecc3c107d84 mode=static IP=10.0.0.1 netmask=255.255.255.0 gateway=10.0.0.0
[root@dt04 ~]# xe pif-reconfigure-ip uuid=76472575-ef64-001f-4305-234e2dfc6f7c mode=static IP=10.0.0.2 netmask=255.255.255.0 gateway=10.0.0.0

[root@dt04 ~]# ip address show xenbr1 | grep inet
    inet 10.0.0.1/24 brd 10.0.0.255 scope global xenbr1
[root@dt04 ~]# ip address show xenbr2 | grep inet
    inet 10.0.0.2/24 brd 10.0.0.255 scope global xenbr2

[root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
4a243b9c-6625-4bba-776a-f29873486f81

[root@dt04 ~]# xe bond-list uuid=4a243b9c-6625-4bba-776a-f29873486f81 params=master --minimal
8605deeb-76d4-9637-086f-512779f4c2c6

[root@dt04 ~]# xe pif-list uuid=f628a46c-f483-897b-3234-aecc3c107d84  params=device,IP
    device ( RO): eth1
        IP ( RO):
[root@dt04 ~]# xe pif-list uuid=76472575-ef64-001f-4305-234e2dfc6f7c params=device,IP
    device ( RO): eth2
        IP ( RO): 10.0.0.2
[root@dt04 ~]# xe pif-list uuid=8605deeb-76d4-9637-086f-512779f4c2c6 params=device,IP
device ( RO)    : bond0
        IP ( RO): 10.0.0.1

[root@dt04 ~]# xe network-list uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d params=bridge --minimal
xapi1
[root@dt04 ~]# ip address show xapi1 | grep inet
    inet 10.0.0.1/24 brd 10.0.0.255 scope global xapi1

There is no interface with the IP configuration that's on the other PIF since the xenbr2 iface has gone:

[root@dt04 ~]# ip address show xenbr2 | grep inet
Device "xenbr2" does not exist.

After this patch

[root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
Only one PIF on a bond is allowed to have an IP configuration.
<extra>: f628a46c-f483-897b-3234-aecc3c107d84
<extra>: 76472575-ef64-001f-4305-234e2dfc6f7c

Removing the IP config from either PIF will then allow the Bond.create to succeed:

[root@dt04 ~]# xe pif-reconfigure-ip uuid=f628a46c-f483-897b-3234-aecc3c107d84 mode=none
[root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
f8e5baf8-b620-31e5-abb8-3e3fb214c08d

Signed-off-by: Si Beaumont simon.beaumont@citrix.com

This code has been disabled since the initial commit in this repository
(the import from api.hg) and probably even longer. It's probably time to
ditch it.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Any IPs on the non-primary bond-slaves would be lost.

An example of the old and new behaviour:

    [root@dt04 ~]# xe pif-list device=eth1 --minimal
    f628a46c-f483-897b-3234-aecc3c107d84
    [root@dt04 ~]# xe pif-list device=eth2 --minimal
    76472575-ef64-001f-4305-234e2dfc6f7c
    [root@dt04 ~]# xe network-create name-label=bond-network
    e7c98ee2-d000-477f-1692-2b6fd741dc3d

Before this patch
-----------------

    [root@dt04 ~]# xe pif-reconfigure-ip uuid=f628a46c-f483-897b-3234-aecc3c107d84 mode=static IP=10.0.0.1 netmask=255.255.255.0 gateway=10.0.0.0
    [root@dt04 ~]# xe pif-reconfigure-ip uuid=76472575-ef64-001f-4305-234e2dfc6f7c mode=static IP=10.0.0.2 netmask=255.255.255.0 gateway=10.0.0.0

    [root@dt04 ~]# ip address show xenbr1 | grep inet
        inet 10.0.0.1/24 brd 10.0.0.255 scope global xenbr1
    [root@dt04 ~]# ip address show xenbr2 | grep inet
        inet 10.0.0.2/24 brd 10.0.0.255 scope global xenbr2

    [root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
    4a243b9c-6625-4bba-776a-f29873486f81

    [root@dt04 ~]# xe bond-list uuid=4a243b9c-6625-4bba-776a-f29873486f81 params=master --minimal
    8605deeb-76d4-9637-086f-512779f4c2c6

    [root@dt04 ~]# xe pif-list uuid=f628a46c-f483-897b-3234-aecc3c107d84  params=device,IP
        device ( RO): eth1
            IP ( RO):
    [root@dt04 ~]# xe pif-list uuid=76472575-ef64-001f-4305-234e2dfc6f7c params=device,IP
        device ( RO): eth2
            IP ( RO): 10.0.0.2
    [root@dt04 ~]# xe pif-list uuid=8605deeb-76d4-9637-086f-512779f4c2c6 params=device,IP
    device ( RO)    : bond0
            IP ( RO): 10.0.0.1

    [root@dt04 ~]# xe network-list uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d params=bridge --minimal
    xapi1
    [root@dt04 ~]# ip address show xapi1 | grep inet
        inet 10.0.0.1/24 brd 10.0.0.255 scope global xapi1

There is no interface with the IP configuration that's on the other PIF since the xenbr2 iface has gone:

    [root@dt04 ~]# ip address show xenbr2 | grep inet
    Device "xenbr2" does not exist.

After this patch
----------------

    [root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
    Only one PIF on a bond is allowed to have an IP configuration.
    <extra>: f628a46c-f483-897b-3234-aecc3c107d84
    <extra>: 76472575-ef64-001f-4305-234e2dfc6f7c

Removing the IP config from either PIF will then allow the Bond.create to succeed:

    [root@dt04 ~]# xe pif-reconfigure-ip uuid=f628a46c-f483-897b-3234-aecc3c107d84 mode=none
    [root@dt04 ~]# xe bond-create pif-uuids=f628a46c-f483-897b-3234-aecc3c107d84,76472575-ef64-001f-4305-234e2dfc6f7c network-uuid=e7c98ee2-d000-477f-1692-2b6fd741dc3d
    f8e5baf8-b620-31e5-abb8-3e3fb214c08d

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
@simonjbeaumont
Copy link
Contributor Author

@robhoes I've updated the error raised to not specify the PIFs as discussed.

@robhoes
Copy link
Member

robhoes commented Feb 24, 2016

:shipit:

simonjbeaumont added a commit that referenced this pull request Feb 24, 2016
CA-106754: Disallow bonding when more than one PIF has an IP config
@simonjbeaumont simonjbeaumont merged commit b4d44c3 into xapi-project:master Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants