[GH-ISSUE #88] Return a value for storage_type when reading qemu disks (or remove the need for it entirely) #15

Closed
opened 2026-02-28 00:40:11 +03:00 by kerem · 2 comments
Owner

Originally created by @doransmestad on GitHub (Aug 5, 2020).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/88

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.

Originally created by @doransmestad on GitHub (Aug 5, 2020). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/88 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.
kerem closed this issue 2026-02-28 00:40:11 +03:00
Author
Owner

@yukron commented on GitHub (Oct 23, 2020):

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

<!-- gh-comment-id:715324261 --> @yukron commented on GitHub (Oct 23, 2020): PR #94 would resolve this, also adding "format" key to Reads.
Author
Owner

@Tinyblargon commented on GitHub (Dec 5, 2024):

This has been solved by the new disk schema.

<!-- gh-comment-id:2521559447 --> @Tinyblargon commented on GitHub (Dec 5, 2024): This has been solved by the new disk schema.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#15
No description provided.