Following some instructions to migrate a VM from one vnet to another, these particular instructions said to delete the VM keeping the OS drive and the launch a VM from the disk.
The original VM was launch from the Canonical 16.4 LTS marketplace image (Canonical:UbuntuServer:16.04-LTS:latest) using a managed disk.
This seemed fine but the deployment in the UI fails with the error:
"error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMMarketplaceInvalidInput", "message": "Creating a virtual machine from Marketplace image requires Plan information in the request. OS disk name is 'plesk1-disk'." } ]
Running the CLI
az vm create --name $virtualMachineName --resource-group $resourceGroupName --attach-os-disk $managedDiskId --os-type $osType
gives the same error while attempting to provide plan info,
az vm create --name $virtualMachineName --resource-group $resourceGroupName --attach-os-disk $managedDiskId --os-type $osType --image $imageName --plan-publisher $planPublisher --plan-name $planName --plan-product $planProduct
This resource was created without a plan. A new plan cannot be associated with an update.
This makes sense because the plan details were made up based upon properties of the image. Listing the image as JSON shows "plan: null" which matches the latter error.
az vm image show --urn Canonical:UbuntuServer:16.04-LTS:latest --output json
{ "additionalProperties": {}, "dataDiskImages": [], "id": "/Subscriptions/2692407a-01e0-42cf-a874-fdb3bc8f6332/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/16.04-LTS/Versions/16.04.201804050", "location": "westus", "name": "16.04.201804050", "osDiskImage": { "additionalProperties": {}, "operatingSystem": "Linux" }, "plan": null, "tags": null }
So the create VM command requests plan info to be provided, but the marketplace image itself has no plan so providing any plan details correctly errors.
Has anyone been able to work through this issue and create a VM from a marketplace image disk that has no plan using the UI, CLI and/or any other method?
The only successful discussions and results I have found online have been where the image does in fact have a plan and the az vm image show
command provides the required info, but in this case it is null and I can't find a way to pass a plan as null.