I'm trying to create a VM from an Azure Snapshot by following the steps outlined here.
I have reached the step:
$disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $osDiskName
However, when this line is run, the following error is obtained:
New-AzureRmDisk : Changing property 'creationData' is not allowed.
ErrorCode: PropertyChangeNotAllowed
ErrorMessage: Changing property 'creationData' is not allowed.
StatusCode: 409
ReasonPhrase: Conflict
OperationID : 85382399-64e8-4547-804d-ef0796301b63
At line:1 char:9
+ $disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmDisk],
ComputeCloudException
+ FullyQualifiedErrorId :
Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDisk
The error seemed similar to this one posed here however the solution provided does not configure the disk from the snapshot. Any ideas as to what could be causing the problem?
I have reproduced your issue on my side, it could be caused by the disk you specified has already been existing in the resource group, because CreationData information cannot be changed after the disk has been created, refer to this link.
At first, the command works fine.
After I creating a disk which has the same name in the portal, it gives the same error message of yours.