Reserve VM id #1456
-
Is it somehow possible to create blank VM, get the auto generated VM ID, create other resources based on that and then finish creating the VM? Specifically what I'd like to do is have cloud config file per VM otherwise I get warnings like Simplified example: resource "proxmox_virtual_environment_file" "cloud_config" {
content_type = "snippets"
datastore_id = "local"
node_name = var.target_node
source_raw {
data = <<-EOF
#cloud-config
...snip...
EOF
file_name = "${proxmox_virtual_environment_vm.vm.vm_id}-cloud-config.yaml"
}
}
resource "proxmox_virtual_environment_vm" "vm" {
# .. snip ..
initialization {
user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
}
# .. snip ..
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The "blank VMs" won't be possible. But you can manually allocate VM IDs and pass them to both the VM (set as |
Beta Was this translation helpful? Give feedback.
The "blank VMs" won't be possible. But you can manually allocate VM IDs and pass them to both the VM (set as
vm_id
attribute) and the file resource.You can probably use
count
or define a map / array to manage your VM IDs