You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Peter Jönsson <pe...@klarna.com> on 2014/03/31 21:41:28 UTC

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 <Br...@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 <pe...@klarna.com>
> Date: 2014-01-25 09:43:55 +0000
> To: users@cloudstack.apache.org <us...@cloudstack.apache.org>,
> peter.joensson@gmail.com <pe...@gmail.com>,
> users@cloudstack.apache.org <us...@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)
>
>
>
>

Re: packer for building cloudstack templates

Posted by Peter Jönsson <pe...@klarna.com>.
Is it possible for you to share a log-file when running with PACKER_LOG=foo
packer build <template.json> ? I have an idea what the problem could be but
without logs it's kind of hard :)

Strange, by default if there is no ssh_key_path a key pair should be
created in cloudstack and we should use the public part to logon to the
machine that was started.


On Mon, Mar 31, 2014 at 11:07 PM, Brian Galura <Br...@citrix.com>wrote:

> 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.jonsson@klarna.com]
> Sent: Monday, March 31, 2014 12:41 PM
> To: users@cloudstack.apache.org
> Cc: peter.joensson@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.Galura@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 <pe...@klarna.com>
> > Date: 2014-01-25 09:43:55 +0000
> > To: users@cloudstack.apache.org <us...@cloudstack.apache.org>,
> > peter.joensson@gmail.com <pe...@gmail.com>,
> > users@cloudstack.apache.org <us...@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)
> >
> >
> >
> >
>

RE: packer for building cloudstack templates

Posted by Brian Galura <Br...@citrix.com>.
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.jonsson@klarna.com] 
Sent: Monday, March 31, 2014 12:41 PM
To: users@cloudstack.apache.org
Cc: peter.joensson@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 <Br...@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 <pe...@klarna.com>
> Date: 2014-01-25 09:43:55 +0000
> To: users@cloudstack.apache.org <us...@cloudstack.apache.org>, 
> peter.joensson@gmail.com <pe...@gmail.com>, 
> users@cloudstack.apache.org <us...@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)
>
>
>
>

Re: packer for building cloudstack templates

Posted by Peter Jönsson <pe...@klarna.com>.
Thanks, I will take a look. In our test cloud where I tested this we run
only HTTP. We are however setting up a new cloud where we have HTTPS so it
would be good to fix this of course :-)

// Peter
On Apr 1, 2014 12:35 AM, "Erik Weber" <te...@gmail.com> wrote:

> Interesting!
>
> Initial testing gives me a SSL verification error. I have no idea on how to
> manipulate the Go CA store, any chance for an option to make it ignore
> validation?
>
> Can post the exact error tomorrow.
>
> --
> Erik Weber
>
>
> On Mon, Mar 31, 2014 at 9:41 PM, Peter Jönsson <peter.jonsson@klarna.com
> >wrote:
>
> > 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.Galura@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 <pe...@klarna.com>
> > > Date: 2014-01-25 09:43:55 +0000
> > > To: users@cloudstack.apache.org <us...@cloudstack.apache.org>,
> > > peter.joensson@gmail.com <pe...@gmail.com>,
> > > users@cloudstack.apache.org <us...@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)
> > >
> > >
> > >
> > >
> >
>

Re: packer for building cloudstack templates

Posted by Peter Jönsson <pe...@klarna.com>.
Hi!

I patched my library to support ignoring the certificate chain. If you do a

$ make get-ups
$ make

in the packer-directory you should get the latest version. Then you need to set the following value in the *.json-file:

insecure_skip_verify = true

Note: I haven’t tested this yet, but it _should_ work. 

If you like we can move the discussion off the list as well :)

// peter

On 1 Apr 2014 at 00:35:51, Erik Weber (terbolous@gmail.com) wrote:

Interesting!  

Initial testing gives me a SSL verification error. I have no idea on how to  
manipulate the Go CA store, any chance for an option to make it ignore  
validation?  

Can post the exact error tomorrow.  

--  
Erik Weber  


On Mon, Mar 31, 2014 at 9:41 PM, Peter Jönsson <pe...@klarna.com>wrote:  

> 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.Galura@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 <pe...@klarna.com>  
> > Date: 2014-01-25 09:43:55 +0000  
> > To: users@cloudstack.apache.org <us...@cloudstack.apache.org>,  
> > peter.joensson@gmail.com <pe...@gmail.com>,  
> > users@cloudstack.apache.org <us...@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)  
> >  
> >  
> >  
> >  
>  

Re: packer for building cloudstack templates

Posted by Erik Weber <te...@gmail.com>.
Interesting!

Initial testing gives me a SSL verification error. I have no idea on how to
manipulate the Go CA store, any chance for an option to make it ignore
validation?

Can post the exact error tomorrow.

-- 
Erik Weber


On Mon, Mar 31, 2014 at 9:41 PM, Peter Jönsson <pe...@klarna.com>wrote:

> 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.Galura@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 <pe...@klarna.com>
> > Date: 2014-01-25 09:43:55 +0000
> > To: users@cloudstack.apache.org <us...@cloudstack.apache.org>,
> > peter.joensson@gmail.com <pe...@gmail.com>,
> > users@cloudstack.apache.org <us...@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)
> >
> >
> >
> >
>