将Azure VHD下载到本地使用Powershell [英] Download Azure VHD to local use powershell

查看:199
本文介绍了将Azure VHD下载到本地使用Powershell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将具有Powershell的Azure VHD下载到本地计算机?

How can I download azure vhd with powershell to local machine?

我已阅读文档,但找不到类似"

I read the document, but I can't find the blob url like "https://XXX.blob.core.windows.net/vhds/XXX.vhd"

有人知道吗?

谢谢

推荐答案

根据您的描述,您的VM使用托管磁盘而不是非托管磁盘.因此,您无法在存储帐户中找到VHD文件.有关托管磁盘的更多信息,请参考以下链接.

According to your description, your VM uses managed disk not unmanaged disk. So, you could not find the VHD file in storage account. More information about managed disk please refer to this link.

如果要在托管磁盘中下载VHD,则应首先将其复制到存储帐户.

If you want to download the VHD in managed disk, you should copy it to a storage account first.

##create $SAS
$sas = Grant-AzureRmDiskAccess -ResourceGroupName shui -DiskName shuitest -DurationInSecond 3600 -Access Read 
$destContext = New-AzureStorageContext –StorageAccountName contosostorageav1 -StorageAccountKey 'YourStorageAccountKey' 
Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer 'vhds' -DestContext $destContext -DestBlob 'MyDestinationBlobName.vhd'

然后,您可以使用 Azcopy 将VHD下载到本地.

Then, you could use Save-AzureVhd or Azcopy to download the VHD to your local.

请参阅类似的 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆