I'm actually not entirely sure this is a bug, but it is a bit annoying. I'd like to set both the shrink and grow autosize threshold at the same time but it doesn't seem to be working. Take the following example:
Now if I run this against a volume that's <20GB in size the defaults are grow at 92% and shrink at 85% so it'll work fine. However, if I run this against a volume >4TB, the defaults are grow at 98% and shrink at 93% and it throws the following error:
Reason: Autosize grow threshold must be larger than the shrink threshold. (errno=160)
So, even though I'm asking to change both of them at the same time, something internal is asking for the grow threshold to be set first which conflicts with the shrink. My workaround is to set the shrink value first, then make a second call for the grow. Is this expected behavior?
I should also note that, indeed changing them at the same time works fine, as long as they don't overlap with the volume defaults.
You've described it perfectly. Despite you chaning multiple values in a single call, each is changed individually and each must meet the various checks and rules as they go, as opposed to having a starting state, and ending state, and checking whether the entire ending state is valid then applying the ending state. This latter description is what you want, but it's the former that the DoT uses. You just have to be aware of it and process accordingly. Consider it a "feature".
With respect to what gets changed first, hard to say. I've tended to assume alphabetical order of parameter, and I haven't seen or experienced anything to indicate a different order.
Autosizes are fun. Another example would be if you are adding compression to a previously uncompressed volume. If a volume is near it's size limit (despite having an autosize) the space efficiency job can fail based on an estimate of the actual space available and snapshot size needed. So you fake it by increasing size, starting the job, and immediately decreasing volume size. Why could not the autosize limit be taken into account? Would seem natural sure, but it just isn't. So we work around such behaviors.