-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when creating proxmox_virtual_environment_file
with source_file
: Provider produced inconsistent result after apply
#211
Comments
Hey @mikwaluk, thanks for the report! I'd like to clarify the exact use case -- have you applied the original template first, then replaced |
I get the same error and my template had |
Hey @codestrong! Would you mind to share your template? |
I'm having a pretty similar problem... |
Hi @vctrferreira! Would you mind sharing your template and giving a bit more detail about the use case, so I can reproduce it and identify the error? It doesn't seem like I'm able to reproduce it. My template: resource "proxmox_virtual_environment_vm" "ubuntu_vm" {
name = "211-test"
node_name = var.virtual_environment_node_name
vm_id = 211
agent {
enabled = true
}
cpu {
cores = 2
}
memory {
dedicated = 2048
}
disk {
datastore_id = "local"
file_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
interface = "virtio0"
iothread = true
discard = "on"
size = 20
}
initialization {
ip_config {
ipv4 {
address = "dhcp"
}
}
user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
}
network_device {
bridge = "vmbr0"
}
}
resource "proxmox_virtual_environment_file" "ubuntu_cloud_image" {
content_type = "iso"
datastore_id = "local"
node_name = var.virtual_environment_node_name
source_file {
path = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
}
}
resource "proxmox_virtual_environment_file" "cloud_config" {
content_type = "snippets"
datastore_id = "local"
node_name = var.virtual_environment_node_name
source_file {
path = "files/cloud-config.yaml"
file_name = "terraform-provider-proxmox-example-cloud-config.yaml"
}
} and #cloud-config
users:
- default
- name: ubuntu
groups:
- sudo
shell: /bin/bash
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAxxxxxxxxxxxxxxxxxxxxxxxx
sudo: ALL=(ALL) NOPASSWD:ALL
runcmd:
- apt update
- apt install -y qemu-guest-agent net-tools
- timedatectl set-timezone America/Toronto
- systemctl enable qemu-guest-agent
- systemctl start qemu-guest-agent
- echo "done" > /tmp/cloud-init-done works fine 🤔 |
Version v0.18.0 may produce a better error message for such use cases. |
I've already updated the package to the latest version available, still got some errors this is my resource:
The current error:
I don't know if this is important but I'm using terraform with Windows 11. maybe this information could be relevant but I also try it with WSL, but got the same error |
Ahhh, yes, that was it. Thanks for the details! Will make a fix later this week. |
Describe the bug
I'm currently playing around with the example and wanted to move the cloud-init user config to a separate file and replace the option
source_raw
withsource_file
.When I do it, during
terraform apply
, I get the following error:To Reproduce
In the example folder, within file
resource_virtual_environment_file.tf
I replaced thesource_raw
parameterwith
And moved those configs to a file
files/user_config.yml
within theexample
directory.(I applied some modifications so it doesn't use that tls private key anymore).
Expected behavior
I expected it to work the same way as before, creating the resource on the Proxmox server.
Screenshots
Additional info
I tried using both the absolute and relative paths, and also a URL, but it didn't help.
The text was updated successfully, but these errors were encountered: