JamesBranam's Blog

Friday Jun 05, 2009

AWS Experience Part 8: Bundling OpenSolaris

Hi all,

I created the perfect AMI: OpenSolaris with JDK, Ant, MySQl 5 and GlassFish. And then it turns out that OpenSolaris has different directions for bundling than Linux. It took me a while to find them, but I did. Here they are (I'll skip the pre-bundling cleaning up):

  1. Connect to the OpenSolaris instance in the same way as Linux (SSH).
  2. Execute the following commands: cd /mnt and /opt/ec2/sbin/rebundle.sh -v your-bundle.img. Note: of course you can name the bundle whatever you want.
  3. Get some coffee. This could take a while.
  4. Set the following environment variables:
    • export BUCKET=<bucket-name>
    • export JAVA_HOME=/usr/jdk/latest
    • export EC2_HOME=/opt/ec2
    • export PATH=$PATH:$EC2_HOME/bin
    • export RUBYLIB=$EC2_HOME/lib
    • export EC2_URL=https://ec2.amazonaws.com
    • export EC2_PRIVATE_KEY=/mnt/keys/<PRIVATE KEY FILE>
    • export EC2_CERT=/mnt/keys/<CERT FILE>
    • export EC2_KEYID=<AWS-personal-key>
    • export EC2_KEY=<AWS-secret-key>
    • export DIRECTORY=/mnt
    • export IMAGE=your-bundle.img
  5. Create the parts and keys directories inside the /mnt directory. Here's how:
    • mkdir $DIRECTORY/parts
    • mkdir $DIRECTORY/keys
  6. Copy your private key file to the /mnt/keys directory on the AMI.
    • scp -i /*.pem root@:/mnt/keys/
  7. In the AMI, bundle the image. ec2-bundle-image -c $EC2_CERT -k $EC2_PRIVATE_KEY --kernel aki-6552b60c --ramdisk ari-6452b60d --block-device-mapping "root=rpool/52@0,ami=0,ephemeral0=1" --user <AWS-acct-no> --arch i386 -i $DIRECTORY/$IMAGE -d $DIRECTORY/parts
  8. Get some more coffee... or maybe something stronger.
This is taking too long. It's getting late. I'll try again from home (maybe I'll leave my computer on all night).

Cheers!

--James

Comments:

Post a Comment:
Comments are closed for this entry.

Calendar

Feeds

Search

Links

Navigation

Referrers