You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The maas_vm_host resource type causes an error during terraform apply when trying to deploy a machine in MAAS without the "focal" image. Consequently, it is currently not possible to deploy a pre-registered MAAS machine with any image other than "focal" using the machine param:
Terraform will perform the following actions:# maas_vm_host.infra_2_lxd_host will be created+resource"maas_vm_host""infra_2_lxd_host" {
+cpu_over_commit_ratio=(known after apply)
+default_macvlan_mode=(known after apply)
+id=(known after apply)
+machine="cos-2"+memory_over_commit_ratio=(known after apply)
+name="infra-2-lxd-host"+pool=(known after apply)
+resources_cores_total=(known after apply)
+resources_local_storage_total=(known after apply)
+resources_memory_total=(known after apply)
+tags=(known after apply)
+type="lxd"+zone=(known after apply)
}
Plan:1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
maas_vm_host.infra_2_lxd_host: Creating...
╷
│ Error: ServerError: 400 BadRequest ({"distro_series": ["'focal' is not a valid distro_series. It should be one of: '', 'ubuntu/jammy'."]})
│
│ with maas_vm_host.infra_2_lxd_host,
│ on main.tf line 16, in resource "maas_vm_host""infra_2_lxd_host":
│ 16: resource"maas_vm_host""infra_2_lxd_host" {
╵
MAAS only has the jammy image by default. Configuration used:
resource"maas_vm_host""infra_2_lxd_host" {
type="lxd"name="infra-2-lxd-host"machine="cos-2"#machine is pre-registered in MAAS
}
This is because the default "distro_series" is hardcoded to "focal" in the source file.
In this scenario, the machine to be deployed is stuck in the Allocated state, and even a terraform destroy does not restore the machine back to the Ready state. This leads to loss of idempotence between the Terraform actions and the existing state recorded by Terraform. For instance, running terraform destroy subsequent to the above error indicates nothing to destoy:
No changes. No objects need to be destroyed.
Either you have not created any objects yet or the existing objects were already deleted outside of Terraform.
Destroy complete! Resources:0 destroyed.
However, re-running terraform apply complains about a different error (the machine is no longer available to allocate by MAAS as it is already stuck in the Allocated state):
Error: ServerError:409 Conflict (No machine with system ID 4qxcte available.)
Expected Behavior:
It should be possible to deploy the default image configured in the MAAS settings or provide a custom "distro_series" param during machine deploy via the maas_vm_host resource (using the machine param).
The text was updated successfully, but these errors were encountered:
The maas_vm_host resource type causes an error during
terraform apply
when trying to deploy a machine in MAAS without the "focal" image. Consequently, it is currently not possible to deploy a pre-registered MAAS machine with any image other than "focal" using themachine
param:MAAS only has the
jammy
image by default. Configuration used:This is because the default "distro_series" is hardcoded to "focal" in the source file.
In this scenario, the machine to be deployed is stuck in the Allocated state, and even a
terraform destroy
does not restore the machine back to the Ready state. This leads to loss of idempotence between the Terraform actions and the existing state recorded by Terraform. For instance, runningterraform destroy
subsequent to the above error indicates nothing to destoy:However, re-running
terraform apply
complains about a different error (the machine is no longer available to allocate by MAAS as it is already stuck in the Allocated state):Expected Behavior:
It should be possible to deploy the default image configured in the MAAS settings or provide a custom "distro_series" param during machine deploy via the
maas_vm_host
resource (using themachine
param).The text was updated successfully, but these errors were encountered: