Skip to content
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

Return a value for storage_type when reading qemu disks (or remove the need for it entirely) #88

Open
doransmestad opened this issue Aug 5, 2020 · 1 comment

Comments

@doransmestad
Copy link
Contributor

doransmestad commented Aug 5, 2020

I'm working on a pull request for the terraform provider, and it looks like the qemuDisk's attribute storage_type is required for the creation/update of disks within a qemu resource, but that value is not returned by a call to NewConfigQemuFromApi. This is unfortunate as I'm not able to be sure of the current value to use for storage_type after creation (to detect drift and correctly update the terraform state).

Ideally, we could remove the need for storage_type as it appears to only be used here: https://github.com/Telmate/proxmox-api-go/blob/master/proxmox/config_qemu.go#L900 in order to format the disk path correctly. Perhaps we could issue another API query to proxmox to list storage types (/storage/<storage_name>) and pull out the type attribute from there? Then we wouldn't need storage_type at all.

Or, if not the above, when a VM is read perhaps we can re-use the logic from line 900 above to return the storage_type format required (dir vs rbd for example).

Thoughts? I'm happy to attempt a contribution of either approach depending on preference.

@yukron
Copy link
Contributor

yukron commented Oct 23, 2020

PR #94 would resolve this, also adding "format" key to Reads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants