Thursday, April 20, 2017

Creating a new Managed Disk from a Managed Disk Snapshot

It turns out that the operation is quite easy.  The New-AzureRmDiskConfig has an option to reference a source resource id  This ID can be found in the portal (or via powershell) when you click on a managed disk.  Simply input that when you create a new disk (as shown below) and it will create a new disk based off of your snapshot.


$diskConfig = New-AzureRmDiskConfig -CreateOption Copy -SourceResourceId "id from portal" -Location westus -DiskSizeGB 64 -AccountType StandardLRS
$disk = New-AzureRmDisk -DiskName "name" -Disk $diskConfig -ResourceGroupName "rgname"


Official documentation can be found here.