0
votes

I had to delete a VM but kept the VHD and want to recreate the VM with this one since there is necessary data on it. What I did in the web interface:

  • Made sure the vhd is unattached
  • clicked in the vhd status page "create new virtual machine"
  • choose a size and left the rest as it was
  • created the vm

Now it says:

Error at provision. Creating a virtual machine from Marketplace image requires Plan information in the request. VM: '/subscriptions/a566b4bb-3fe4-4e2b-88ec-bb627e8c2d89/resourceGroups/dev-ext-west-host-/providers/Microsoft.Compute/virtualMachines/'.. VMMarketplaceInvalidInput

I really need to get the vm running again with this vhd, any ideas on this one?

EDIT: I did follow these steps for creating it: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/create-vm-specialized-portal#create-a-vm-from-a-disk

2

2 Answers

2
votes

Following your steps, I can create a new VM from unattached DISK using the Azure portal without any error. You can check these steps on your side and try it again.

It looks like you require Plan information in the request for some specific images. The Set-AzureRmVMPlan cmdlet sets the Azure Marketplace plan information for a virtual machine.

There is a SO Example

$vm = New-AzureRmVMConfig -vmName $vmName -vmSize $vmSize

Set-AzureRmVMPlan -VM $vm -Publisher bitnami -Product lampstack -Name "5-6"
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic.Id
$vm = Set-AzureRmVMOSDisk -VM $vm -Name $vhdName -VhdUri $vhdUri -Linux -CreateOption attach -Verbose
0
votes

As @nancy-xiong stated you need to add a plan during the recreation of the VM.

You will have to remember what image the VM was created from. The problem is that image/plan might no longer be available and the Plan must match for recreation.

Hope this helps.