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

[3.0.1-rc1] Consider revisiting disk size before release #912

Closed
riverar opened this issue Jan 28, 2024 · 5 comments · Fixed by #929
Closed

[3.0.1-rc1] Consider revisiting disk size before release #912

riverar opened this issue Jan 28, 2024 · 5 comments · Fixed by #929
Assignees
Labels

Comments

@riverar
Copy link
Contributor

riverar commented Jan 28, 2024

The new disks format has changed the size parameter to be an int that represents "the size of the created disk in Gigabytes". This is a regression from the previous regex that supported \d+[GMK]. It also means it's not possible to create disks smaller than 1 gigabyte.

If supporting the previous regex expression is not desirable, perhaps an easier change would be to make size represent kilobytes to support folks needing disks smaller than 1GiB.

@Tinyblargon @mleone87

@Tinyblargon Tinyblargon self-assigned this Jan 28, 2024
@Tinyblargon
Copy link
Collaborator

@riverar I've found the reason of this regression. The proxmox disk creation API only allows the size in gigabytes.

Previously it would create a disk file in the storage and then link that disk file to the vm. Adding in this functionality would require a partial rewrite of how we create, read and resize disk in proxmox-api-go.

@riverar
Copy link
Contributor Author

riverar commented Jan 28, 2024

Hey @Tinyblargon, I don't think that's right. The previous provider (2.x) supported all sizes via regex and the Proxmox VE API docs seem to confirm this is supported.

https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/resize

@Tinyblargon Tinyblargon reopened this Jan 28, 2024
@Tinyblargon
Copy link
Collaborator

@riverar Well in https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/config they keep referring to STORAGE_ID:SIZE_IN_GiB to create new disks. I've tried STORAGE_ID:0,size=64M, but this resulted in a drive with a size of 0T getting created. Maybe creating the drive with a size of 0 and then resizing it would work. Gonna try this tomorrow.

@riverar
Copy link
Contributor Author

riverar commented Jan 29, 2024

Interesting, I see that too. Although it specifies size as DiskSize / disk-size which, digging through their code, appears to be matching against the usual string expression (m/^(\d+(\.\d+)?)([KMGT])?$/). But then we would have expected your initial create test to work...

I continue to be very unimpressed by the Proxmox VE API 😅

@Tinyblargon
Copy link
Collaborator

Upstream the functionality is almost there Telmate/proxmox-api-go#305.
To keep it compatible no letter will be equivalent to G, so 10G and 10 would be the same.

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

Successfully merging a pull request may close this issue.

2 participants