6.10.1. cloupard_kvm_instance
Defines a KVM virtual machine instance.
Example usage
resource "cloupard_kvm_instance" "vm1" {
region = var.region_kz2
cod = var.cod_almaty_2
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 = 30
description = "System"
bootable = true
},
"disk1" = {
name = "disk1"
type = var.disk_type_standard
size = 40
description = "Data1"
bootable = false
},
"disk2" = {
name = "disk2"
type = var.disk_type_archive
size = 45
description = "Data2"
bootable = false
}
}
connections = {
"net0" = {
extip_id = cloupard_kvm_extip.ip2.id
},
"net1" = {
vnet_id = cloupard_kvm_vnet.vnet1.id
},
"net2" = {
vnet_id = cloupard_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:
o name (Required): Name of the disk.
o type (Required): Disk type (e.g., super, standard, archive).
o size (Required): Disk size in GB.
o description (Optional): Disk description.
o 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.