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

心不动则不痛 提交于 2019-12-02 02:14:44

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.

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