

terraform {
  required_providers {
    nutanix = {
      source = "nutanix/nutanix"
    }
  }
  backend "http" {
    address = "http://foreman.example.com/api/v2/tf_states/empty"
    headers = {
      Authorization = "Token very_secret_token"
    }
  }
}

provider "nutanix" {
  username = var.username
  password = var.password
  endpoint = var.endpoint
  insecure = true
}



data "nutanix_clusters" "clusters" {}

resource "nutanix_virtual_machine" "vm" {

  # only needed for 'new_vm' :-/
  cluster_uuid = data.nutanix_clusters.clusters.entities.0.metadata.uuid

  name         = "empty"

  
  
  
  disk_list {
    disk_size_mib = 0
    storage_config = {
      storage_container_reference = {
        kind = "storage_container"
        uuid = 
      }
    }
  }

}

output "vm_attrs" {
  value = {
      identity = nutanix_virtual_machine.vm.id
      mac = nutanix_virtual_machine.vm.nic_list[0].mac_address
  }
}

