az vmss update can't set osDisk caching to None
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### **This is autogenerated. Please review and update as needed.**
## Describe the bug
These commands work:
```bash
$ az vmss update --set virtualMachineProfile.storageProfile.osDisk.caching=ReadOnly
# outputs
...
"storageProfile": {
"osDisk": {
"caching": "ReadOnly"
...
$ az vmss update --set virtualMachineProfile.storageProfile.osDisk.caching=ReadWrite
# outputs
...
"storageProfile": {
"osDisk": {
"caching": "ReadWrite"
...
```
This one does not. It returns successfully but will not change the value of the field to "None".
```bash
$ az vmss update --set virtualMachineProfile.storageProfile.osDisk.caching=None
# outputs
...
"storageProfile": {
"osDisk": {
"caching": "ReadWrite"
...
```
If I try to PATCH the VMSS directly and then update all instances via the CLI, the operation succeeds. So it's not an API level issue, the bug is in CLI or Python SDK.
```bash
ace@ace-vm:~$ cat patch.json
{
"properties": {
"virtualMachineProfile": {
"storageProfile": {
"osDisk": {
"caching": "None"
}
}
}
}
}
ace@ace-vm:~$
ace@ace-vm:~$ az rest --method patch --uri "${VMSS_RESOURCE_ID}?api-version=2020-06-01" --body "${PATCH}"
...
"storageProfile": {
"osDisk": {
"caching": "None"
...
```
**Command Name**
`az vmss update`
**Errors:**
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- _Put any pre-requisite steps here..._
Create a VMSS with ReadWrite/ReadOnly OS disk caching, then try this:
- `az vmss update -g {} -n {} --set virtualMachineProfile.storageProfile.osDisk.caching=None`
## Expected Behavior
It should change the caching mode to None, as demonstrated via the patch.
## Environment Summary
```
Linux-5.4.0-37-generic-x86_64-with-debian-bullseye-sid
Python 3.6.10
Installer: DEB
azure-cli 2.11.1
Extensions:
kusto 0.1.0 (dev) /home/ace/code/azure-cli-extensions/src/kusto
aks-preview 0.4.62 (dev) /home/ace/code/azure-cli-extensions/src/aks-preview
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.