如何将Azure托管磁盘从一个区域移动到另一个区域

1,first we need to create a source storage account for migration.

rgName=roger02 location =”East Asia”
storageAccountName=roger1026NewAzureRmResourceGroupName rgName -Location locationNewAzureRmStorageAccountName storageAccountName -Location locationSkuNamePremiumLRSResourceGroupName rgName

2,create a new storage account in the region we want to move to.

rgName=roger01 location =”West Europe”
storageAccountName=roger109NewAzureRmResourceGroupName rgName -Location locationNewAzureRmStorageAccountName storageAccountName -Location locationSkuNamePremiumLRSResourceGroupName rgName

3,create a managed disk under the resource group “roger02” within portal

这里写图片描述

这里写图片描述

这里写图片描述

这里写图片描述

4,execute the rest commands to copy the blob and get a status.

Source storage account

rgName=roger02 location =”East Asia”
storageAccountName=roger1026 diskName =”rogerdisk”

Target storage account

destrgName=roger01 destlocation =”West Europe”
deststorageAccountName=roger109 destdiskName =”destrogerdisk”

Assign access to the source disk

sas=GrantAzureRmDiskAccessResourceGroupName rgName -DiskName $diskName -DurationInSecond 3600 -Access Read

saKey=GetAzureRmStorageAccountKeyResourceGroupName destrgName -Name deststorageAccountName storageContext =New-AzureStorageContext –StorageAccountName deststorageAccountNameStorageAccountKey saKey[0].Value
New-AzureStorageContainer -Context $storageContext -Name vhds10261

Start-AzureStorageBlobCopy -AbsoluteUri sas.AccessSASDestContainervhds10261DestContext storageContext -DestBlob $destdiskName

Get-AzureStorageBlobCopyState -Context storageContextBlob destdiskName -Container vhds10261

Now we only need to wait for the replication process to complete. The above is the steps to migrate the managed disk through the powershell command.

Note:
If the managed disk is attached to the VM, stop the VM and copy it to the storage account.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值