Why doesn't MAAS use the fixed IP of a machine?

Why does MAAS need to assign a new IP to the machine during the deployment process?

Example:

Host A: 192.168.35.20( external dhcp)

MAAS successfully commissions Host A with this IP(20). When I start the deployment process for Host A, MAAS assigns a random IP to this machine from DHCP and finishes the deployment process. If there is no free IP in the DHCP pool, “connection timeout” occurs at the cloud-init target stage. Is there a way to make MAAS use Host A’s already assigned IP(.20)?

By determining the DHCP range, I ensure that MAAS assigns an IP from the range I want temporarily, but why does it need to change the IP that is already assigned?

Thanks.

Hi @elperro ,

What’s the IP mode setting of the machine?

on MAAS:

IP Address Status : Auto Assign
DHCP: External

on the machine:

   network:
      version: 2
      renderer: NetworkManager
      ethernets:
        eno1:
          dhcp4: true

what’s the content of /etc/netplan/50-maas.yaml?

cat /etc/netplan/50-cloud-init.yaml 
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eno1:
      dhcp4: true

that’s cloud init :slight_smile: Do you have /etc/netplan/50-maas.yaml?

No. I have just 50-cloud-init.yaml

Well actually it’s not MAAS that is assigning the IP to the machine, but your DHCP server

I mean, if I get your situation correctly your external DHCP server doesn’t have any IP to offer to the machines. How could MAAS help in this case?

Frankly, my machine has already an IP from external dhcp, but when I try to deploy, MAAS assigns an IP from “reserved ranges”.

Subnet Summary:

Managed allocation : Enabled
Active discovery: Enabled
Proxy access: Disabled
Allow DNS Resolution: Disabled

when I desactivate “Managed allocation”, the machine take random IP from DHCP .

Sorry, I got it now: the machine gets an IP from your DHCP server and boots, then cloud-init asks MAAS for the network configuration and given that you selected “Auto IP” MAAS will look for a “free” IP in the subnet (outside the dynamic and reserved ranges) and craft the configuration.

Unfortunately it seems that you exausted the pool. Have you properly configured your external DHCP server to use only a specific range of IPs in the subnet and created the reserved range in MAAS?

Btw to answer your question: nope, MAAS can’t take the IP assigned by your DHCP server and statically assign it to the machine. This is in general wrong, you should reserve a range for static IP allocation by MAAS and a range for your addresses that your DHCP server will offer.

You might try to use the DHCP IP mode. That way the IP serving will be handled by your external DHCP server and depending on your configuration your machine might get the same address

Thank you. How can I configure this “DHCP IP mode” ?

  • Click on the machine
  • Go to Network
  • on the network interface click on the action column
  • click on edit physical
  • on the dropdown menu of IP Mode select DHCP
  • save

Then deploy!

Thank you so much :slight_smile:

There is another question. Is there any chance to make it as default setting for all machines?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

At the moment it’s not possible to change the default setting AUTO as far as I know