Packer azure-arm plugin does not expose knob for setting OS disk performance tier
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, 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
When creating a VM, Azure assigns the VM's OS disk a default performance tier based on the configured size of the disk in GiB (rounded down to the closest power of 2).
For particularly small disks (e.g. 32 gb) the default performance tier can provide minimal throughput / IOPS, which can result in very long-winded packer build operations (e.g. rsync'ing lots of files around).
Ideally packer would expose a simple field, e.g. os_disk_performance_tier, alongside the current os_disk_size_gb field, to support manually bumping the performance specs of the deployed OS disk without having to increase the final image artifact size.
As a workaround we have been bumping the OS disk's performance tier via the azure CLI as an additional shell provisioner step once the VM is created, however, this is a control plane operation and as such can take anywhere from 5 minutes to 1 hour to complete based on regional disk system load. Azure support has confirmed that creating the VM with the desired performance tier will result in the provisioned IOPS being available immediately as an alternative.
Use Case(s)
Creating small packer images on top of Azure premium SSDs that require lots of file operations during the build process.
Potential configuration
Add new field for azure-arm plugin:
os_disk_performance_tier: P30
Potential References
- https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types#premium-ssd-size
- https://developer.hashicorp.com/packer/integrations/hashicorp/azure/latest/components/builder/arm
- https://learn.microsoft.com/en-us/azure/virtual-machines/disks-change-performance
- https://learn.microsoft.com/en-us/azure/virtual-machines/disks-performance-tiers?tabs=azure-cli
I put together a version of this that we've verified is working against my fork in https://github.com/jmomort/packer-plugin-azure/pull/1. I'm not sure if this is the approach hashicorp would want to take but I'll comment here for it as a proposal.
Acknowledging that it's written by Devin. I reviewed the code and it works.