Is it possible to convert azure VM from Managed Di

2019-02-26 07:25发布

问题:

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.