Skip to content

az snapshot create: failed in cmdline but succeeded in Portal GUI #20201

@tringuyen-yw

Description

@tringuyen-yw

Describe the bug

Create a snapshot of existing Azure disk. Failed when running az snapshot create at the command line. However the snapshot can be created manually using Azure portal UI.

Command Name

az snapshot create

Errors:

(OperationNotAllowed) CopyStart creation is not supported for this subscription.
Code: OperationNotAllowed
Message: CopyStart creation is not supported for this subscription.

To Reproduce:

Create a snapshot from an existing Azure disk. You need to know the azure disk Id to initialize the DEMO_PV_AZ_DISKID variable. In my case this is the name of the Kubernete Persistent Volume whcih is provisioned by the azure disk. In the example below that PV name is my-kubernetes-pv-name

DEMO_PV_AZ_DISKID=$(az disk list --subscription $AZ_SUBSCRIPTION --resource-group $AZ_RSGROUP \
  --query "[?contains(@.id, 'my-kubernetes-pv-name')==\`true\`].id" -o tsv)

# example of value 
DEMO_PV_AZ_DISKID='/subscriptions/71d79434-..etc..-49c86f13b3c5/resourceGroups/my-aks-resourcegroup/providers/Microsoft.Compute/disks/kubernetes-dynamic-pvc-a7642a85-..etc..-852dd015fc08'

Then create a snapshot ... which fails by "(OperationNotAllowed) CopyStart creation is not supported for this subscription."

AZ_SUBSCRIPTION='my-subscription'
AZ_RSGROUP='my-aks-resourcegroup'

az snapshot create --subscription $AZ_SUBSCRIPTION --resource-group $AZ_RSGROUP \
  --name demoPVmigrationSnapshot \
  --source $DEMO_PV_AZ_DISKID

Expected Behavior

Should create the snapshot and output the snapshot summary info similar to when doing "Create snapshot" using the Azure portal UI:

Azure_CreateSnapshot_03-obfuscated

Environment Summary

Linux-5.11.0-27-generic-x86_64-with-debian-bullseye-sid, Ubuntu 20.04.3 LTS
Python 3.6.10
Installer: DEB

azure-cli 2.30.0

Additional Context

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions