azure-cli
azure-cli copied to clipboard
az vm create failes with specific image version
This is autogenerated. Please review and update as needed.
Describe the bug
I can not create a vm based on a specific image version from an shared image gallery. Creating a vm based on the 'latest' version succeeded (although it is exactly this version).
Please note that the resource group in error message is the resource group i want to create the vm in. its not the rpg of the sig.
Command Name
az vm create
Errors:
(ResourceNotFound) The Resource 'Microsoft.Compute/galleries/kvscblsig01/images/BuildAgent' under resource group 'MyResourceGroup3' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Compute/galleries/kvscblsig01/images/BuildAgent' under resource group 'MyResourceGroup3' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- check available versions:
az sig image-version list -g KvsCblVmssAgent -r kvscblsig01 -i BuildAgent -o json
[
{
"id": "/subscriptions/***/resourceGroups/KvsCblVmssAgent/providers/Microsoft.Compute/galleries/kvscblsig01/images/BuildAgent/versions/1.23017.58252",
"location": "westeurope",
"name": "1.23017.58252",
"provisioningState": "Succeeded",
"publishingProfile": {
"endOfLifeDate": null,
"excludeFromLatest": false,
"publishedDate": "2023-01-17T08:57:45.134751+00:00",
"replicaCount": 1,
"replicationMode": null,
"storageAccountType": "Standard_LRS",
"targetExtendedLocations": null,
"targetRegions": [
{
"encryption": null,
"excludeFromLatest": null,
"name": "West Europe",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS"
}
]
},
"replicationStatus": null,
"resourceGroup": "KvsCblVmssAgent",
"safetyProfile": {
"allowDeletionOfReplicatedLocations": true,
"policyViolations": null,
"reportedForPolicyViolation": false
},
"storageProfile": {
"dataDiskImages": null,
"osDiskImage": {
"hostCaching": "ReadWrite",
"sizeInGb": 250,
"source": {
"id": null,
"storageAccountId": null,
"uri": null
}
},
"source": {
"communityGalleryImageId": null,
"id": "/subscriptions/***/resourceGroups/KvsCblVmssAgent/providers/Microsoft.Compute/images/BuildAgent",
"resourceGroup": "KvsCblVmssAgent"
}
},
"tags": {},
"type": "Microsoft.Compute/galleries/images/versions"
}
]
-
az vm create --resource-group MyResourceGroup3 -n MyVm --image /subscriptions/***/resourceGroups/KvsCblVmssAgent/providers/Microsoft.Compute/galleries/kvscblsig01/images/BuildAgent --public-ip-sku {} --admin-username {} --admin-password {}
<--this one succeed -
az vm create --resource-group MyResourceGroup3 -n MyVm2 --image /subscriptions/***/resourceGroups/KvsCblVmssAgent/providers/Microsoft.Compute/galleries/kvscblsig01/images/BuildAgent/versions/1.23017.58252 --public-ip-sku {} --admin-username {} --admin-password {}
<--this one failes
Expected Behavior
I would expect that i can create a vm based on a specific image version as documented.
Environment Summary
Linux-5.4.0-1100-azure-x86_64-with-glibc2.35 (Cloud Shell), CBL-Mariner/Linux
Python 3.9.14
Installer: RPM
azure-cli 2.43.0 *
Extensions:
ai-examples 0.2.5
ml 2.11.0
ssh 1.1.3
Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
Additional Context
@zhoxing-ms for awareness
Met the exact same issue in az vmss create
and fixed by upgrading az version from 2.43 to 2.44. It's the same as #24896.