Closed cabrizio closed 1 year ago
I think you need to clone a cloudinit ready template in your main.tf. I notice you have the 'clone' line commented out. However, I'm also unable to get a terraform apply to succeed against proxmox. I am running proxmox 6.x and I think the API to clone expects a vmid, while terraform proxmox provider is passing a vm name.
Error recieved:
proxmox_vm_qemu.terraform_test[0]: Creating...
Error: Vm 'ubuntu-1804-cloudinit' not found
on main.tf line 1, in resource "proxmox_vm_qemu" "terraform_test":
1: resource "proxmox_vm_qemu" "terraform_test" {
main.tf
resource "proxmox_vm_qemu" "terraform_test" {
count = 1
name = "kubernetes-master-${count.index}"
target_node = "pmx23"
clone = "ubuntu-1804-cloudinit"
os_type = "cloud-init"
cores = 4
sockets = "1"
cpu = "host"
memory = 1024
scsihw = "virtio-scsi-pci"
bootdisk = "scsi0"
network {
id = 0
model = "virtio"
bridge = "vmbr0"
}
lifecycle {
ignore_changes = [
network,
]
}
# Cloud Init Settings
ipconfig0 = "ip=192.168.11.21${count.index + 1}/24,gw=192.168.11.1"
sshkeys = <<EOF
${var.ssh_key}
EOF
}
Output when accessing the proxmox API from the CLI
root@pmx23:~# pvesh get /nodes/pmx23/qemu
status │ vmid │ cpus │ lock │ maxdisk │ maxmem │ name │ pid │ qmpstatus │ tags │
│ stopped │ 9003 │ 1 │ │ 2.20 GiB │ 2.00 GiB │ ubuntu-1804-cloudinit │ │ │ │
I'm running into this as well. We shouldn't have to clone a VM template for this to work.
I expect a Cloudinit drive resource to be constructed in Proxmox and attached to the VM before it is booted.
Can we do this?
I also think i'm running into the same issue - I want to clone an existing template and boot it (with a CI drive attached). I'm getting the same error:
Error: Vm 'ubuntu-2004-base-image' not found
I got the same issue, but I fix this by opening more permission on the user.
This issue is stale because it has been open for 60 days with no activity. Please update the provider to the latest version and, in the issue persist, provide full configuration and debug logs
This issue was closed because it has been inactive for 5 days since being marked as stale.
Can the proxmox provider create a new VM without clone or update?
@pich4ya, it should be possible, but then the vm doesn't have an os. Never tried it.
Hi, I am having this issue when I run 'terraform apply'
this is my configuration
Any idea? am I missing something? Thanks!