hashicorp / hashicorp/packer-plugin-azure
[azure-arm] Allow specifying azure availability zone in the packer template
- Dominant language
- Go
- Stars
- 63
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @miketimofeev as hashicorp/packer#10648. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._
#### Community Note
Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
#### Description
Recently we've started experiencing issues during VM creation in Azure without specifying availability zone:
`azure-arm: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidTemplateDeployment" Message="The template deployment failed with error: 'The resource with id: '/subscriptions/***/resourceGroups/99275_ubuntu1604/providers/Microsoft.Compute/virtualMachines/pkrvmkeubkm2jhf' failed validation with message: 'The requested size for resource '/subscriptions/***/resourceGroups/99275_ubuntu1604/providers/Microsoft.Compute/virtualMachines/pkrvmkeubkm2jhf' is currently not available in location '***' zones '' for subscription '***'. Please try another size or deploy to a different location or zones. See https://aka.ms/azureskunotavailable for details.'.'."`
The same happens when trying to create VM through the Azure portal with the following settings:

However, VM creates just fine using any available zone:

In the azure deploying template it looks like this:
```
"zones": [
"[parameters('zone')]"
]
```
Unfortunately, we can't find such parameter in packer templates so our VM generation is blocked and we're trying to solve the issue through Azure support.
#### Use Case(s)
See above
#### Potential configuration
```
"type": "azure-arm",
"location": "westus2",
"az": "1",
```
#### Potential References
Contributor guide
Research direction
No source files or tests are named. Start by locating the azure-arm template handling and Azure deployment generation, then compare the proposed "az" setting with the deployment's zones parameter. Done means a configured availability zone is accepted and used during VM creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100