You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Briefly, context: I'm just getting familiar with this provider. Apologies in advance if I've made a silly mistake. That said, here's what's happening:
I'd like to create a simple container using an existing template. Creating a proxmox_virtual_environment_vm resource is simple enough, and works without issue so far. But an equally simple container creation attempt fails with the following sample error output:
proxmox_virtual_environment_container.testcontainer: Still creating... [30s elapsed]
Error: Received an HTTP 500 response - Reason: can't lock file '/run/lock/lxc/pve-config-105.lock' - got timeout
on proxmox.tf line 21, in resource "proxmox_virtual_environment_container" "testcontainer":
21: resource "proxmox_virtual_environment_container" "testcontainer" {
Details below.
To Reproduce
Set up a single-node Proxmox VE cluster running the current stable Proxmox VE version (6.2-11 at time of this writing), and install the current stable release of this Terraform Provider (0.3.0 at time of this writing), with Terraform 0.13.2, the latest stable version of Terraform at this writing.
Create an example container template in Proxmox either via the command line or the Proxmox VE Web GUI. For example:
Click on the local Proxmox VE storage pool.
Click on the "Templates" button to open the Container Template selection dialogue window.
Search for a template by typing something like wordpress in the filter box. This will result in one container called turnkey-wordpress in the list of available container templates.
Click the "Download" button to download the container template and save it to your local storage pool as an available container template for use in your cluster.
Write a bare-bones Terraform configuration such as the following, changing the appropriate authentication variables (shown as CHANGE_ME in the example below) as needed for your cluster:
provider"proxmox" {
virtual_environment {
endpoint="https://CHANGE_ME:8006"username="root@pam"password="CHANGE_ME"insecure=true
}
}
data"proxmox_virtual_environment_nodes""pve_nodes" {}
resource"proxmox_virtual_environment_container""testcontainer" {
description="Test container"node_name=data.proxmox_virtual_environment_nodes.pve_nodes.names[0]
operating_system {
# Use the Proxmox Containter Template downloaded as described earlier:template_file_id="local:vztmpl/debian-10-turnkey-wordpress_16.0-1_amd64.tar.gz"
}
}
Apply this configuration with terraform apply and observe the error appear in the terminal output. Sample output is shown here:
$ terraform apply
data.proxmox_virtual_environment_nodes.pve_nodes: Refreshing state... [id=nodes]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# proxmox_virtual_environment_container.testcontainer will be created
+ resource "proxmox_virtual_environment_container" "testcontainer" {
+ description = "Test container"
+ id = (known after apply)
+ node_name = "proxmox-ve"
+ started = true
+ template = false
+ vm_id = -1
+ operating_system {
+ template_file_id = "local:vztmpl/debian-10-turnkey-wordpress_16.0-1_amd64.tar.gz"
+ type = "unmanaged"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
proxmox_virtual_environment_container.testcontainer: Creating...
proxmox_virtual_environment_container.testcontainer: Still creating... [10s elapsed]
proxmox_virtual_environment_container.testcontainer: Still creating... [20s elapsed]
proxmox_virtual_environment_container.testcontainer: Still creating... [30s elapsed]
proxmox_virtual_environment_container.testcontainer: Still creating... [40s elapsed]
Error: Received an HTTP 500 response - Reason: can't lock file '/run/lock/lxc/pve-config-105.lock' - got timeout
on proxmox.tf line 3, in resource "proxmox_virtual_environment_container" "testcontainer":
3: resource "proxmox_virtual_environment_container" "testcontainer" {
Visit the Proxmox VE Web GUI and note the container was created successfully and seems to function normally.
Expected behavior
Expected Terraform to report successful creation of the container, not a timeout.
Additional context
I have tried a number of things to ensure I'm not mistakenly reporting a bug, including:
Manually deleting the lock file reported in the error (/run/lock/lxc/pve-config-105.lock). Of course, note that 105 is the Proxmox guest ID and might be different on your system.
Rebooting the Proxmox VE node.
Using a different container template.
Also, as the Terraform plan is being applied, the GUI updates in exactly the way you would expect. This is the order of events I've observed in exact progression when I run terraform apply with the above configuration:
First, Terraform plan is run.
As the Terraform plan is being applied, proxmox_virtual_environment_container.testcontainer: Creating... appears, and within a second the Proxmox VE Web GUI shows a new container guest.
As the container guest appears on the Proxmox VE Web GUI, a lock icon shows up on it. This is to be expected, as the guest is in the creating state; a right-click on the container guest in the Proxmox VE Web GUI shows "(config locked)" in the contextual menu.
Terraform reports waiting on container creation with proxmox_virtual_environment_container.testcontainer: Still creating... [20s elapsed]
Back in the Proxmox VE Web GUI, the lock disappears off the container guest's icon in the Proxmox VE Web GUI Server View sidebar.
Terraform continues to report waiting on container creation with, e.g., proxmox_virtual_environment_container.testcontainer: Still creating... [30s elapsed] and continues until it reports the error, even though it's clear the resource no longer appears locked from the perspective of the Web GUI.
I hope this helps.
I'm a big fan of Proxmox VE and Terraform generally, and yours is the best Terraform Provider for Proxmox that I've seen so far. I wish I was a more skilled Go programmer than I am, but if this is the project that ultimately gets me to take on learning another language, I'd be thrilled. Please let me know how I can be helpful.
The text was updated successfully, but these errors were encountered:
Briefly, context: I'm just getting familiar with this provider. Apologies in advance if I've made a silly mistake. That said, here's what's happening:
I'd like to create a simple container using an existing template. Creating a
proxmox_virtual_environment_vm
resource is simple enough, and works without issue so far. But an equally simple container creation attempt fails with the following sample error output:Details below.
To Reproduce
local
Proxmox VE storage pool.Templates
" button to open the Container Template selection dialogue window.wordpress
in the filter box. This will result in one container calledturnkey-wordpress
in the list of available container templates.Download
" button to download the container template and save it to yourlocal
storage pool as an available container template for use in your cluster.CHANGE_ME
in the example below) as needed for your cluster:terraform apply
and observe the error appear in the terminal output. Sample output is shown here:Expected behavior
Expected Terraform to report successful creation of the container, not a timeout.
Additional context
I have tried a number of things to ensure I'm not mistakenly reporting a bug, including:
/run/lock/lxc/pve-config-105.lock
). Of course, note that105
is the Proxmox guest ID and might be different on your system.Also, as the Terraform plan is being applied, the GUI updates in exactly the way you would expect. This is the order of events I've observed in exact progression when I run
terraform apply
with the above configuration:plan
is run.proxmox_virtual_environment_container.testcontainer: Creating...
appears, and within a second the Proxmox VE Web GUI shows a new container guest.(config locked)
" in the contextual menu.proxmox_virtual_environment_container.testcontainer: Still creating... [20s elapsed]
proxmox_virtual_environment_container.testcontainer: Still creating... [30s elapsed]
and continues until it reports the error, even though it's clear the resource no longer appears locked from the perspective of the Web GUI.I hope this helps.
I'm a big fan of Proxmox VE and Terraform generally, and yours is the best Terraform Provider for Proxmox that I've seen so far. I wish I was a more skilled Go programmer than I am, but if this is the project that ultimately gets me to take on learning another language, I'd be thrilled. Please let me know how I can be helpful.
The text was updated successfully, but these errors were encountered: