45 lines
775 B
Terraform
45 lines
775 B
Terraform
data "proxmox_files" "ubuntu_image" {
|
|
content_type = "import"
|
|
node_name = var.target_node
|
|
datastore_id = "local"
|
|
file_name_regex = "jammy"
|
|
}
|
|
|
|
resource "proxmox_virtual_environment_vm" "vm_ubuntu_iscsi" {
|
|
count = 3
|
|
vm_id = 100 + count.index + 2
|
|
name = "ubuntu-cloud-vm-${count.index + 1}"
|
|
node_name = var.target_node
|
|
|
|
initialization {
|
|
ip_config {
|
|
ipv4 {
|
|
address = "dhcp"
|
|
}
|
|
}
|
|
user_account {
|
|
username = "root"
|
|
password = "rootroot"
|
|
}
|
|
}
|
|
|
|
cpu {
|
|
cores = 2
|
|
}
|
|
|
|
memory {
|
|
dedicated = 2048
|
|
}
|
|
|
|
network_device {
|
|
bridge = "vmbr1"
|
|
}
|
|
|
|
disk {
|
|
interface = "scsi0"
|
|
datastore_id = "truenas_lvm"
|
|
import_from = data.proxmox_files.ubuntu_image.files[0].id
|
|
}
|
|
|
|
}
|