Comments (11)
I'm not quite sure what's going on here. The log does not match the description of the use case.
According to the log, Terraform is trying to delete four resources simultaneously: containers 101, 103, and 104, and VM 105.
Are they all provisioned on the same datastore, Data_Pool
? What type of datastore is it? Do you see any significant spikes in the IO delay metrics on the node?
Do you see anything suspicious in the syslog?
You can also try using parallelism=1 to update one resource at a time and see if it reduces contention.
from terraform-provider-proxmox.
It's a ZFS pool. I'll have to take a look at see if that's what's happening. Is it documented anywhere about what forces a container recreation?
from terraform-provider-proxmox.
You can run terraform plan
first, it will explain what operations terraform is going to perform, and if there is any resource re-creating then which attribute changes triggered it.
from terraform-provider-proxmox.
Also, take a look at #995, there are some interesting bits. If IO is a bottleneck you may get better performance by tweaking VM storage / interface types. I noticed you're using a mix of scsi and virio in your VMs.
from terraform-provider-proxmox.
Still no luck. Tried it with parallelism and don't see any spikes in the IO logs. Is there a specific set of logs that I can look at that might help me find the problem?
from terraform-provider-proxmox.
"context deadline exceeded" is a suspicious error tho. Usually it occurs when there is some connectivity issues between client and server. Are the PVE node and the host where you're running terraform from on the same network?
from terraform-provider-proxmox.
Yes, but what's odd is that I can modify resources just fine. It's just the destroy and recreate that is failing.
from terraform-provider-proxmox.
Could you run just terraform plan
for your resources, and post the output here?
from terraform-provider-proxmox.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# proxmox_virtual_environment_container.mariadb must be replaced
-/+ resource "proxmox_virtual_environment_container" "mariadb" {
~ id = "103" -> (known after apply)
+ start_on_boot = true
tags = []
+ timeout_clone = 1800
+ timeout_create = 1800
+ timeout_delete = 60
+ timeout_start = 300
+ timeout_update = 1800
+ unprivileged = true # forces replacement
+ vm_id = 103
# (4 unchanged attributes hidden)
~ initialization {
# (1 unchanged attribute hidden)
- ip_config {
- ipv4 {
- address = "10.0.0.103/24" -> null
- gateway = "10.0.0.1" -> null
}
}
}
~ operating_system {
+ template_file_id = "local:vztmpl/archlinux-base_2023-06-08-1_amd64.tar.zst" # forces replacement
# (1 unchanged attribute hidden)
}
# (5 unchanged blocks hidden)
}
# proxmox_virtual_environment_container.postgres must be replaced
-/+ resource "proxmox_virtual_environment_container" "postgres" {
~ id = "101" -> (known after apply)
+ start_on_boot = true
tags = []
+ timeout_clone = 1800
+ timeout_create = 1800
+ timeout_delete = 60
+ timeout_start = 300
+ timeout_update = 1800
+ unprivileged = true # forces replacement
+ vm_id = 101
# (4 unchanged attributes hidden)
~ initialization {
# (1 unchanged attribute hidden)
- ip_config {
- ipv4 {
- address = "10.0.0.101/24" -> null
- gateway = "10.0.0.1" -> null
}
}
}
~ operating_system {
+ template_file_id = "local:vztmpl/archlinux-base_2023-06-08-1_amd64.tar.zst" # forces replacement
# (1 unchanged attribute hidden)
}
# (5 unchanged blocks hidden)
}
# proxmox_virtual_environment_container.syncthing must be replaced
-/+ resource "proxmox_virtual_environment_container" "syncthing" {
~ id = "104" -> (known after apply)
+ start_on_boot = true
~ tags = [
+ "arch",
+ "sycnthing",
]
+ timeout_clone = 1800
+ timeout_create = 1800
+ timeout_delete = 60
+ timeout_start = 300
+ timeout_update = 1800
+ unprivileged = false # forces replacement
+ vm_id = 104
# (4 unchanged attributes hidden)
~ operating_system {
+ template_file_id = "local:vztmpl/archlinux-base_2023-06-08-1_amd64.tar.zst" # forces replacement
# (1 unchanged attribute hidden)
}
# (5 unchanged blocks hidden)
}
from terraform-provider-proxmox.
Ok, the imported state is clearly messed up. I suspect the issue is with timeouts, they were not defined in initial import, and now tf is trying to add them. Which means the current timeout value during apply can be ridiculously small, like a nanosecond, which could explain "content deadline" error.
But regardless, after apply, all your resources are going to be re-created because of discrepancies between the imported state and what is currently defined in the config.
The import functionality of the provider is pretty much untested, as it's not something that I'm actively using. I don't have a good solution for your current situation, except perhaps manually editing the tf state to reconcile it with the current config. Which is not straightforward by any means.
from terraform-provider-proxmox.
If you want, I can at least post an image of the state for one of the containers so if it comes up again, you might have some insight to what the problem might be. I'll just remove them from the state and create them.
resource "proxmox_virtual_environment_container" "postgres" {
description = null
id = "101"
node_name = "server"
started = false
tags = []
template = false
console {
enabled = true
tty_count = 2
type = "tty"
}
cpu {
architecture = "amd64"
cores = 2
units = 1024
}
disk {
datastore_id = "Data_Pool"
size = 15
}
initialization {
hostname = "postgres"
ip_config {
ipv4 {
address = "10.0.0.101/24"
gateway = "10.0.0.1"
}
}
}
memory {
dedicated = 512
swap = 512
}
network_interface {
bridge = "vmbr0"
enabled = true
firewall = true
mac_address = "<mac_address>"
mtu = 0
name = "eth0"
rate_limit = 0
vlan_id = 0
}
operating_system {
template_file_id = null
type = "archlinux"
}
}
from terraform-provider-proxmox.
Related Issues (20)
- Add support for `proxmox_virtual_environment_file` data source HOT 4
- Terraform VM Creation crashes plugin when adding ipv4 configuration to VM HOT 3
- Using Cloud Init package_upgrade: false HOT 1
- Error: resizing disk: error waiting for VM disk resize: All attempts fail: HOT 5
- After import command or block, unprivileged forces replacement HOT 2
- Live Migration error: retrieving VM 100: the requested resource does not exist HOT 3
- Recommended way to get Packer built VM ID into Terraform control HOT 9
- proxmox_virtual_environment_vm.virtual_machine already exists error HOT 2
- Please add new arguments and attributes to the `proxmox_virtual_environment_vms` data source HOT 2
- Unknown timezone "Europe/Amsterdam" with proxmox_virtual_environment_time HOT 2
- Changing disk size of 'proxmox_virtual_environment_container' forces replacement HOT 4
- proxmox_virtual_environment_download_file can't read metadata HOT 2
- CloudImage size changes forces replacement of VM HOT 2
- proxmox_virtual_environment_vm forces replacement by unchanged initialization.user_account.keys HOT 2
- A question about documentation related to the proxmox_virtual_environment_container resource
- Error listing files from datastore using API Token as credentials HOT 2
- Unable to download iso (OpenTofu) HOT 2
- proxmox_virtual_environment_network_linux_bridge additional config
- Weird behaviour with `file_format` vs. multiple disks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-proxmox.