0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 11:02:59 +00:00
terraform-provider-proxmox/examples/guides/clone-vm/template.tf
Pavel Boldyrev ccaae927e6
feat(docs): basic guide how to clone a VM template (#1716)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2025-01-17 19:30:34 -05:00

61 lines
1.1 KiB
HCL

resource "proxmox_virtual_environment_vm" "ubuntu_template" {
name = "ubuntu-template"
node_name = "pve"
template = true
machine = "q35"
bios = "ovmf"
description = "Managed by Terraform"
agent {
enabled = true
}
cpu {
cores = 2
}
memory {
dedicated = 2048
}
efi_disk {
datastore_id = "local"
file_format = "raw"
type = "4m"
}
disk {
datastore_id = "local-lvm"
file_id = proxmox_virtual_environment_download_file.ubuntu_cloud_image.id
interface = "virtio0"
iothread = true
discard = "on"
size = 20
}
initialization {
ip_config {
ipv4 {
address = "dhcp"
}
}
user_data_file_id = proxmox_virtual_environment_file.user_data_cloud_config.id
}
network_device {
bridge = "vmbr0"
}
}
resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
content_type = "iso"
datastore_id = "local"
node_name = "pve"
url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
}