29.12.2013 Views

l-migrate2cloud-1-pd..

l-migrate2cloud-1-pd..

l-migrate2cloud-1-pd..

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

developerWorks®<br />

ibm.com/developerWorks<br />

Listing 2 shows a group called default with a description of "default group." The user<br />

ID associated with the group is 223110335193. There are no rules in this group. If<br />

there were, they would be described below the group with the word PERMISSION in<br />

the left column.<br />

Preparing the cloud environment<br />

The first step is to prepare the cloud environment to test the application. The new<br />

environment will mimic the current production environment.<br />

Start by launching the AMI, which has an ID of ami-10b55379. Listing 3 shows the<br />

AMI being launched and the status being checked.<br />

Listing 3. Launching the CentOS AMI<br />

[sean@sergeant:~]$ ec2-run-instances ami-10b55379 -k main<br />

RESERVATION r-750fff1e 223110335193 default<br />

INSTANCE i-75aaf41e ami-10b55379 pending main 0 m1.small<br />

2010-05-15T02:02:57+0000 us-east-1a aki-3038da59 ari-3238da5b monitoring-disabled<br />

instance-store<br />

[sean@sergeant:~]$ ec2-describe-instances i-75aaf41e<br />

RESERVATION r-750fff1e 223110335193 default<br />

i-75aaf41e ami-10b55379 pending main 0 E3D48CEE m1.small<br />

2010-05-15T02:02:57+0000 us-east-1a aki-3038da59 ari-3238da5b monitoring-disabled<br />

instance-store<br />

[sean@sergeant:~]$ ec2-describe-instances i-75aaf41e<br />

RESERVATION r-750fff1e 223110335193 default<br />

INSTANCE i-75aaf41e ami-10b55379 ec2-184-73-43-141.compute-1.amazonaws.com<br />

domU-12-31-39-00-64-71.compute-1.internal running main 0 E3D48CEE m1.small<br />

2010-05-15T02:02:57+0000 us-east-1a aki-3038da59 ari-3238da5b monitoring-disabled<br />

184.73.43.141 10.254.107.127 instance-store<br />

The first command launches the instance using the ami-10b55379 AMI and specifies<br />

that the key pair generated in Listing 1 is to be used to authenticate to the machine.<br />

The command returns several pieces of information, the most important being the<br />

instance identifier (i-750fff1e), which is the identity of the machine in the Amazon<br />

EC2 cloud. The second command uses the ec2-describe-instances<br />

command, which lists all the running instances. In Listing 3, the instance identifier<br />

has been passed on the command line to only show information about that instance.<br />

The state of the instance is listed as pending, which means that the instance is still<br />

being started. The IBM AMI is large, so it typically takes 5-10 minutes just to start.<br />

Running the same command some time later shows that the state is running and<br />

that the external IP address of 184.73.43.141 has been given. The internal IP<br />

address that starts with 10 is useful for talking within the Amazon EC2 cloud, but not<br />

now.<br />

You can then use SSH to connect to the server using the key you generated earlier.<br />

But first, you must allow SSH (22/TCP) in. Listing 4 shows how to authorize the<br />

connection and log in to your new server.<br />

Initial migration<br />

Trademarks<br />

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

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

Saved successfully!

Ooh no, something went wrong!