canonical / terraform-provider-maas

Terraform MAAS provider
Mozilla Public License 2.0
60 stars 43 forks source link

add power address as import attribute for machines #125

Closed baycarbone closed 8 months ago

baycarbone commented 9 months ago

To import an existing machine we can use the following today:

MAAS machines can be imported using one of the attributes: system ID, hostname, or FQDN. e.g. $ terraform import maas_machine.virsh_vm1 vm1.maas

It would be nice to be able to import based on the power address e.g. BMC IP address. This is useful for baremetal machines which are configured to PXE boot and are automatically discovered by MAAS outside of terraform. Using the BMC IP address as import attribute we could add these machines as resources.

e.g.

import { to = maas_machine.node01 id = "10.1.1.1" }

baycarbone commented 8 months ago

Invalid request, as auto-discovered machines will not have the BMC IP set.