29.12.2013 Views

l-migrate2cloud-1-pd..

l-migrate2cloud-1-pd..

l-migrate2cloud-1-pd..

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

developerWorks®<br />

ibm.com/developerWorks<br />

Bundling an AMI is a three-step process:<br />

1. Create the image on the instance itself.<br />

2. Upload the image to Amazon S3.<br />

3. Register the AMI.<br />

Before proceeding, shut down your mongrel and PostgreSQL instances, just to<br />

make sure any open files are handled correctly. You must also copy your X.509<br />

keys, found in the Amazon Console, to /mnt on your server. Listing 12 shows the<br />

first two steps of bundling, which are done on the VM itself.<br />

Listing 12. Bundling the AMI<br />

# ec2-bundle-vol -d /mnt -e /mnt --privatekey /mnt/pk-mykey.pem \<br />

--cert /mnt/cert-mycert.pem --user 223110335193 -p centos-ertw<br />

Please specify a value for arch [i386]:<br />

Copying / into the image file /mnt/centos-ertw...<br />

...<br />

Generating digests for each part...<br />

Digests generated.<br />

Creating bundle manifest...<br />

ec2-bundle-vol complete.<br />

# ec2-upload-bundle -b ertw.com -m /mnt/centos-ertw.manifest.xml \<br />

--secret-key MYSECRETKEY --access-key MYACCESSKEY<br />

Creating bucket...<br />

Uploading bundled image parts to the S3 bucket ertw.com ...<br />

...<br />

Uploaded centos-ertw.part.37<br />

Uploading manifest ...<br />

Uploaded manifest.<br />

Bundle upload completed.<br />

The first command generates the bundle, specifying that /mnt is to be ignored and<br />

that the bundle will go in /mnt (the -e and -d options, respectively). The -k,<br />

--cert, and --user options point to your security credentials and AWS user ID,<br />

which are all found in the account settings of your AWS Management Console. The<br />

last option, -p, lets you name this AMI to differentiate it from others.<br />

The first command will run for about 10 minutes, depending on how full your root<br />

partition is. The second command uploads the bundle to Amazon S3. The -b option<br />

specifies a bucket name, which will be created if it doesn't exist already. The -m<br />

option points to the manifest file created in the last step. The last two options are<br />

your Amazon S3 credentials, which are found right next to your X.509 credentials in<br />

the AWS Management Console. Just remember that X.509 credentials are used for<br />

Amazon EC2 operations, while Amazon S3 uses text keys.<br />

Finally, run the command:<br />

Initial migration<br />

Trademarks<br />

© Copyright IBM Corporation 2010. All rights reserved. Page 16 of 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!