Create Azure image with data disks

1,275 views
Skip to first unread message

Johan

unread,
Feb 20, 2018, 3:43:49 PM2/20/18
to Packer
I am trying to provision an Azure image that requires an additional data disk.
I found a reference to this in the deprecated packer-azure project (https://github.com/Azure/packer-azure/issues/66).
I thought that the Azure builder was fully integrated with the official packerio distribution, but I can't seem to find a way to do this.

What is the best way to provision an Azure image with an additional data disk?

-Johan


Alvaro Miranda Aguilera

unread,
Feb 21, 2018, 5:54:21 AM2/21/18
to packe...@googlegroups.com
Hello

Seems packer azure only does one disk.


Don't know the reason.

If you can look around the code you may try to send a PR.

Otherwise, you can open an issue in the repo, link the back story and development will have a look, may take some time until done.

Thanks
Alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/fdecf1e2-0115-4496-adb0-29f0e6b797df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Sim

unread,
Mar 14, 2018, 8:18:55 PM3/14/18
to Packer
Hi,

I got the same problem, just wondering if anyone knows how to add more data disks to Packer image? 
I found a way to add more data disks to the Packer image (it does successfully generate the packer image at the end), but it failed when i tried to deploy the image to Azure VM.

What I did was I put some scripts to partition the OS disk into 3 disks with 2 data disks (D and G) in the Packer template. When I deployed the image to a new Azure VM, it failed with this error:
Provisioning failed. OS Provisioning for VM 'abcd1234' did not finish in the allotted time. The VM may still finish provisioning successfully. Please check provisioning state later. Also, make sure the image has been properly prepared (generalized). * Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/ * Instructions for Linux: https://azure.microsoft.com/documentation/articles/virtual-machines-linux-capture-image/. OSProvisioningTimedOut

I have checked the template again and I think the generalization was okay, no more clues to diagnose this issue. 

Is the problem because Azure could not deploy the image that got multiple partitioned data disks on the OS disk? or maybe because of something else?
Hope anyone could help me out this issue or can suggest an ultimate solution that I can add data disks in Packer build as I need to run some DSC scripts during the build which required some data disks to be pre-installed in the VM. 

Thanks, 

Johan

unread,
Mar 15, 2018, 8:33:25 PM3/15/18
to Packer
I went ahead an implemented this functionality as part of pull request 5944, which has now been merged.

You can now specify the following:
disk_additional_size
(array of integers) - The size(s) of any additional
hard disks for the VM in gigabytes. If this is not specified then the VM
will only contain an OS disk

- Johan
Reply all
Reply to author
Forward
0 new messages