Page 1 of 1

Azure VM from Converted VHD

Posted: Tue Oct 01, 2019 12:44 am
by mcooling
Hi there,

My first ever post and i'm a complete novice, so apols in advance if i'm breaking any protocol. Hopefully someone can help. I'm totally stuck!
I'm trying to create an Azure VM, using a VHD Image which I created using the converter. I've been through the Starwind guidelines https://www.starwindsoftware.com/blog/m ... s-to-azure and everything seems to have worked...I just can't get the very last step.

To finish, set the VM image as a source image for the new VM. So set the source image using the ID of the managed VM image:
$vm = Set-AzureRmVMSourceImage -VM $vm -Id $image.Id


I've tried all kinds, but i'm obviously just not running the command properly. I've used both the resource ID and source blob URI as the 'managed vm image id'.

I someone could help, it would be massively appreciated. I've spent hours trying to nail this.

PS C:\Windows\system32> $vm = Set-AzureRmVMSourceImage -VM $vm -Id $image.Id "https://myvmnetstorageaccount.blob.core ... DImage.vhd"
Set-AzureRmVMSourceImage : Cannot validate argument on parameter 'VM'. The argument is null or empty. Provide an
argument that is not null or empty, and then try the command again.
At line:1 char:36
+ $vm = Set-AzureRmVMSourceImage -VM $vm -Id $image.Id "https://myvmnet ...
+ ~~~
+ CategoryInfo : InvalidData: (:) [Set-AzureRmVMSourceImage], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.Compute.SetAzureVMSourceImageCommand

Re: Azure VM from Converted VHD

Posted: Wed Oct 02, 2019 8:45 am
by Boris (staff)
I think it would be good to ask the article author directly by putting a comment under that article. This may be faster than getting any insight into this here via the forums.