Hello everyone,
I am contacting support because I am encountering a persistent error when creating a VM via API and Terraform. To be more specific, my goal is to clone a specific VM from a template. My code is below. However, an error constantly appears, interrupting the process with "error 599: too many redirections." I have tried with other providers, but the problem persists.
Thank you for your assistance.
#!/bin/bash
echo "user:" $1
cd /home/yasco/pentesting-platform/config/terraform/utilisateur
mkdir -p user-$1
cd user-$1
cat > main.tf <<EOF
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = "3.0.1-rc3"
}
}
}
provider "proxmox" {
pm_api_url = "https://11.11.11.11:8006/api2/json"
pm_api_token_id = "XXXXX"
pm_api_token_secret = "XXXXXXX"
pm_tls_insecure = true
pm_log_enable = true
pm_log_file = "terraform-plugin-proxmox.log"
pm_debug = true
pm_log_levels = {
_default = "debug"
_capturelog = ""
}
}
resource "proxmox_vm_qemu" "pwnbox_template" {
name = "pwnbox-user-$1"
target_node = "pve"
clone = "pwnbox-template1"
boot = "order=scsi0;net0"
memory = "6000"
bootdisk = "scsi0"
cores = 2
sockets = 2
cpu = "kvm64"
disks {
scsi {
scsi0 {
disk {
size = "40G"
storage = "local-lvm"
}
}
}
}
ipconfig0 = "ip=11.11.11.$1/24,gw=11.11.11.2"
}
EOF
terraform init -upgrade
terraform apply -auto-approve
I am contacting support because I am encountering a persistent error when creating a VM via API and Terraform. To be more specific, my goal is to clone a specific VM from a template. My code is below. However, an error constantly appears, interrupting the process with "error 599: too many redirections." I have tried with other providers, but the problem persists.
Thank you for your assistance.
#!/bin/bash
echo "user:" $1
cd /home/yasco/pentesting-platform/config/terraform/utilisateur
mkdir -p user-$1
cd user-$1
cat > main.tf <<EOF
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = "3.0.1-rc3"
}
}
}
provider "proxmox" {
pm_api_url = "https://11.11.11.11:8006/api2/json"
pm_api_token_id = "XXXXX"
pm_api_token_secret = "XXXXXXX"
pm_tls_insecure = true
pm_log_enable = true
pm_log_file = "terraform-plugin-proxmox.log"
pm_debug = true
pm_log_levels = {
_default = "debug"
_capturelog = ""
}
}
resource "proxmox_vm_qemu" "pwnbox_template" {
name = "pwnbox-user-$1"
target_node = "pve"
clone = "pwnbox-template1"
boot = "order=scsi0;net0"
memory = "6000"
bootdisk = "scsi0"
cores = 2
sockets = 2
cpu = "kvm64"
disks {
scsi {
scsi0 {
disk {
size = "40G"
storage = "local-lvm"
}
}
}
}
ipconfig0 = "ip=11.11.11.$1/24,gw=11.11.11.2"
}
EOF
terraform init -upgrade
terraform apply -auto-approve