feature/import-disk: add import_from to disk options#1330
feature/import-disk: add import_from to disk options#1330noahlehmann wants to merge 5 commits intoTelmate:masterfrom
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 WriteOnly implementation is clearer and would be preferable.
Setting ImportFromWhy isn't the logic for setting the 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) + 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 version3.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
planwill show that the sizes need to be changed (andapplied) again.There are still open points to be done here:
import_fromfor present disks, as proxmox doesn't save this option and won't return it either. It is only used for disk creation.