-
Notifications
You must be signed in to change notification settings - Fork 46
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
Multiple HW addresses per netdev & NIC bonding #184
Conversation
* Multiple hw addresses can be set by providing multiple --hwaddr arguments or giving a comma separated list of hw addresses * In the same way bonding devices can be set with --bonddevs * Bonding mode can be set with --bondmode Example: wwsh node set node1 --netdev bond0 \ --hwaddr aa:bb:cc:dd:ee:01,aa:bb:cc:dd:ee:02 \ --bonddevs eth0,eth1 \ --bondmode 802.3ad Changed interfaces: * Warewulf::Node::update_netdev_member() Changed order of 'validator' and 'new_values' parameters new_values can now be a list The function is not used anywhere else. This is now consistent with the order that is also used in Object::prop().
@@ -70,6 +70,158 @@ for module in `/sbin/detect`; do | |||
done | |||
wwsuccess | |||
|
|||
bondup() { |
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.
In provision/initramfs/init
there's also a section that starts:
if [ -n "$WWPOSTNETDOWN" ]; then
Will need to be sure the bond device is handled here, and also the slave devices are taken down when --postnetdown
is used.
This is how I've generally provisioned a bond device. Provision the node off eth0
(or whatever), take the network device down when complete, have the image init setup the bond; Use Warewulf files to provision out proper ifcfg-bond0
, ifcfg-eth0
, etc... files.
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.
in this section the device is read from
NETDEV=
cat /tmp/wwdev
which is also used by my code, so --postnetdown should already take it down again. There might be some more nuanced issues with the enslaved devices though, which might also need to be un-configured (by running "ifenslave -d" over all --bonddevs). I'll test that case.
But even in your scenario this patch might already be useful, as assigning multiple hw adresses will help to identify the node when the order of network interfaces changes or the primary interface is actually broken/unglugged. In this case you would not configure --bonddevs and init will behave as before (i.e. not call bondup() at all), just with the added benefit that it doesn't matter if eth0 or eth1 is the primary interface.
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.
added code to correctly delete bonding device in case of failure or --postnetdown
busybox's "ip link del" also detaches the slaves automatically
c3d321d
to
8246bf6
Compare
8246bf6
to
3ffa9bf
Compare
@bensallen |
Looks good to me. We'll want to see some sites test this a bit before it makes it into a release. |
@beinvisible Thanks for the great contribution. Bonding support has been missing for a long time. |
I failed to setup bonding in my cluster with ohpc-shipped warewulf. I got two separate ports with the same IP address.
Configs are:
There is only one entry in network-script:
and this 'bond0' is just a name:
After investigating, ohpc shipped with a snapshot of commit 98fcdc3 , which I believe included this patch. |
Hi @aflyhorse, could you please move this to a new issue? Also its difficult for the upstream project to debug OHPC releases. As at least personally, I don't track what version they ship, nor what extra patches they apply. |
Would you mind telling me how to log |
The
You can include these functions by running:
This file is |
If you set |
I found a possible cause. I configured "predictable netif" but Output with predictable netif:
|
@aflyhorse ah yes this makes sense. Warewulf does support a fallback to matching interface names based on MAC address normally, but not in the case of bonds currently. I've created #304 to track this. |
@bensallen I'm glad to be of help. Also, thank you for your detail explanation and your selfless contribution to warewulf. |
or giving a comma separated list of hw addresses
Example:
wwsh node set node1 --netdev bond0
--hwaddr aa:bb:cc:dd:ee:01,aa:bb:cc:dd:ee:02
--bonddevs eth0,eth1
--bondmode 802.3ad
Changed interfaces:
Warewulf::Node::update_netdev_member()
Changed order of 'validator' and 'new_values' parameters
new_values can now be a list
The function is not used anywhere else.
This is now consistent with the order that is also used in Object::prop().