Uploading a vhd from a popOs vm fails

James Tagaca 1 Reputation point
2022-04-07T18:56:30.84+00:00

Hello, I'm very new to azure and am having difficulty uploading a 40gb vhd file to a blob container so I can use this as an image to create a vm. I have tried the azurecopy GUI as well as the powershell but the GUI kept failing and it took me almost 14 hours to get to 60% and it failed, I tried twice and it failed. Now I am trying the powershell and I keep getting this error

"C:\Users\Admin\Downloads\azcopy_windows_amd64_10.14.1\azcopy.exe" copy "C:\Users\Admin\VirtualBox VMs\PopOs 1 Clone\PopOs 1 Clone-disk1.vhd" "sas url" --recursive=true

At line:1 char:68

  • ... Admin\Downloads\azcopy_windows_amd64_10.14.1\azcopy.exe" copy "C:\Use ...
  • ~~~~
    Unexpected token 'copy' in expression or statement.
  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : UnexpectedToken

I'm very stuck so any help would be appreciated, thank you!

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,125 questions
Azure Migrate
Azure Migrate
A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.
717 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,546 Reputation points Microsoft Employee
    2022-04-08T08:46:51.467+00:00

    Hello @James Tagaca ,
    Thanks for posting your query on Microsoft QnA Platform. Happy to answer your question.
    I understand you want to upload a Youvhd from PopOS VM and upload the VHD to Azure. PopOS is a Linux distro that is based upon Ubuntu. I am assuming you have already prepared the VM following the prerequisites.

    The azcopy syntax provided above seems incorrect. Can you try the below syntax:

    azcopy copy "local path of vhd" "containerSASURI" --recursive=true  
    

    Make sure to set the Expiry of the SAS URI to be long enough (greater than 24 hours), and provide both read and write permissions on the SAS token.

    You can also try using Storage Explorer to upload the vhd to blob container, it provides an easy way to do the same. However please have a stable and strong Internet connection with good upload speed so that the vhd can get uploaded to the container. Try using Storage explorer and let me know if it is still taking longer time, and also please confirm your Internet speed once. You can reply back by tagging me.

    References:

    Upload VHD using AzCopy via Bash
    Upload VHD using azcopy via Powershell

    Hope this helps.

    ----------------

    Please don't forget to Accept as answer and Upvote if you think the information provided was useful so that it can help others in the community looking for help on similar issues.

    0 comments No comments