Simple Terraform MAAS single server

Job ID: 38716749

Budget: $2 – $8 USD

maas.io is what I am using
Machine As A Service

Thank you for being here and the max budget is $10 and hope this is fine

https://maas.io/
https://registry.terraform.io/providers/maas/maas/latest/docs/resources/machine

I need a single Ubuntu server installed via Terraform with MAAS. The server should be set up with a static IP.

I make sure NOTHING; is in MAAS console
- Network is created FINE
- Machine get this error (I see this machine node glad-moray is created and delete it out but again)

maas_subnet.tf_subnet: Creation complete after 0s [id=3]

│ Error: ServerError: 503 Service Unavailable (No rack controllers can access the BMC of node glad-moray)

│  with maas_machine.virsh_vm1,
│  on main.tf line 53, in resource "maas_machine" "virsh_vm1":
│  53: resource "maas_machine" "virsh_vm1" {




Here is my WHOLE file main.tf
└─$ cat main.tf

terraform {
 required_providers {
   maas = {
     source = "maas/maas"
     version = "~>2.0"
   }
 }
}

provider "maas" {
 api_version = "2.0"
 api_key    = "mqyDUe6ktuwXv98b9E:fpNfLJMv2NSdqMUUTm:HMxBcCtTgFQv2aTDSubAAsh7CcVRW9B6"
 api_url    = "http://192.168.0.10:5240/MAAS"
}

resource "maas_space" "tf_space" {
 name = "tf-space"
}

resource "maas_fabric" "tf_fabric" {
 name = "tf-fabric"
}

resource "maas_vlan" "tf_vlan" {
 fabric = maas_fabric.tf_fabric.id
 vid   = 14
 name  = "tf-vlan14"
 space = maas_space.tf_space.name
}

resource "maas_subnet" "tf_subnet" {
 cidr      = "192.168.0.0/24"
 fabric    = maas_fabric.tf_fabric.id
 vlan      = maas_vlan.tf_vlan.vid
 name      = "tf_subnet"
 gateway_ip = "192.168.0.1"
 dns_servers = [
   "1.1.1.1",
 ]
 ip_ranges {
   type    = "reserved"
   start_ip = "192.168.0.1"
   end_ip  = "192.168.0.50"
 }
 ip_ranges {
   type    = "dynamic"
   start_ip = "192.168.0.200"
   end_ip  = "192.168.0.254"
 }
}

resource "maas_machine" "virsh_vm1" {
 power_type = "virsh"
 power_parameters = jsonencode({
   power_address = "qemu+ssh://ubuntu@192.168.0.59/system"
   power_id     = "test-vm1"
 })
 pxe_mac_address = "7C:83:34:BB:23:FA"
}
Related categories: System Admin Cloud Computing Ubuntu DevOps Terraform