Closed aravind365 closed 1 year ago
Thank you for opening this issue, we will look into it.
invalid usage for storage profile: create managed OS disk from custom image: not applicable: --os-type
Please do not specify the --os-type
when creating managed OS disk from custom image,
invalid usage for storage profile: create unmanaged OS disk created from generalized VHD: missing: --use-unmanaged-disk
You need to specify the parameter --use-unmanaged-disk
when creating unmanaged OS disk created from generalized VHD
Hello Xing,
Thank you for your reply ! But it’s not working unfortunately.
--use-unmanaged-disk https://***.blob.core.windows.net/***.vhd unrecognized arguments: https://***.blob.core.windows.net/***.vhd
I also tried the subscription urn instead of the URL for the VHD.
--use-unmanaged-disk /subscriptions/*/resourceGroups/*-resource-group/providers/Microsoft.Compute/images/os212-B unrecognized arguments: /subscriptions//resourceGroups/**-resource-group/providers/Microsoft.Compute/images/os212-B
Should I be using one of these options instead ?
@.***
Example on az vm unmanaged-disk | Microsoft Learnhttps://learn.microsoft.com/en-us/cli/azure/vm/unmanaged-disk?view=azure-cli-latest#az-vm-unmanaged-disk-attach below –
az vm unmanaged-disk attach -g MyResourceGroup --vm-name MyVm --name MyDataDisk \ --vhd-uri https://mystorage.blob.core.windows.net/vhds/d1.vhd
Just for comparing, I looked at the CLI output for a VM (NVA) that was created using Azure portal GUI. I has ‘managed disk’ as per below. I’m totally at a loss as to how to proceed with this. Would really appreciate if you could evaluate and advise at the earliest.
"osDisk": { "caching": "ReadWrite", "createOption": "FromImage", "deleteOption": "Detach", "diffDiskSettings": null, "diskSizeGb": 80, "encryptionSettings": null, "image": null, "managedDisk": { "diskEncryptionSet": null, "id": "/subscriptions/**/resourceGroups/AS_RG/providers/Microsoft.Compute/disks/AS-CPE-1_disk1_d2ae5507163e435aa0a0c2e00f479ec1", "resourceGroup": "AS_RG", "securityProfile": null, "storageAccountType": "StandardSSD_LRS" }, "name": "AS-CPE-1_disk1_d2ae5507163e435aa0a0c2e00f479ec1", "osType": "Linux", "vhd": null, "writeAcceleratorEnabled": null }
--
Thank you for your reply ! But it’s not working unfortunately.
@aravind365 May I ask what was the error message after trying the above methods? Could you please send the debug log (add --debug
parameter) to my email?
I have got it working with your suggested option of using unmanaged disk ! Many thanks for your help !
Could you also possibly advise on a couple of other questions I've got please ?
1> What option would i use for a marketplace image NVA instead of the VHD stored in my 'Images' section on Azure ? 2> To automate full deployment of an NVA (all objects like NICs, PIPs, Subnets, VNETs, RGs, UDRs etc), which automation method is recommended ?
Thanks again !
i've learnt az cli. all good, thanks for your help.
Describe the bug
i have a VHD for an NVA in a page blob container in my storage account. I'm unable to work out how to create the VM using Azure CLI because. The issue is that the --source option isn't working and i couldn't find any resource online on ms or anywhere else. Appreciate any guidance. Many thanks !
Related command
PS /home/user> az vm create --name MYORG-AZURE-SZ1 -g AS_RG --accept-term --size $vmsize --tags $tags --zone 1 --admin-username cpeadmin --authentication-type ssh --generate-ssh-keys --accelerated-networking false --nic-delete-option Detach --nics AZURE-NVA-CPE-1-MGT-IF, AZURE-NVA-CPE-1-WAN-IF, AZURE-NVA-CPE-1-LAN-IF --subnet AZURE-NVA-MGT-SUBNET --os-type Linux --image "/subscriptions/****/resourceGroups/ng-resource-group/providers/Microsoft.Compute/images/vos212-B"
invalid usage for storage profile: create managed OS disk from custom image: not applicable: --os-type PS /home/user> az vm create --name MYORG-AZURE-SZ1 -g AS_RG --accept-term --size $vmsize --tags $tags --zone 1 --admin-username cpeadmin --authentication-type ssh --generate-ssh-keys --accelerated-networking false --nic-delete-option Detach --nics AZURE-NVA-CPE-1-MGT-IF, AZURE-NVA-CPE-1-WAN-IF, AZURE-NVA-CPE-1-LAN-IF --subnet AZURE-NVA-MGT-SUBNET --os-type Linux --image $image invalid usage for storage profile: create unmanaged OS disk created from generalized VHD: missing: --use-unmanaged-disk PS /home/user>
Errors
invalid usage for storage profile: create managed OS disk from custom image: not applicable: --os-type
profile: create unmanaged OS disk created from generalized VHD: missing: --use-unmanaged-disk PS /home/aravindh>
Issue script & Debug output
NA
Expected behavior
VM creation from CLI
Environment Summary
Az Cloud Shell
Additional context
No response