resource "openstack_compute_instance_v2" "pg-nodes" {
  count           = var.pgcluster_instance_count
  name            = "${var.pgcluster_name}-${count.index}.${var.dns_suffix}"
  flavor_name     = "${var.pgcluster_instance_type}"
  key_pair        = "thorslund"
  security_groups = ["https", "microk8s", "Allow SSH from SUNET jumphosts"]
  

  block_device {
    uuid                  = "5d24aca9-11be-4de1-9770-4a097d68f361"
    source_type           = "image"
    volume_size           = 20
    boot_index            = 0
    destination_type      = "volume"
    delete_on_termination = true
  }
  scheduler_hints {
    group = openstack_compute_servergroup_v2.controllers.id
  }
  network {
    name = "public"
  }
}