locked
Create Ubuntu VHD for a VM ARM RRS feed

  • Question

  • Dear All,

    I am trying to create an Ubuntu VHD for a multi-nic VM I am working on. I found an Ubuntu VHD on the website below and downloaded and saved it to my local PC.

    https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-create-upload-ubuntu?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json

    I then created a powershell script to upload that VHD into a storage account I created in my Azure Resource Group. Unfortunately, my script does not work. 

    I have no idea what I am doing wrong. Any assistance will be greatly appreciated.

    $ResourceGroupName = "BS-RSG-01"

    $BlobLocation = "https://bsdisc02.blob.core.windows.net/vhds"
    $BlobContainer = "vhds"
    $BlobName = "test"
    $BlobDestination = $BlobLocation + $BlobContainer + "/" + $BlobName

    $LocalFilePath = "C:\Users\pcics039\Downloads\xenial-server-cloudimg-amd64-disk1.vhd"
    $LocalFileName = "xenial-server-cloudimg-amd64-disk1"
    $LocalFIle = $LocalFilePath + $LocalFileName

    Add-AzureRMVhd -ResourceGroupName $ResourceGroupName -Destination $BlobDestination $BlobDestination -LocalFilePath $LocalFile -NumberOfUploaderThreads 8

    Thank you

    Manny


    • Edited by 3lmanny00 Sunday, December 11, 2016 12:55 AM
    Sunday, December 11, 2016 12:54 AM

All replies

  • Hi Manny,

    Thanks for posting here!

    I could notice from your code snippet that the variable $BlobDestination has been repeated twice. That could be the reason why the script isn't working. It would help if you could share the error message with us.

    You could also follow the code from the link given here. It is pretty similar to the one you have written. Hope it helps!

    Regards.

    Md. Shihab

    ********************************************************************

    Please remember to click "Mark as Answer" on the post that helps you as this can be beneficial to other community members reading the thread. And vote as helpful.

    • Proposed as answer by Md Shihab Tuesday, January 17, 2017 10:04 AM
    Sunday, December 11, 2016 6:10 AM
  • Hi,

    Yes, we can use PowerShell to upload the VHD to Azure storage account.

    More information about how to use PowerShell to upload VHD, please refer to the link below:

    https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-upload-image?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json

    Also we can use a GUI tool to upload the VHD, we can use Azure storage explorer to upload:

    If you still have questions, welcome to post back here. Thanks.

    Best Regards,


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, December 12, 2016 1:36 AM
  • Hi Manny,

    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,
    Jason Ye

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, December 13, 2016 9:51 AM