I have a problem with starting a VM on Azure using my custom image.
How I prepared my custom image:
- I had a VM running, based on an image from the Azure Marketplace.
- I stopped that VM and exported the OS disk (downloaded the VHD file).
- I uploaded that VHD file as a BLOB to my storage account on Azure.
- I created a new image (Images -> Create), selecting the previously uploaded VHD file as "Storage Blob."
Starting VM by UI
- When I try to create a new VM using my custom image through the Azure Web UI, the deployment fails with the following error message:
{
"code": "ResourceDeploymentFailure",
"message": "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'."
}
Starting VM by Azure Golang SDK
- When I try to launch a VM from the code level and I fill the
armcompute.VirtualMachineProperties
with image ID:
StorageProfile: &armcompute.StorageProfile{
ImageReference: &armcompute.ImageReference{
ID: to.Ptr("/subscriptions/MY_SUBSCRIPTION/resourceGroups/MY_RESOURCE_GROUP/providers/Microsoft.Compute/images/MY_IMAGE_NAME"),
},
to execute VirtualMachinesClient.BeginCreateOrUpdate
method, I receive the following error:
Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request
Does this mean that I always need to remember on which Marketplace image my custom image is based? I was planning to create several different custom images based on VMs running on various systems, and I thought that later, to use such images, only the Image ID would be sufficient.
Of course, when I'm filling Plan
field with some random values, there is an error:
The offer with Offer ID 'YOUR_OFFER' was not found.