Azure / Azure/azure-quickstart-templates

Error creating Vm with custom source image and custom vhd storage location

Open
#3,114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

Hi all,

I have created different VMs without problems using the azure template of vm with custom image, but when I looked where the VM creates the VHD I saw it was saved on the storage where the custom image is located. Looking the api (sdk-for-net) I saw that actually I could define where the image can be (I tested too), but when I use these sequence I am getting Error:

```

"storageProfile": {
"osDisk": {
"name": "vmssosdisk",
"caching": "ReadOnly",
"createOption": "FromImage",
"image": {
"uri": "[parameters('sourceImageVhdUri')]"
},
"vhd": {
"uri": "[concat('https://', variables('differentStorageAccountName'),'.blob.core.windows.net/oshardos.vhd')]"
}
}
}
```

### Error

```
{
"status": "Failed",
"error": {
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.",
"details": [
{
"code": "BadRequest",
"message": "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"target\": \"osDisk.vhd\",\r\n \"message\": \"Parameter 'osDisk.vhd' is not allowed.\"\r\n }\r\n}"
}
]
}
}
```
**Parameter 'osDisk.vhd' is not allowed.**

Is there some way how I could define where the VM store the vhd?

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Azure VM template and the storageProfile.osDisk configuration shown in the report; trace how the custom image and VHD fields are handled during deployment. Reproduce the InvalidParameter response and determine whether the template supports a separate VHD location, then document the confirmed behavior or required change.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.