Distribute Power/BMC IP via MAAS DHCP

Hello all,

We were hoping to have MAAS act as the DHCP server for our BMC interfaces, however, we are not able get this to work.

Our workflow is as follows:

  1. We have a fabric, let’s call it fabric0
  2. We have a tagged VLAN 20 within this fabric, call it “bmc-vlan”
  3. We have a single subnet within this vlan, call it “bmc-subnet”
  4. We have configured our MAAS rackd with a second interface and assigned it an IP on the “bmc-subnet”. Within the Ubuntu OS, this interface appears untagged. But the interface itself is connected to VLAN 20 on our switch.
  5. We enable DHCP on the “bmc-vlan” within MAAS and assigned it to the rackd from step 4
  6. We create a machine, call it “test-machine”, and configure the “power” option to the IPMI interface. We define the IP address, which is within the range of bmc-subnet, a BMC MAC.
  7. When we look at the “bmc-subnet” in MAAS, we see that the IP address of the BMC of test-machine shows up under “used IP address” of the subnet with a type of “Sticky”.

When the BMC is connected to the network, it receives an IP from the MAAS “Reserved Dynamic Range” range of bmc-subnet and not the IP that was defined under the “power” options of test-machine.

When I look at /var/snap/maas/common/maas/dhcpd.conf on the rackd server from step 4, I do see the bmc-subnet defined. I do not see, however, a “host” (DHCP reservation) defined for the MAC address of the BMC of test-machine. I do see “host” entries for the non-BMC interfaces of other hosts.

If I true to use the “devices” option in MAAS to create a “device” for the BMC of test-machine, I get an error that the IP already exists.

I am wondering, is MAAS intended to provide IP addresses for BMCs. when configured in the way I described? If not, how can we manage the dissemination of BMC IP addresses via MAAS?

As a side question, if the workflow above is expected to not result in MAAS assigning an IP to the BMC via a DHCP reservation, then why is the BMC MAC one of the optional fields of the IPMI power type?

Thanks in advance for any help!

1 Like

Bump on this one. Wondering if anyone has any tips on what’s possible for the BMC IP addressing in MAAS :slightly_smiling_face:

Another bump. Anyone can at least confirm if what I’m trying to do is expected behavior? Thanks so much!

I’m currious too - @billwear can you check with developers on this?

I’ve been working on creating a new vlan for our BMC’s and thought briefly of using MAAS as a DHCP server for this segment - but your difficulties are making me think it’s better to assign the addresses manually and update MAAS as we move the machines.

Thanks for reading

~~ Charles

@tfable, can you give me some info on the version of MAAS you’re using? if it’s in your writeup, i apologize, i just missed it.

this would be really useful. i’d like to rack machines and not care at all about what bmc ips they get.

coupled with a data lookup in terraform, this would solve some issues.

also, you need to publish the official maas terraform provider on hashicorp’s registry.

1 Like

Hey @billwear, thanks for your message.

Apologies for not including the MAAS version in the original post. I have verified the behavior on my write-up on snap-installed 3.2.6 and 3.3.0.

Thanks again for any help!

1 Like

totally agree! would love to have the terraform provider more formally known and published. @sparkiegeek?

so by tagged VLAN, you mean it is named “bmc-vlan” ?

and what does this mean, exactly?
“We enable DHCP on the “bmc-vlan” within MAAS and assigned it to the rackd from step 4”

Hey @billwear, sorry for the confusion. The word “tagged” was not needed here when matching MAAS nomenclature. I meant simply “VLAN 20”.

1 Like

Hey @billwear. In step #4, we configure a rackd machine. On this rackd machine, we added an interface with an IP from the “bmc-subnet”.

In the configuration page for the bmc-vlan (VLAN 20), we enabled DHCP. On the page where you enable DHCP for a VLAN, you are asked to assign it to a rackd server. We chose the rackd from step #4.

1 Like

tell me how you do step #4, specifically, “configure a rackd machine” – are you saying that you have a physical rackd machine and you physically add a second NIC with an IP from “bmc-subnet”, or did you do it with MAAS? if you did it with MAAS, please explain how: i.e., did you set up a VM, designate it as a rackd, and add an interface that way, or did you do something else?

Hey @billwear,

MAAS rackd (and regiond) are running as VMs on a hypervisor that’s outside of the purview of MAAS (ESXi). This hypervisor is standalone and it’s not associated with MAAS.

The rackd VM was configured with two interfaces, each tagged with a different VLAN at the ESXi level (each in its own port group). The first interface was placed on the host management VLAN (the VLAN that bare metal hosts PXE boot from) and the second interface of the rackd VM was placed on the BMC VLAN.

Inside of the Ubuntu OS of the rackd machine, we used netplan to assign an IP to each interface. After performing this configuration, when I looked at the rackd controller in MAAS, it showed both interfaces.

Once the rackd had an interface that was part of the VLAN that BMC’s were placed in, I was able to enable DHCP on that VLAN in the VLANs configuration page within MAAS.

I hope this helps.

Are you able to confirm whether MAAS is designed to act as a DHCP server for the VLAN that BMCs are placed in?

It would be amazing if when adding a machine we can provide the BMC MAC and IP (MAAS has a field for both when adding a machine) and to have MAAS act as the DHCP server.

If MAAS cannot act as a DHCP server for BMC interfaces, we have to maintain a DHCP server simply for the IPMI interface. Which is not the end of the world but the alternative (handle BMC DHCP from MAAS) would be preferred.

Thanks again for taking a look at this!

okay, yeah, now that it’s clearer – no, that’s not supported, may not even work. sorry 'bout that.

Thanks for the answer @billwear.

To confirm: there is no mechanism for MAAS to act as a DHCP server for BMCs, correct?

it is not intentionally designed into the code. it probably works if you first add the device, then set the BMC IP, but no promises – we didn’t anticipate nor design for this use of DHCP with BMCs. let us know if you get it working; good luck.

seems like the disconnect is between maas’s requirements for defining power control parameters and its ability to assign ips. if you have the bmc set to get a dhcp address, and maas is configured to hand out leases on that subnet/vlan, it will work, right — the bmc gets an address? but then the issue is that maas expects to know both the ip and mac of the bmc for power control. if maas could instead look up the mac or use a name instead of ip, even if the name is autogenerated, would that solve the problem?

it feels like this should be possible, but the issue isn’t with dhcpd.

does everyone just manually manage bmc addresses? we do, but it feels bad.

Hey @rockpapergoat, thanks for your message.

if you have the bmc set to get a dhcp address, and maas is configured to hand out leases on that subnet/vlan, it will work, right — the bmc gets an address?

No, unfortunately this doesn’t work. This section of the original post covers the behavior:

We create a machine, call it “test-machine”, and configure the “power” option to the IPMI interface. We define the IP address, which is within the range of bmc-subnet, a BMC MAC.

When the BMC is connected to the network, it receives an IP from the MAAS “Reserved Dynamic Range” range of bmc-subnet and not the IP that was defined under the “power” options of test-machine.

When I look at /var/snap/maas/common/maas/dhcpd.conf on the rackd server from step 4, I do see the bmc-subnet defined. I do not see, however, a “host” (DHCP reservation) defined for the MAC address of the BMC of test-machine. I do see “host” entries for the non-BMC interfaces of other hosts.

So even though MAAS will act as a DHCP server for the VLAN/Subnet where BMCs are connected to, without the DHCP reservations for each IP/MAC combo, there is no way to guarantee that the Machine’s BMC will receive the IP address that was configured in its Power Type section. And, therefore, MAAS cannot power control the machine.

but then the issue is that maas expects to know both the ip and mac of the bmc for power control. if maas could instead look up the mac or use a name instead of ip, even if the name is autogenerated, would that solve the problem?

Apologies but I do not follow this fully. MAAS does know both the IP and the MAC of the BMC as we configure both of those as part of the IPMI “Power Type” section. The issue seems to be that MAAS does not create DHCP reservations for BMCs in the same way that it does for Network Interfaces that have a “static” IP assigned to them.

In the case of network interfaces with static IPs, MAAS creates a DHCP reservation in its DHCP server for the MAC/IP combo of the network interface. So when the host PXE boots from that interface, it does so with the static IP assigned in MAAS (and delivered to the host’s interface via DHCP). Of course, when the OS is later installed the interface is configured with a static IP, but the DHCP reservation still remains on the MAAS DHCP server.

MAAS does not seem to be doing the same for BMC IP/MAC combos configured under the “Power Type” section of a host.

If the feature doesn’t exist today, that’s totally fine. I am mainly trying to understand if there is a way for MAAS to act as a DHCP server, with DHCP reservations, for the BMC interfaces. Based on what @billwear is saying, that is not possible (we’d rather not follow unsupported scenarios as this is for a production environment) .

That said, I think this would be an amazing feature to add to MAAS. That way, we don’t have to either manually assign IP addresses to BMCs (in general, this doesn’t scale well) or maintain a separate DHCP server just for the BMC VLAN.

Thanks!

1 Like

@tfable, @rockpapergoat we do have a place to request features, and we do listen and respond. worth a shot.