This message was deleted.
# harvester
a
This message was deleted.
s
Copy code
resource "harvester_virtualmachine" "ubuntu2204" {
  name                 = "ubuntu2204"
  namespace            = "default"
  restart_after_update = true

  description = "test ubuntu2203 raw image terraform"
  tags = {
    ssh-user = "ubuntu"
  }

  cpu    = 2
  memory = "2Gi"

  efi         = false
  secure_boot = false

  run_strategy = "RerunOnFailure"
  hostname     = "ubuntu2204"
  machine_type = "q35"

  network_interface {
    name           = "nic-1"
    network_name   = "vlan648"
    model          = "virtio"
    type           = "bridge"
    wait_for_lease = false
  }

  disk {
    name        = "rootdisk"
    size        = "10Gi"
    type        = "disk"
    bus         = "virtio"
    boot_order  = 1
    image       = "jammy-server-cloudimg-amd64.img"
    auto_delete = true
  }

  cloudinit {
    user_data    = <<-EOF
      #cloud-config
      EOF
...
    network_data = <<-EOF
      network:
        version: 1
        config:
...
      EOF
  }
}
Also in the Harvester Terraform schema docs I can't see how to "Enable USB tablet".
b
Actually,
jammy-server-cloudimage-amd64.img
is just a display name. It's not the name of VMImage CRD. You can use
kubectl get vmimage
to see it. In terraform, you can use following to get the image.
Copy code
data "harvester_image" "ubuntu" {
  namespace    = "default"
  display_name = "jammy-server-cloudimage-amd64.img"
}
Enable USB tablet
is not supported yet. You can check this PR. Thanks. https://github.com/harvester/terraform-provider-harvester/pull/63
s
Thank you - that helped.