How to create multiple disks using vmware-iso

1,690 views
Skip to first unread message

Avi Tal

unread,
Sep 2, 2014, 3:46:49 AM9/2/14
to packe...@googlegroups.com
Hey all,
I am new to packer and it looks like a great platform for provisioning tasks in dev ops.
I was wondering if it is possible to build a VMX out of ISO with more then one disk and give different size to each?

This is a deal breaker for me since the basic VM configuration in our product is two disks.

Appreciate your help

Thanks

Alvaro Miranda Aguilera

unread,
Sep 2, 2014, 5:34:25 AM9/2/14
to packe...@googlegroups.com
Hello, I am not a vmware guy, so please forgive that the instructions aren't complete.

packer vmware-iso by default will use a hardcoded vmx file, that you can see here:


what you can do is take that file, and create one with the additional disks you required

then you can instruct packer to use that vmx file to create the vm.

then you can specify this vmx file with this:

vmx_template_path (string) - Path to a configuration templatethat defines the contents of the virtual machine VMX file for VMware. This is for advanced users only as this can render the virtual machine non-functional. See below for more information. 


Hope this helps,
Alvaro.


--
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.
For more options, visit https://groups.google.com/d/optout.

Pierre Klovsjö

unread,
Sep 2, 2014, 7:34:26 AM9/2/14
to packe...@googlegroups.com
Hello,

I did once a hack in order to get this to work. Mostly to see if it could be done as i was in your situation.

What i did was that i dowloaded the source code, made some modifications and recompiled.

If this is something that you really need i could share the Doc that i created? But then again, it would be your private version of Packer running...

Regards,

Pierre

Alvaro Miranda Aguilera

unread,
Sep 2, 2014, 7:57:31 PM9/2/14
to packe...@googlegroups.com
hello

check the end of this this template

seems you can write the vmx in the template

https://github.com/dougm/packer-ttylinux/blob/master/template.json

Pierre Klovsjö

unread,
Sep 3, 2014, 1:48:28 AM9/3/14
to packe...@googlegroups.com
Hello Alvaro,

I would be looking for what in the template? As to my knowledge Packer only creates one vmdk thereof changing the source code?!
If this could be done without such an ugly hack i am all ears.

Regards,
Pierre

Alvaro Miranda Aguilera

unread,
Sep 3, 2014, 4:20:15 AM9/3/14
to packe...@googlegroups.com
check this link


what ever you changed in that hack, should be able to put in this format


can you send to me what changes you did?

since I believe should be matter to write here disk 1 and disk 2

or disk 2 and see if packer add disk 1 

"vmx_data": {
"ethernet0.networkName": "VM Network",
"memsize": "32",
"numvcpus": "1",
"cpuid.coresPerSocket": "1",
"ide0:0.fileName": "ttylinux.vmdk",
"ide0:0.present": "TRUE",
"ide0:0.redo": "",
"scsi0:0.present": "FALSE"
}


--

Pierre Klovsjö

unread,
Sep 3, 2014, 5:48:49 AM9/3/14
to packe...@googlegroups.com
Alvaro,

That is exactly what i did in the beginning. Created a dummy VM with more disks etc. used this .vmx file as template.

But then i figureed out that the way Packer functions the build process only creates one vmdk regardless of adding more disks.

My 'hack' consists in setting up a GO environment as mentioned in Mitchell H's git page, cloning Packer, adding addtional lines into a few source files, recompile and try it out !


Regards,
Pierre

Alvaro Miranda Aguilera

unread,
Sep 3, 2014, 5:59:42 PM9/3/14
to packe...@googlegroups.com
if you send me the vmx file or changes, I will like to give it a try.

:)

Avi Tal

unread,
Sep 4, 2014, 4:40:34 PM9/4/14
to packe...@googlegroups.com
I have also found out that editing the vmx isn't enough because some internal GO code responsible to create only one disk hard coded.
We are working to solve it and compile locally.

If you could send us the changes in GO you have done in order to make it work I'll be very thankful.

BTW, I really think that having multiple disks is IMPORTANT for the relevance of packer. I my case it is blocker!
I would expect packer dev to add even a naive design of multiple disks (with the same configurations).

Thanks
Reply all
Reply to author
Forward
0 new messages