您的位置:首页 > 其它

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

2018-01-18 16:06 302 查看
1,first we need to create a source storage account for migration.

rgName=”roger02”location =”East Asia”

storageAccountName=”roger1026”New−AzureRmResourceGroup−NamergName -Location locationNew−AzureRmStorageAccount−NamestorageAccountName -Location location−SkuNamePremiumLRS−ResourceGroupNamergName

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

rgName=”roger01”location =”West Europe”

storageAccountName=”roger109”New−AzureRmResourceGroup−NamergName -Location locationNew−AzureRmStorageAccount−NamestorageAccountName -Location location−SkuNamePremiumLRS−ResourceGroupNamergName

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=Grant−AzureRmDiskAccess−ResourceGroupNamergName -DiskName $diskName -DurationInSecond 3600 -Access Read

saKey=Get−AzureRmStorageAccountKey−ResourceGroupNamedestrgName -Name deststorageAccountNamestorageContext =New-AzureStorageContext –StorageAccountName deststorageAccountName−StorageAccountKeysaKey[0].Value

New-AzureStorageContainer -Context $storageContext -Name vhds10261

Start-AzureStorageBlobCopy -AbsoluteUri sas.AccessSAS−DestContainervhds10261−DestContextstorageContext -DestBlob $destdiskName

Get-AzureStorageBlobCopyState -Context storageContext−BlobdestdiskName -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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐