-
Notifications
You must be signed in to change notification settings - Fork 512
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
Creating clone always results in unused disk #1067
Comments
@DennisSerafin the disk has to be configured in Terraform, as Terraform will make the cloned vm as configured. Any properties that are not configured in the TF file but are carried over from the original VM are bugs or lack of implementation. |
Thanks for the quick answer. Is there no chance I can use the cloned disk from my template as a boot device for the cloned VMs when I clone via Terraform? |
@DennisSerafin if you configure a disk in the same slot as the disk from the original vm, Terraform will see that the disk is an intended part of the configuration and keep it. Do keep in mind that the configured dis has to be at least as big as the original, or else it will be recreated. |
@Tinyblargon, thanks for the info. The problem is, when I create the new disk the same size as the cloned disk, Terraform replaces the old one, making the disk appear empty. The disk size from the template is 80GB, and here is what I added in modules/vm/main.tf:
Now, the unused disk is gone, but it can't boot the OS that was installed in the template. |
@DennisSerafin currently we only detach the disk, so if it isn't detached it should still be tge same drive. I think |
@Tinyblargon I removed so i tried to boot manually from disk, but this didn't work eithter: i used the same .yml with the disk part. So I must be overlooking something, any ideas? |
Hello @DennisSerafin, I got the same error. And after a huge amount of time searching I got the solution from this https://github.com/Telmate/terraform-provider-proxmox/issues/770#issuecomment-1552567416 FYI: this is my main.tf
|
@thiraphi thanks for your answer, unfortunately this din´t work. I think it din´t clone the Disk, it create a new Disk instead. main.tf
it dint´t boot from disk. It seems like the Disk is empty. and when i manually clone the Template, everything works as expected |
@DennisSerafin |
This worked for me on a linux install. I was trying a bunch of things but the disk was always unmounted, thank you for this! |
Issue: Disk in Unused State After Cloning Template with Terraform
Description
When cloning a Windows template using the PVE GUI, everything works as expected and Windows boots perfectly. However, when cloning the template using Terraform with the
telmate/proxmox
provider, the boot disk is in an unused state, as shown in the attached screenshot.Terraform Configuration
modules/vm/main.tf
Steps to Reproduce
Expected Behavior
The cloned VM should boot up with the disk properly attached, as it does when cloned via the PVE GUI.
Actual Behavior
The disk is in an unused state, preventing the VM from booting properly.
Additional Context
I have
cloudbase-init
installed on the Windows template.Workaround
If there is a workaround or manual steps that need to be performed to resolve the issue, please describe them here.
The text was updated successfully, but these errors were encountered: