I seem to have a problem creating a managed disk from a snapshot.
It appears that I can only create a disk in one region which is West US.
Here is the PowerShell script I use:
Get-AzureRmSubscription –SubscriptionName 'MySubscription' | Select-AzureRmSubscription
$resourceGroupName = 'MyResourceGroup';
$diskName = 'MyNewDisk';
$location = 'West US';
$snapshotName = 'MySnapshot';
$snapshot = Get-AzureRmSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName;
$diskConfig = New-AzureRmDiskConfig -AccountType $storageType -Location $location -SourceResourceId $snapshot.Id -CreateOption Copy;
$disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $diskName;
If I change the variable $region value to 'East US' or any other region, I get en error in PowerShell (resource not found).
The snapshot itself is in West US but I want to create a disk in East US. What am I doing wrong?
We can't create a managed disk from snapshot to another location.
If you want to create a managed disk from snapshot to another location, we should export/Copy managed snapshots as VHD to a storage account in different region with PowerShell.
Here the sample script:
More information about it, please refer to this link.