i have created new VM in Azure with Managed disk. now i want to convert it to Unmanaged disk. Is it Possible?
Asked
Active
Viewed 8,885 times
3

David Makogon
- 69,407
- 21
- 141
- 189

Avinash patil
- 1,689
- 4
- 17
- 39
-
can you explain why -1? – Avinash patil Aug 08 '17 at 11:04
1 Answers
5
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.

Jason Ye
- 13,710
- 2
- 16
- 25
-
yes, it is helpful. i just want to confirm there is no other way we can attach unmanaged Disk to Managed disk VM? May be requesting to MS to change it to Unmanaged disk or attach unmanaged disk is possible? – Avinash patil Aug 09 '17 at 07:02
-
1@Avinashpatil For now, it's not possible. we should do it by ourselves. we can use powershell to do it. – Jason Ye Aug 09 '17 at 07:08
-
-
@JPHellemons For now, there is no way to convert it to unmanaged disk direct. – Jason Ye Feb 08 '18 at 06:07
-
Is powershell the only option? Or is it also in the portal? By making a snapshot or something? – JP Hellemons Feb 09 '18 at 08:06
-
@JPHellemons you can use portal to create snapshot of managed disk, but you need to use powershell or CLI to copy it. – Jason Ye Feb 09 '18 at 08:08
-
@JasonYe-MSFT sorry to bother you, but the template url is a huge json string. Would be nice to have this document the other way around https://learn.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks What is the minimum of powershell required? I think that I am also lost in powershell, azure shell, azure cli, cross plat powershell etc. Should I post it as a new question? Because it's actually the same question as OP. Only with less powershell/cli :) – JP Hellemons Feb 09 '18 at 08:41
-
@JPHellemons Do you mean you don't want to use powershell/cli to do it? – Jason Ye Feb 09 '18 at 08:54
-
I'd prefer a GUI option because I am afraid to break stuff with powershell/cli that is why I'd like to limit it. – JP Hellemons Feb 09 '18 at 09:14
-
@JPHellemons Sorry, for now, GUI is not support. you can use Powershell to copy it, like that answer. – Jason Ye Feb 09 '18 at 09:17
-
Ok, I have the OS disk in a storage container as vhd and the 2nd disk from the vm in the same container. But It's not listed at the `Disc (classic)` new wizard in the portal. https://blogs.technet.microsoft.com/mckittrick/how-to-rebuild-a-vm-from-an-existing-os-disk-rdfe/ Can't find the `OS disks (classic)` Seems outdated docs? Also can't find the blob/container in same subscription https://imgur.com/a/QXg6i – JP Hellemons Feb 09 '18 at 10:16
-
This did work for a 127gb disk but not for a larger 512. Keep getting blob not ready and the 512gb blob in the portal shows 0 byte size then... strange. – JP Hellemons Feb 15 '18 at 15:58