Open D-J-See opened 7 months ago
I can also replicate the issue. And i am currently trying to find out how and why its happening.
For reference on the original repo is a issue referring the same issue Telmate/terraform-provider-proxmox#901
I was able to get a closer look whats happening.
There is some kind of update of the VM after the rezize:
update VM 104: -agent 1 -bios seabios -cores 1 -cpu host -description terraform test -hotplug network,disk,usb -ide2 none,media=cdrom -kvm 1 -memory 2048 -name
Could be related to the changes of this commit:
90e6dba2013de3aeb4db8395daa3fad371b9d621
same problem with cloud-init, I get an error that cloud init drive is already attached to scsi1 (thats correct for my template, but didn't tell terraform about any location. Result is that I get an unused disk.
interestingly, when I put:
scsi {
scsi1 {
cdrom {
}
}
}
Then, I don't get any error. But even though I set cloudinit_cdrom_storage and efidisk storage to my desired storage, it's ignored and the efi+cloudinit drives appear on my local storage (this is where my template points).
Then I thought ok I change my template to my desired storage but this also didn't work. Results are kinda weird, EFI drive was fine but now I have 2 unused disks, my disk image and interestingly another EFI disk, cloudinit drive not visible at all.
For now going back to v2.9.16, here everything works for me.
To cross-pollinate here- for those looking for a quick-fix and willing to make changes, from the Discord server,
I am using 2.10 release the work around for cloud init was just to delete the cloud init drive from the temple before using it to create vms with terraform. Since I have a backup of the template it wasn't a big deal. Just glad to see the community solve these issues. I have very limited programming skills but I've wanted to learn go and this project added a reason to the list!
ManCreature @ 01/20/2024 11:58 AM
I confirmed this on my end as well, removing cloud drive from the template causes the host to start its boot process. For me the issue was with no DHCP it was unable to reach out to the timeserver and continue (and I'm alright waiting awhile for a fix so I didn't go any further down this).
Since the Telmate Repo has a new release, I would archive this repo. The new Release should also a fix for that
Hi there @TheGameProfi. Appreciate your work on this fork! I have tried to get version 2.10.0 working, but the provider does not carry over the cloud-init disk (ide0) from the template. Works fine on 2.9.16. I am not sure if this is expected behavior and the cloud-init disk needs to be defined in terraform instead of from the template? Incase you need more details: PVE version 8.1.4 Template is AlmaLinux 9.3 built using Packer with create cloud-init option set.
main.tf:
EDIT: Have updated the template config to not add the cloud-init disk and instead set cloudinit_cdrom_storage in the vm resource. Personally happy to stick with this configuration, as at the end of the day doesn't really matter at what stage the cloud-init disk is added, and is not the untidiest workaround :)