I have built this and started testing. I had to dissect the code a bit to get a working set of json for input. Initially I found that if ssh_key_path isn't a real file the process exits immediately with a success message but nothing happens
{ "builders": [ { "type": "cloudstack", "api_url": "https://server/client/api", "api_key": "***", "secret": "***", "ssh_timeout": "60s", "state_timeout": "100s", "ssh_username": "root", "ssh_port": 22, "ssh_key_path": "id_rsa", "http_directory": "http", "service_offering_id": "46446411-f9ab-4856-a046-087dc115ee30", "template_id": "83ca136a-f8c8-4063-812b-378b6ac9246d", "zone_id": "912e5efc-cc9a-4386-9b55-d438274b9b30", "network_ids": [ "2c5b96ce-2666-467c-88c4-d0a0575d20ca" ], "disk_offering_id": "eca03965-d10e-4b36-b6c4-e697ede7d136", "user_data": "testingsadfasd", "template_name": "test", "template_display_text": "test", "template_os_id": 1 } ] } -----Original Message----- From: Peter Jönsson [mailto:peter.jons...@klarna.com] Sent: Monday, March 31, 2014 12:41 PM To: users@cloudstack.apache.org Cc: peter.joens...@gmail.com Subject: Re: packer for building cloudstack templates Hi all! Sorry for resurrecting this ancient thread. My pull request for packer has been lingering a quite some time now. It would be great if the Cloudstack community could help out with testing a bit more. This however requires that you install go and build a customer packer-version off the pull-request from github. Note that this requires golang 1.2, git, hg and bzr installed. You should be able to do that using your OS packager (yum,apt-get, brew, etc). When you have those tools installed the following commands you get you going: export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH mkdir -p $GOPATH go get github.com/mitchellh/packer # build download, build and install the master version of packer into $GOPATH/bin cd $GOPATH/src/github.com/mitchellh/packer/ git fetch origin refs/pull/922/head && git checkout FETCH_HEAD # will download the HEAD of the latest version of pull request and check it out make # will compile packer with cloudstack support and install into $GOPATH/bin When building templates it's a good idea to set the PACKER_LOG variable (to anything expect an empty string) to see the actual printouts. This will help in debugging any eventual problems/bugs. I'll send some examples of configuration json-files tomorrow. Thanks :) // peter On Sat, Jan 25, 2014 at 11:54 PM, Brian Galura <brian.gal...@citrix.com>wrote: > It's great to see progress in adding support to Packer I will test it > as soon as it's available. > > But what do people do today? Is there a way to convert an ovf to vhd > for example? I would be surprised if everyone creates templates by hand. > > > Sent from Citrix WorxMail for iPhone > > > ________________________________ > > From: Peter Jönsson <peter.jons...@klarna.com> > Date: 2014-01-25 09:43:55 +0000 > To: users@cloudstack.apache.org <users@cloudstack.apache.org>, > peter.joens...@gmail.com <peter.joens...@gmail.com>, > users@cloudstack.apache.org <users@cloudstack.apache.org> > Subject: Re: packer for building cloudstack templates > > Hi! > > As my library for talking to cloudstack (gopherstack) wasn't ideal I > have been waiting for a new variant. It was release yesterday: > https://github.com/svanharmelen/gocs . > > I will take a look at this library and perhaps, if it is good, port > over my updates to packer to talk to this library. Then hopefully I > can clean up my changes and send a pull request to upstream packer. > > In general the approach we take for templates is to built them from > scratch. That means PXE booting the instance, downloading > kernel/initrd from a net boot server, then finally starting the > OS-installation through kickstart. With packer this can be 100% > automated via a special iPXE-ISO which will chain load off the user data > attached to the VM instance. > > - Build custom iPXE with simple embedded boot script: > > #!pxe > dhcp > chain http://${dhcp-server}/latest/userdata > > - Boot up VM with user data attached with enough information to > continue the boot, e.g. > > "#!ipxe\nkernel http://netboot/centos/6.3/x86_64/vmlinuz ks= > http://netboot/ks.cfg\ninitrd > http://netboot/centos/6.3/x86_64/initrd.img\nboot" > > - After kickstart is completed we reboot the instance and continue > setting it up using packer provisioning scripts. > > Things become slightly easier when only performing incremental > template updates. But then someone need to create the initial template of > course. > > // Peter > > > On Saturday 25 January 2014 at 09:38, Prasanna Santhanam wrote: > > > On Sat, Jan 25, 2014 at 03:43:07AM +0000, Brian Galura wrote: > > > At my company we use packer to build ec2 images and really like it. > > > I would like to use it for cloudstack also. > > > > > > I found this: https://github.com/vogxn/packer-builtin > > > > > > Which appears to be a centos6 image builder for cloudstack but it > > > lacks instructions to convert the resultant image into something I > > > can import to cloudstack. > > > > > > Has anyone successfully done this? > > > > > > How do you build cloudstack templates? > > > > Hi Brian, > > > > That repo only contains a test builtin I was trying to build using > > packer. Peter Jonsson is working on a cloudstack builder for packer > > and announced about this last week. > > > > Peter's repo is here: > > https://github.com/mindjiver/packer > > > > You will need go to run the packer src and setup the cloudstack > > builder > > > > $ make updatedeps > > $ make > > > > -- > > Prasanna., > > > > ------------------------ > > Powered by BigRock.com (http://BigRock.com) > > > >