Azure-Samples / Azure-Samples/managed-disks-powershell-getting-started

issue when creating vm from snapshot

Open
#5 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
29
Forks
34
PR merge metrics
No merged PRs in 30d

Description

PS C:\Windows\system32> $snapshot = Get-AzureRmSnapshot
PS C:\Windows\system32> $resourceGroupName ='prod'
PS C:\Windows\system32> $snapshotName = 'vm3copy'
PS C:\Windows\system32> $osDiskName = 'myvm3disk'
PS C:\Windows\system32> $virtualNetworkName = 'prod-vnet'
PS C:\Windows\system32> $virtualMachineName = 'myVM3'
PS C:\Windows\system32> $virtualMachineSize = 'Standard_DS3'
PS C:\Windows\system32> $snapshot = Get-AzureRmSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
PS C:\Windows\system32> $diskConfig = New-AzureRmDiskConfig -AccountType $storageType -Location $snapshot.Location -SourceResourceId $snapshot.Id -CreateOption Copy
**PS C:\Windows\system32> $disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $osDiskName**
New-AzureRmDisk : The request content was invalid and could not be deserialized: Required property 'name' not found in 'sku'.
ErrorCode: InvalidRequestContent
ErrorMessage: The request content was invalid and could not be deserialized: Required property 'name' not found in 'sku'.
ErrorTarget:
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : 78d284c4-7180-47c0-a808-907519b9827b
At line:1 char:9
+ $disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmDisk], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDisk

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the New-AzureRmDisk invocation and the preceding New-AzureRmDiskConfig commands shown in the issue. Inspect the resulting disk configuration and Azure request requirements, then reproduce the command and confirm it completes without the InvalidRequestContent error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.