canonical / terraform-provider-maas

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

maas_instance network_interfaces block unexpected behaviour #177

Open seb54000 opened 4 months ago

seb54000 commented 4 months ago

Hi,

I'm trying to use the TF provider to manage maas compose (vm_host_machine) and deploy (maas_instance) my machines.

Commisioning is OK and I have a machine in ready state that I can reference through hostname (allocate_params)

My problem is on the network_interfaces. It is not fully clear to me in the documentation if the interface should preexists on the machine. While I run the following code (with or without the subnet_cidr param) I have :

resource "maas_instance" "test" {
  allocate_params {
    hostname      = "myhost"
  }
  deploy_params {
    distro_series = "jammy"
  }
  network_interfaces {
    name = "mgmt"
    # subnet_cidr = "192.168.2.0/24"
  }
}

Error: network interface (mgmt) was not found on machine (rffyaa)

If I have to define the interface prior to instance, what is the purposed of this IP and subnet as it will be defined in the interface physical and link definition, no ?

BTW : do you know if it is possible to define an interface on a space (rather than a subnet). Our use case is to deploy machines on different zones and let maas select the correct subnet based on the spaces we have previously defined (and attached VLANs to theses spaces)

Thanks a lot for your help

seb54000 commented 4 months ago

After trying, it seems that interface has to be defined prior to deploy (maas_instance). I keep the issue open just to document (if it could be of some help for other).

I will update with final results of test : my use case is to compose a VM on a vm-host, then after commisioning assign a static IP adress on a maas managed subnet, then finally deploy (maas_instance) this machine. Actual tests shows that if I deploy a vm_host_machine configured with a static IP, the static IP is forgotten after commisioning so it seems I need to define it through machine ressource

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 days ago

This issue is stale because it has been open for 30 days with no activity.