如何将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.
storageAccountName=”roger1026”diskName =”rogerdisk”
deststorageAccountName=”roger109”destdiskName =”destrogerdisk”
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.
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 ReadsaKey=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.
相关文章推荐
- oracle中如何将一个表从一个表空间中移动到另一个表空间
- RCP:如何把Preferences中的项从一个类别移动到另一个类别
- RCP:如何把Preferences中的项从一个类别移动到另一个类别
- oracle中如何将一个表从一个表空间中移动到另一个表空间
- [Azure]使用Powreshell跨区域拷贝托管磁盘
- 如何在 Azure 门户中将托管数据磁盘附加到 Windows VM
- RCP:如何把Preferences中的项从一个类别移动到另一个类别 2013-08-23 18:59 by Binhua Liu,
- 如何在 Azure 门户中将托管数据磁盘附加到 Windows VM
- 基于 Azure 托管磁盘配置高可用共享文件系统
- [Azure]使用Powershell将ARM虚拟机(托管磁盘)加入可用性集
- C#:光标通过上下键或者enter键从一个textBox移动到另一个textBox或实现按键click功能
- git cherry-pick. 如何把已经提交的commit, 从一个分支放到另一个分支
- 如何从一个php文件向另一个地址post数据,不用表单和隐藏的变量
- [Azure]使用Powershell删除ARM模式下单台虚拟机及相关资源(托管磁盘)
- 如何把已经提交的commit, 从一个分支放到另一个分支
- git cherry-pick. 如何把已经提交的commit, 从一个分支放到另一个分支
- 在oracle中如何从一个用户切换到另一个用户
- ListBox脚本控制:项从一个ListBox移动到另一个ListBox
- 如何将使用托管磁盘虚拟机的 OS 盘挂载到其他虚拟机上
- 如何禁止用户从一个文本框复制文本到另一个文本框?