locked
copy managed across locations RRS feed

  • Question

  • I can't seem to copy managed disks across locations. I'm told others have gotten this to work. The following 8-line script grabs a pointer to a disk in eastus and then tries to copy it to eastus2 and then eastus. 

    function mdCopy ($loc) { write ("*** start copy disk " + $disk + " from " + $fromObj.Location + " to " + $loc)
    $toObj = New-AzureRmDiskConfig -SourceResourceId $fromObj.Id -Location $loc -CreateOption Copy
    $return = New-AzureRmDisk -Disk $toObj -ResourceGroupName "shared" -DiskName ($disk + "-" + $loc) #Debug
    write ("*** call to New-AzureRmDisk returns " + $return.ProvisioningState) }

    $disk = "win16seed" # this disk resides in eastus
    $fromObj= Get-AzureRMDisk -ResourceGroupName "shared" -DiskName $disk
    mdCopy "eastus2" # this fails
    mdCopy "eastus"  # this succeeds

    Output follows. The first copy fails and the second succeeds

    *** start copy disk win16seed from eastus to eastus2
    New-AzureRmDisk : The entity was not found.
    ErrorCode: NotFound
    ErrorMessage: The entity was not found.
    StatusCode: 404
    ReasonPhrase: Not Found
    OperationID : 96c9b47f-2692-4016-8325-90026733a654
    At line:3 char:11
    + $return = New-AzureRmDisk -Disk $toObj -ResourceGroupName "shared" -D ...
    +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [New-AzureRmDisk], ComputeCloudException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDisk

    *** call to New-AzureRmDisk returns
    *** start copy disk win16seed from eastus to eastus
    *** call to New-AzureRmDisk returns Succeeded

    Any thoughts on what I am doing wrong?

    TIA,
    JQ

     

    Monday, March 26, 2018 4:58 PM

All replies

  • Managed Disks cannot be copied to another location currently. You have to first download the underlying VHD file to a storage account in another region and then use the VHD file to create a Managed Disk.

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    • Proposed as answer by vikranth s Monday, March 26, 2018 6:38 PM
    Monday, March 26, 2018 6:38 PM