Hello.
I am new to ProxMox and perhaps this has been already asked, although I have not seen a similar question yet.
I am trying to use Terraform to provision my infrastructure in PoxMox but I keep on getting this error.
[/CODE][/CODE]
I have created different users and roles to try to make it work but it has not worked
Here is the main.tf that I am using for this test
root@proxmox:~/devops/terraform# cat main.tf
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = ">= 2.9.11"
}
}
}
provider "proxmox" {
pm_api_url = var.pm_api_url
pm_user = var.pm_user
pm_password = var.pm_password
pm_debug = var.pm_debug
resource "proxmox_vm_qemu" "ubuntu_vm" {
name = "ubuntu_vm" # Name of the new VM
target_node = "proxmox" # Node where the VM will be created
clone = 8000 # Template ID for cloning the VM
# VM Resources
cpu = 2
memory = 2048
sockets = 1
# Disk Configuration
disk {
storage = "vm-pool" # Ensure this matches the storage pool for the template
size = "32G"
type = "scsi"
iothread = 1
}
# Network Configuration
network {
model = "virtio"
bridge = "vmbr0"
}
# Cloud-init Configuration
os_type = "cloud-init"
ssh_user = "devops-user"
sshkeys = file("~/.ssh/id_rsa.pub")
ipconfig0 = "ip=192.168.100.50/24,gw=192.168.100.1"
}
Here are the different templates I have created but all give back the same error.
I am using this versions
I also have used API token that works when used in CLI
Has anyone had the same issue recently and how was this solved?
Thank you for your help.
I am new to ProxMox and perhaps this has been already asked, although I have not seen a similar question yet.
I am trying to use Terraform to provision my infrastructure in PoxMox but I keep on getting this error.
Code:
[CODE=bash][CODE]proxmox_vm_qemu.ubuntu_vm: Creating...
╷
│ Error: vm '8000' not found
│
│ with proxmox_vm_qemu.ubuntu_vm,
│ on main.tf line 16, in resource "proxmox_vm_qemu" "ubuntu_vm":
│ 16: resource "proxmox_vm_qemu" "ubuntu_vm" {
I have created different users and roles to try to make it work but it has not worked
Here is the main.tf that I am using for this test
root@proxmox:~/devops/terraform# cat main.tf
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = ">= 2.9.11"
}
}
}
provider "proxmox" {
pm_api_url = var.pm_api_url
pm_user = var.pm_user
pm_password = var.pm_password
pm_debug = var.pm_debug
resource "proxmox_vm_qemu" "ubuntu_vm" {
name = "ubuntu_vm" # Name of the new VM
target_node = "proxmox" # Node where the VM will be created
clone = 8000 # Template ID for cloning the VM
# VM Resources
cpu = 2
memory = 2048
sockets = 1
# Disk Configuration
disk {
storage = "vm-pool" # Ensure this matches the storage pool for the template
size = "32G"
type = "scsi"
iothread = 1
}
# Network Configuration
network {
model = "virtio"
bridge = "vmbr0"
}
# Cloud-init Configuration
os_type = "cloud-init"
ssh_user = "devops-user"
sshkeys = file("~/.ssh/id_rsa.pub")
ipconfig0 = "ip=192.168.100.50/24,gw=192.168.100.1"
}
Here are the different templates I have created but all give back the same error.
I am using this versions
Bash:
root@proxmox:~/devops/terraform# pveversion
pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve)
I also have used API token that works when used in CLI
Bash:
curl -k -X GET "https://192.168.100.27:8006/api2/json/version" -H "Authorization: PVEAPIToken=terraform@pve!terraform:285ecb71-6c"
Has anyone had the same issue recently and how was this solved?
Thank you for your help.
Last edited: