-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
proxmox_disk: prevent trying to shrink disks #7969
base: main
Are you sure you want to change the base?
Conversation
Shrinking Disks is not supported by the PVE API (https://pve.proxmox.com/wiki/Resize_disks) and should be prevented by the module.
The test
The test
The test
The test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
I don't know whether it's a good idea to prevent this, since both the old and the new behavior result in a failure. But it could happen that at some point the API suddenly supports shrinking, and then this extra check would be problematic.
changelogs/fragments/7969-proxmox-disk-prevent-shrinking-attempts.yml
Outdated
Show resolved
Hide resolved
…pts.yml Co-authored-by: Felix Fontein <felix@fontein.de>
I'm agree with Felix. Current behavior is mentioned in module documentation and may be changed in future. I think there's no need to fix since this behavior is not a bug. |
You're saying that the module already should return a failed result when trying to shrink a disk? When I try that, the module reports "changed", but the Proxmox Cluster Log shows an Error: Versions we currently use: To make sure it's not the outdated version, i tried upgrading |
Hmm, maybe the API says "everything's fine" to the caller, queues the job, and only then the job fails while the caller (in this case the module) already returned "everything's ok"? |
I have checked with different PVE versions and v8 reports success before task being queued (and failed).
|
@castorsky So this is a regression in PVE, right? Maybe it'd be a good idea to open a ticket with them about this. FYI We are currently in the process of moving the @aBUDmdBQ Would you be okay to close this PR and reopen it in |
I'm not sure where is the root of the problem but it seems that this call should be async (via POST, not PUT). I have already implemented this for This PR does not solve the root cause - it just patches some random consequence. So I think it's better to close PR in this repo. |
@krauthosting Yes, I'm fine with closing this and trying to get it fixed upstream. Otherwise I will open it again in |
SUMMARY
Shrinking Disks is not supported by the PVE API and should be prevented by the module:
https://pve.proxmox.com/wiki/Resize_disks
Currently, when the configured size of the disk is smaller than the actual size, the module reports a change, but the change isn't actually happening. The module doesn't detect that this fails.
This PR checks if the user tries to shrink the disk and then fails instead of contacting the PVE API.
ISSUE TYPE
COMPONENT NAME