Is it possible to convert azure VM from Managed Disk to UnManaged Disk? [closed]

泄露秘密 提交于 2019-12-02 04:44:39

问题


i have created new VM in Azure with Managed disk. now i want to convert it to Unmanaged disk. Is it Possible?


回答1:


now i want to convert it to Unmanaged disk. Is it Possible?

There is no way to convert it to unmanaged disk direct.

As a workaround, we can copy VHD from managed disk to unmanaged disk, then use this VHD to create a new VM.

We can do that with PowerShell command:

$sas = Grant-AzureRmDiskAccess -ResourceGroupName "[ResourceGroupName]" -DiskName "[ManagedDiskName]" -DurationInSecond 3600 -Access Read  
$destContext = New-AzureStorageContext –StorageAccountName "[StorageAccountName]" -StorageAccountKey "[StorageAccountAccessKey]"
$blobcopy=Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer "[ContainerName]" -DestContext $destContext -DestBlob "[NameOfVhdFileToBeCreated].vhd"

After copy completed, we can use the new VHD to create a VM.

Here is a template about create Azure vm with existing VHD and existing Vnet, please refer to it.



来源:https://stackoverflow.com/questions/45566291/is-it-possible-to-convert-azure-vm-from-managed-disk-to-unmanaged-disk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!