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.