Skip to content

Azure CLI 2.30.0 broke the az snapshot create #20313

@Michael-Sinz

Description

@Michael-Sinz

Describe the bug
As of Azure CLI 2.30.0, the "az snapshot create" logic broke for us.

We would use that to try to create a snapshot and in 2.29.2 (and before) it would create the snapshot. With 2.30.0 it produces an error of the resource not being found.

To Reproduce

We use snapshot of VMSS disk instances in our system but it now has stopped working.

What we do:

We pick an instance (this case, #14)

We first read the data about that instance to get the disk:

'az' 'vmss' 'show' '--subscription' '3a96ef56-41a9-40a0-b0f3-fb125c2b8798' '--resource-group' 'SCM__msinz1' '--name' 'k8s-agentpool1-18861755-vmss' '--instance-id' '14'

This gets us storageProfile.osDisk.managedDisk.id = /subscriptions/3a96ef56-41a9-40a0-b0f3-fb125c2b8798/resourceGroups/SCM__msinz1/providers/Microsoft.Compute/disks/k8s-agentpool1-18861k8s-agentpool1-188617OS__1_897a52de44e94f1eac3e422b2aaa07d5

Then we stop the instance such that it is in stable state:

'az' 'vmss' 'stop' '--subscription' '3a96ef56-41a9-40a0-b0f3-fb125c2b8798' '--resource-group' 'SCM__msinz1' '--name' 'k8s-agentpool1-18861755-vmss' '--instance-ids' '14'

Then we try to snapshot that disk:

'az' 'snapshot' 'create' '--subscription' '3a96ef56-41a9-40a0-b0f3-fb125c2b8798' '--resource-group' 'SCM__msinz1' '--name' 'snapshot_k8s-agentpool1-18861755-vmss' '--source' '/subscriptions/3a96ef56-41a9-40a0-b0f3-fb125c2b8798/resourceGroups/SCM__msinz1/providers/Microsoft.Compute/disks/k8s-agentpool1-18861k8s-agentpool1-188617OS__1_897a52de44e94f1eac3e422b2aaa07d5' '--tags' 'BuiltFrom=k8s-agentpool1-18861755-vmss00000e' 'BuiltAt=2021-11-12 13:47:06.889728'

This has worked for well over a year without failure.

However, as of our execution with version 2.30.0, it returns with this failure:

(ResourceNotFound) The Resource 'Microsoft.Compute/disks/k8s-agentpool1-18861k8s-agentpool1-188617OS__1_897a52de44e94f1eac3e422b2aaa07d5' under resource group 'SCM__msinz1' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Compute/disks/k8s-agentpool1-18861k8s-agentpool1-188617OS__1_897a52de44e94f1eac3e422b2aaa07d5' under resource group 'SCM__msinz1' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

This is causing failures of our processes across all of azure right now.

Expected behavior
It should have created the snapshot - if I revert to 2.29.2, it does.

Environment summary
This is failing on Ubuntu 18.04 and 20.04 VMs with Azure CLI 2.30.0 installed.
This works in the same Ubuntu VMs with Azure CLI 2.29.2 (and prior) installed.

Additional context
This is extra complex to deal with reverting since the auth mechanism changed in 2.30.0 and reverting an instance in pipelines is tricky to do correctly.

Metadata

Metadata

Assignees

Labels

Computeaz vm/vmss/image/disk/snapshotcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions