-
Notifications
You must be signed in to change notification settings - Fork 932
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
Storage: Use zero for unbound volumes' total size on the API #14837
Conversation
2f6bb0e
to
58336c3
Compare
@tomponline In addition, we did not address what value to use for unsupported usage in our last 1-1. But throughout our discussions we stablished that: For these reasons, volume/disk usage is being set here to be reported as 0 if not supported and -1 if an error ocurred while trying to retrieve its value. |
9042676
to
4417b69
Compare
Does this change any existing usage values compared to lxd 6.2? |
What situations are there when usage is not suppprted/unavailable. I suspect we may want to consider unavailable/unsupported as an error (-1) to allow differentiation from zero usage (a possibility as a genuine value). |
Yes. Similarly to what happened to "total", we went from a null struct to showing -1 for unsupported usage in #14511, that was recently merged and made it into 6.2. So this would be changing that -1 to a 0.
Also trying to get the usage on a snapshot volume is not supported on We use a uint64 omitempty for custom volume usage, so perhaps using something similar would be best to keep it consistent across volume types. Like always showing 0 usage in case of error/unsupported.
cc: @tomponline |
@hamistao does this PR effectively restore the behaviour that we had in LXD 6.1? |
Not exactly, it keeps the main purpose of the merged PR, which is to show total even when retrieving usage is unsupported, but changes the value that we want to show for unsupported usage and for unbound total from -1 to 0. |
Thanks. Did you check each storage driver's implementation for total size 0 if unbounded? |
@hamistao i think we'll land this one for LXD 6.3 to partially restore the previous behaviour. |
I agree. Thinking practically, although this is just conjecture, I suppose our users will hardly be bothered by this reverting. |
Yes it didnt make it into any LTS which is good. |
@hamistao so is this good to merge? |
@tomponline I am concerned about this failing test, please give me some time to check on it |
d3c8650
to
b46ce52
Compare
…limits" As per the discussion outlined on canonical#14595 (comment), we are sticking with using 0 to represent unbounded volumes. This reverts commit 26b8d73. Signed-off-by: hamistao <[email protected]>
Also renames variable to a more informative `usedBytes` Signed-off-by: hamistao <[email protected]>
Also renames variable to a more informative `usedBytes` Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
This omitempty is ineffective here since 0 is not a valid value for usage and any error in retrieving usage resulted, up until this point, in a null `StorageVolumeStateUsage` struct. So changing this doesn't break any previously existing behavior and this now matches how we represent unsupported DISK usage, by showing 0 usage. Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Now Usage is shown as 0 when retrieving it is unsupported. Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
b46ce52
to
857e0a7
Compare
@tomponline Sorry, I should have pinged you after I fixed the broken tests. This is ready. |
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!
@edlerd is this OK for LXD UI's consumption ? |
Yes, that seems all right. |
@MusicDin @roosterfish are all volumes in Powerflex and Pure bounded in size? Please can you double check they use the convention specified in this PR? Thanks |
As per discussed on #14595 (comment), this implements the standard of showing the size of unbound volumes as 0.
To keep the API consistent, also updates getting custom volume state so that total is shown even when usage is not supported and shows 0 to represent unsupporte usage of both custom and instance volumes.