×

10.1. oblakoteka_kvm_instance

Defines a KVM virtual machine instance.
 
Example usage
resource "oblakoteka_kvm_instance" "vm1" {
  region = var.region_oblakoteka_ru_msk
  cod = var.cod_reconn_slava_1
  name = "tf_vm1"
  description = "test vm from tf"
  vm_type = var.vm_type_universal_lin
  os_template = var.os_debian_12_minimal
  os_admin_pass = "Qwer1234"
  running = true
  in_test = true
  vcpu = 2
  vram = 2
  disks = {
    "disk0" = {
      name = "disk0"
      type = var.disk_type_super
      size = 25
      description = "System"
      bootable = true
    },
    "disk1" = {
      name = "disk1"
      type = var.disk_type_standard
      size = 35
      description = "Data1"
      bootable = false
    },
 
    "disk2" = {
      name = "disk2"
      type = var.disk_type_archive
      size = 45
      description = "Data2"
      bootable = false
    },
  }
 
  connections = {
    "net0" = {
      extip_id = oblakoteka_kvm_extip.ip2.id
    },
    "net1" = {
      vnet_id = oblakoteka_kvm_vnet.vnet1.id
    },
    "net2" = {
      vnet_id = oblakoteka_kvm_vnet.vnet2.id
    }
  }
}
 
Attributes:
  • region (Required): Region for the virtual machine.
  • cod (Required): Code of deployment site or environment.
  • name (Required): Name of the virtual machine.
  • description (Optional): Description of the instance.
  • vm_type (Required): Type of the virtual machine.
  • os_template (Required): OS image template used for deployment.
  • os_admin_pass (Required): Administrator password for the OS.
  • running (Optional): Whether the instance should start automatically.
  • in_test (Optional): Marks the VM as test.
  • vcpu (Required): Number of virtual CPUs.
  • vram (Required): Amount of virtual RAM in GB.
  • disks (Required): Map of disk definitions. Each disk block includes:
  • name (Required): Name of the disk.
  • type (Required): Disk type (e.g., super, standard, archive).
  • size (Required): Disk size in GB.
  • description (Optional): Disk description.
  • bootable (Required): Whether the disk is bootable.
  • connections (Optional): Network interface definitions. Each connection includes:
  • extip_id (Optional): External IP ID (if public).
  • vnet_id (Optional): Virtual network ID.
  • id (Computed): Unique identifier for the virtual machine.