blade-tuvok: move public interface off a VLAN

Previously, the public/internal interfaces were VLANned onto the same NIC. For
some reason, sometime the Emulex adapters seem to end up not getting configured
properly, which causes me no end of pain when I spend time trying to debug why
none of my VMs can see the internet anymore.

Instead of doing this, put the public interface onto its own actual virtual
network interface.
This commit is contained in:
Luke Granger-Brown 2021-12-17 00:27:24 +00:00
parent 18ac4b13fd
commit fee02312d3
2 changed files with 17 additions and 6 deletions

View file

@ -47,7 +47,8 @@ in {
my.blade.macAddress = { my.blade.macAddress = {
internal = "e4:11:5b:ac:e3:fe"; internal = "e4:11:5b:ac:e3:fe";
storage = "e4:11:5b:ac:e4:02"; storage = "e4:11:5b:ac:e4:02";
internet = "e4:11:5b:ac:e4:00"; internet = "e4:11:5b:ac:e3:ff";
public = "e4:11:5b:ac:e4:00";
}; };
services.ceph = { services.ceph = {

View file

@ -24,6 +24,11 @@ in {
type = lib.types.nullOr lib.types.str; type = lib.types.nullOr lib.types.str;
default = null; default = null;
}; };
macAddress.public = lib.mkOption {
# If not using a VLAN.
type = lib.types.nullOr lib.types.str;
default = null;
};
}; };
config = { config = {
@ -90,12 +95,15 @@ in {
br = interfaces: { interfaces = lib.mkDefault interfaces; rstp = false; }; br = interfaces: { interfaces = lib.mkDefault interfaces; rstp = false; };
in { in {
br-mgmt = br [ "en-int" ]; br-mgmt = br [ "en-int" ];
br-public = br [ "vl-int-public" ]; br-public = br [ (if config.my.blade.macAddress.public == null then "vl-int-public" else "en-public") ];
}; };
vlans.vl-int-public = { vlans = ({} //
(if config.my.blade.macAddress.public == null then {
vl-int-public = {
id = 100; id = 100;
interface = "en-int"; interface = "en-int";
}; };
} else {}));
interfaces.br-mgmt.ipv4.addresses = lib.mkBefore [{ interfaces.br-mgmt.ipv4.addresses = lib.mkBefore [{
address = "10.100.0.${toString (100 + config.my.blade.bay)}"; address = "10.100.0.${toString (100 + config.my.blade.bay)}";
@ -132,6 +140,8 @@ in {
ATTR{address}=="${config.my.blade.macAddress.storage}", NAME="en-storage" ATTR{address}=="${config.my.blade.macAddress.storage}", NAME="en-storage"
'') + (lib.optionalString (config.my.blade.macAddress.internet != null) '' '') + (lib.optionalString (config.my.blade.macAddress.internet != null) ''
ATTR{address}=="${config.my.blade.macAddress.internet}", NAME="en-internet" ATTR{address}=="${config.my.blade.macAddress.internet}", NAME="en-internet"
'') + (lib.optionalString (config.my.blade.macAddress.public != null) ''
ATTR{address}=="${config.my.blade.macAddress.public}", NAME="en-public"
''); '');
virtualisation.podman.enable = true; virtualisation.podman.enable = true;