Hi, I am using packer with azure-arm template to build up managed images and store them in Share Image Gallery or Azure Compute Gallery.
While creating the temporary vm resource, I am getting below error. Below error is related to OS Disk type which is by default picking Premium SSD type while that has been disallowed by our team so it’s failing like below.
==> azure-arm: Validating deployment template …
==> azure-arm: → ResourceGroupName : ‘packer-rg-bo’
==> azure-arm: → DeploymentName : ‘pkrdpu4fs7gzjif’
==> azure-arm: Deploying deployment template …
==> azure-arm: → ResourceGroupName : ‘packer-rg-bo’
==> azure-arm: → DeploymentName : ‘pkrdpu4fs7gzjif’
==> azure-arm: Code=“DeploymentFailed” Message=“At least one resource deployment operation failed. Please list deployment operations for details. Please see Deployment history - Azure Resource Manager | Microsoft Learn for usage details.” Details=[{“code”:“Conflict”,“message”:“{\r\n "status": "Failed",\r\n "error": {\r\n "code": "ResourceDeploymentFailure",\r\n "message": "The resource operation completed with terminal provisioning state ‘Failed’.",\r\n "details": [\r\n {\r\n "code": "RequestDisallowedByPolicy",\r\n "message": "Resource ‘pkrosu4fs7gzjif’ was disallowed by policy. Reasons: ‘INFORMATION : THE USE OF PREMIUM SSD IS DENIED. PLEASE ENSURE THAT ON DISKS TAB EITHER STANDARD HDD OR STANDARD SSD IS SELECTED OR DEPLOYMENT MAY FAIL.\nPLEASE READ DEP DOCUMENTATION FOR MORE INFORMATION’. See error details for policy resource IDs. Target: ‘/subscriptions/xxxxxxxxxxxx/resourceGroups/packer-rg-bo/providers/Microsoft.Compute/disks/pkrosu4fs7gzjif’."\r\n }\r\n ]\r\n }\r\n}”}]
==> azure-arm:
==> azure-arm: Deleting individual resources …
==> azure-arm: Could not retrieve OS Image details: unable to obtain a OS disk for “slazpckrbo01”, please check that the instance has been created
Kindly suggest us any option parameter to using in builders section or packer-nft.json to choose Standard HDD as OS Disk type.
You could try ‘managed_image_storage_account_type’ but might be just the captured image (since default seems to be ‘Standard_LRS’). Description is a bit unclear to me.
Hi, I have already tried ‘managed_image_storage_account_type’ option but that didn’t worked for me.
Actually the first step when Packer tries to create a temporary VM resource then it selects OS Disk type as Premium SSD by default. So, I want this option to be Standard_HDD, basically I’m looking out for a parameter which I can add/pass in my config “builders” section of my “packer-nft.json” file such that it creates a temporary Packer VM with basic disk type.
Please let me know if still something is unclear. I’ll try to explain more.
For reference when creating a VM on Azure then once we proceed ahead with Disks then it provides a drop down menu with OS disk type as “Standard HDD, Standard SSD, Premium SSD” and you will notice that Azure by default creates Premium SSD disk type VM but we can choose Standard HDD there manually. Similarly, I want such behavior in Packer configuration.
Is there any chance to avoid this error and make the temporary VM with standard OS disk type always instead of primary. I don’t know why it is trying to create VM with OS disk type Primary SSD.