~~NOTOC~~
Scaling out Computing Clusters to EC2
lgonzalez@machine:bin$ ec2-describe-images
IMAGE ami-e4a94d8d one-w2/image.manifest.xml 587384515363 available private i386 machine
IMAGE ami-cdb054a4 sge-dolphin/image.manifest.xml 587384515363 available private i386 machine
IMAGE ami-d8b753b1 sge-parrot/image.manifest.xml 587384515363 available private i386 machine
IMAGE ami-dcb054b5 sge-squirrel/image.manifest.xml 587384515363 available private i386 machine
And we chose the last image **ami-dcb054b5**, you can configure the ONE-EC2-template as following:
CPU=1
MEMORY=1700
EC2=[ AMI="ami-dcb054b5", KEYPAIR="gsg-keypair", ELASTICIP="75.101.155.97", INSTANCETYPE="m1.small", AUTHORIZED_PORTS="22-25"]
REQUIREMENTS = 'HOSTNAME = "ec2"'
The ELASTICIP, INSTANCETYPE and AUTHORIZED_PORTS are optional.
====== Deploy and Testing ======
To start the testing all of this, start OpenNebula and add the ec2 host with:
lgonzalez@machine:one$ one start
oned and scheduler started
lgonzalez@machine:one$ onehost create ec2 im_ec2 vmm_ec2
lgonzalez@machine:one$ onehost list
HID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT
0 ec2 0 0 100 on
submit the created ec2 template to initiate a ec2 instance like this:
lgonzalez@machine:one$ onevm create ec2.template
ID: 0
later the scheduler will deploy the machine on the ec2
lgonzalez@machine:one$ onevm list
ID NAME STAT CPU MEM HOSTNAME TIME
0 one-0 pend 0 0 00 00:00:05
lgonzalez@machine:one$ onevm list
ID NAME STAT CPU MEM HOSTNAME TIME
0 one-0 boot 0 0 ec2 00 00:00:15
And then you can see more detailed information (like IP address of this machine):
lgonzalez@machine:one$ onevm show 0
VID : 0
AID : -1
TID : -1
UID : 0
STATE : ACTIVE
LCM STATE : RUNNING
DEPLOY ID : i-1d04d674
MEMORY : 0
CPU : 0
PRIORITY : -2147483648
RESCHEDULE : 0
LAST RESCHEDULE: 0
LAST POLL : 1216647834
START TIME : 07/21 15:42:47
STOP TIME : 01/01 01:00:00
NET TX : 0
NET RX : 0
....: Template :....
CPU : 1
EC2 : AMI=ami-dcb054b5,AUTHORIZED_PORTS=22-25,ELASTICIP=75.101.155.97,INSTANCETYPE=m1.small,KEYPAIR=gsg-keypair
IP : ec2-75-101-155-97.compute-1.amazonaws.com
MEMORY : 1700
NAME : one-0
REQUIREMENTS : HOSTNAME = "ec2"
In this case is IP assigned ec2-75-101-155-97.compute-1.amazonaws.com.
Now we check that the machines are running in our cluster, we have one machine running locally from our Xen resources (local01) and one machine runnining in EC2 (workernode0).
oneserver:~# qstat -f
queuename qtype used/tot. load_avg arch states
----------------------------------------------------------------------------
all.q@local01 BIP 0/1 0.05 lx24-x86
----------------------------------------------------------------------------
all.q@workernode0 BIP 0/1 0.04 lx24-x86
----------------------------------------------------------------------------
To test the cluster, submit some jobs to SGE via //**qsub
oneserver:~# su - nistest
oneserver:~# qsub test_1.sh; qsub test_2.sh;
Now we see how jobs are scheduled and launched into our hybrid cluster.
nistest@oneserver:~$ qstat -f
queuename qtype used/tot. load_avg arch states
----------------------------------------------------------------------------
all.q@local01 BIP 0/1 0.02 lx24-x86
----------------------------------------------------------------------------
all.q@workernode0 BIP 0/1 0.01 lx24-x86
----------------------------------------------------------------------------
############################################################################
- PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS
############################################################################
1180 0.00000 test_1.sh nistest qw 07/21/2008 15:26:09 1
1181 0.00000 test_2.sh nistest qw 07/21/2008 15:26:09 1
nistest@oneserver:~$ qstat -f
queuename qtype used/tot. load_avg arch states
----------------------------------------------------------------------------
all.q@local01 BIP 1/1 0.02 lx24-x86
1181 0.55500 test_2.sh nistest r 07/21/2008 15:26:20 1
----------------------------------------------------------------------------
all.q@workernode0 BIP 1/1 0.07 lx24-x86
1180 0.55500 test_1.sh nistest r 07/21/2008 15:26:20 1
----------------------------------------------------------------------------
The interesting parameter here is the scalability provided by EC2, since you can launch any number of instances on EC2, and add them as working nodes into your SGE Virtual Private Cluster managed by OpenNebula.