Packer: vsphere-iso builder deploy multiple disks?

70 views
Skip to first unread message

Raj Wurttemberg

unread,
Apr 12, 2020, 12:55:19 PM4/12/20
to Packer
I'm trying to get Packer (1.5.5) to deploy multiple disks for a specialized (USGCB compliant) template and I need it to have four separate disks. I'm using the vsphere-iso builder. The "disk_size" parameter deploys the root drive fine. I found the 'storage' parameter which I think is used to deploy the other disks...

storage ([]DiskConfig) - A collection of one or more disks to be provisioned along with the VM

But I can't seem to figure out the format that the data needs to be in - in the json file. I tried...

"storage": [
   {
   "storage[0]": "20673",
   "storage[1]": "16384",
   "storage[2]": "4096"
   }
 ]

and

"storage": [
   {
   "20673",
   "16384",
   "4096"
   }
 ]

but none of those worked. I can't find anything in the vsphere-iso builder documentation about DiskConfig either.

Thanks,
/Raj W.

Alvaro Miranda Aguilera

unread,
Apr 16, 2020, 1:13:21 PM4/16/20
to packe...@googlegroups.com

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/8bd4caa8-a3ff-4585-8cb4-cbe789380f17%40googlegroups.com.


--
Alvaro

B Baijnauth

unread,
Apr 24, 2020, 9:51:23 AM4/24/20
to Packer
Alvaro,

I attempted to setup my template like your example but I get the error: * unknown configuration key: "storage"; raws is []interface.

My template looks like:

         "storage":[
           {
             "disk_controller_type":"pvscsi",
             "disk_size":"{{user `disk_size`}}",
             "disk_thin_provisioned":true
           },
           {
             "disk_controller_type":"pvscsi",
             "disk_size":"{{user `disk_size`}}",
             "disk_thin_provisioned":true
           },
           {
             "disk_controller_type":"pvscsi",
             "disk_size":"{{user `disk_size`}}",
             "disk_thin_provisioned":true
           }
         ],
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.


--
Alvaro

Message has been deleted

B Baijnauth

unread,
May 6, 2020, 12:09:33 PM5/6/20
to Packer
All,

The issue occurred because I was using a version of Packer that didn't support this parameter. I updated from 1.5.4 to 1.5.6 and it worked.
Reply all
Reply to author
Forward
0 new messages