-
Notifications
You must be signed in to change notification settings - Fork 580
feature/import-disk: add import_from to disk options #1330
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
base: master
Are you sure you want to change the base?
Conversation
TL;DR;This took me way longer than expected, the nesting of @Tinyblargon some of this is rather messy, let me know what you think and if you have any other approaches. Current StateFor now the The implementation ALWAYS passes the Regarding the
|
Thank you for your work on this feature. A few points of feedback. WriteOnlyWe get around using terraform-provider-proxmox/proxmox/Internal/resource/guest/qemu/cloudinit/terraform.go Line 15 in 58d4429
WriteOnly implementation is clearer and would be preferable.
Setting ImportFromWhy isn't the logic for setting the terraform-provider-proxmox/proxmox/Internal/resource/guest/qemu/disk/sdk_disk.go Lines 98 to 118 in 58d4429
terraform-provider-proxmox/proxmox/Internal/resource/guest/qemu/disk/sdk_disks.go Lines 77 to 98 in 58d4429
SugestionMaybe with getting the previous value of the oldVal, newVal := d.GetChange("my_setting") Upstream
This feels like an issue that should be resolved in the SDK/library itself, not in Terraform. |
@Tinyblargon thanks for taking the time to assist! Greatly appreciated.
Mostly because I didn't want to change the functions parameters passed in E.g. for IDE disks (top level)
terraform-provider-proxmox/proxmox/Internal/resource/guest/qemu/disk/sdk_disks.go Line 49 in 58d4429
+ the lower level functions and all these for the 3 other types of disks as well. If you think passing the raw config could be helpful in the future, i could refactor.
The docs on
If we keep
I do like the idea of that feature, it would allow users to use some sort of "immutable" cloud image and do upgrades via import, however i would probably set this as new feature when this is done, we do need to consider the
It depends, if the Provider SDK should behave like the actual PVE API (which I as user would suppose) I would add this to the terraform logic. But that's personal preference. |
@Tinyblargon any updates on this? thoughts? |
This PR will resolve #1236.
The option ìmport_from
was added in https://github.com/Telmate/terraform-provider-proxmox/pull/606 but never made the cut to the version
3.x.x` updates made to the provider.Simply adding the option to the SDK (which added that feature with Telmate/proxmox-api-go#412) will create the disks.
However the size of the disk will not be changed, even if a different size than the imported disk is desired.
A second
plan
will show that the sizes need to be changed (andapplied
) again.There are still open points to be done here:
import_from
for present disks, as proxmox doesn't save this option and won't return it either. It is only used for disk creation.