UEC Configuration
Affected packages: UEC
Case ID: UEC-003
Prerequisites
Test instructions
Test Case: Run an official karmic instance
On Cloud Controller, set one of the following options depending on whether you test amd64 or i386:
ARCH=amd64 # or ARCH=i386
On Cloud Controller, set the following to use the official karmic instance
RELEASE=karmic UEC_TGZ=ubuntu-9.10-server-uec-$ARCH.tar.gz UEC_IMG=$RELEASE-server-uec-$ARCH URL=http://uec-images.ubuntu.com/releases/9.10/release TYPE=c1.medium
On Cloud Controller, run the following commands to get an instance up and running
TIMESTAMP=$(date +%Y%m%d%H%M%S) BUCKET_KERNEL="k-$TIMESTAMP" BUCKET_INITRD="r-$TIMESTAMP" BUCKET_IMAGE="i-$TIMESTAMP" [ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386 UEC_KERNEL=$UEC_IMG-vmlinuz-virtual UEC_INITRD=$UEC_IMG-initrd-virtual [ ! -e $UEC_TGZ ] && wget $URL/$UEC_TGZ # This may take a bit [ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_TGZ euca-bundle-image -i $UEC_KERNEL -r $IARCH --kernel true euca-upload-bundle -b $BUCKET_KERNEL -m /tmp/$UEC_KERNEL.manifest.xml EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI euca-bundle-image -i $UEC_INITRD -r $IARCH --ramdisk true euca-upload-bundle -b $BUCKET_INITRD -m /tmp/$UEC_INITRD.manifest.xml ERI=$(euca-register $BUCKET_INITRD/$UEC_INITRD.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI --ramdisk $ERI # This will take a long time (~10m) euca-upload-bundle -b $BUCKET_IMAGE -m /tmp/$UEC_IMG.img.manifest.xml EMI=$(euca-register $BUCKET_IMAGE/$UEC_IMG.img.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EMI if [ ! -e mykey.priv ]; then touch mykey.priv chmod 0600 mykey.priv euca-add-keypair mykey > mykey.priv fi euca-authorize default -P tcp -p 22 -s 0.0.0.0/0 INSTANCEID=$(euca-run-instances -k mykey $EMI -t $TYPE | awk '/^INSTANCE/ {print $2}') && echo $INSTANCEIDOn Cloud Controller, run the following command to watch your instance go from "pending" to "running", and ctrl-C when done:
watch -n 5 euca-describe-instances
Test instance network connectivity
On Cloud Controller, run the following commands to connect to your running instance:
IPADDR=$(euca-describe-instances | grep $INSTANCEID | grep running | awk '{print $4}') ssh -i mykey.priv ubuntu@$IPADDR
Tear down
Exit your SSH connection, then on Cloud Controller run the following commands to terminate your instance:
euca-terminate-instances $INSTANCEID
Test Case: Image Storage images
Install an image from the Image Store on the UEC web interface:
- Access the web interface at the following URL (Make sure you specify https):
https://<cloud-controller-ip-address>:8443/
- Enter your login and password (if requested, as you may still be logged in from earlier). Use username 'admin' and password 'admin' for the first time login (you will be prompted to change your password).
- Click on the Store tab
- Browse available images and select for installation the image from the latest release.
- Once the image has been downloaded and installed, you can click on 'How to run?' to view the command to execute to instantiate (start) this image.
Test Case: Round-Robin scheduling policy
- Set the scheduling policy to 'ROUNDROBIN' in '/etc/eucalyptus/eucalyptus.conf' and restart the Cloud:
sudo sed -i.bak 's/SCHEDPOLICY=.*/SCHEDPOLICY="ROUNDROBIN"/' /etc/eucalyptus/eucalyptus.conf sudo restart eucalyptus-cloud
- Start 2 instances:
euca-run-instances -k mykey $EMI -t c1.medium -n 2
- Log on the two NCs and make sure that both of them have one instance of the EMI running.
Test Case: Greedy scheduling policy
- Set the scheduling policy to 'GREEDY' in '/etc/eucalyptus/eucalyptus.conf' and restart the Cloud:
sudo sed -i.bak 's/SCHEDPOLICY=.*/SCHEDPOLICY="GREEDY"/' /etc/eucalyptus/eucalyptus.conf sudo restart eucalyptus-cloud
- Start 2 instances:
euca-run-instances -k mykey $EMI -t c1.medium -n 2
- Log on the two NCs and make sure that only one of them have the two instances of the EMI running.
Test Case: Powersave scheduling policy
- Set the scheduling policy to 'POWERSAVE' in '/etc/eucalyptus/eucalyptus.conf' and restart the Cloud:
sudo sed -i.bak 's/SCHEDPOLICY=.*/SCHEDPOLICY="POWERSAVE"/' /etc/eucalyptus/eucalyptus.conf sudo restart eucalyptus-cloud
- Start the maximum number of instances that can run on one NC:
euca-run-instances -k mykey $EMI -t c1.medium -n 2
- Log on the two NCs and make sure that only one of them have all the instances of the EMI running (NC1).
- Wait for 5 minutes (300 seconds) and check that the other NC (NC2) is powered down.
- Start a new instance:
euca-run-instances -k mykey $EMI -t c1.medium -n 1
- Check that NC2 is powered back on and it runs the new instance.
- Kill the first set of intances.
- Wait for 5 minutes (300 seconds)
- Check that the NC1 is powered down.
- Terminate all the remaining instances.
- Start one new instance.
- Check that it runs on NC2 and that NC1 is still powered down.
- Terminate all the instances
- Wait for 5 minutes.
- Check that NC2 is powered down as well.
- Start one new instance.
- Check that one and only one NC is powered back on.
- Terminate the instance
- Start the maximum number of instances that can run on both NCs.
- Check that all the NC are powered back on.
Test Case: Maximum number of instances
- Start the maximum number of instances:
euca-run-instances -k mykey $EMI -t c1.medium -n $(euca-describe-availability-zones verbose | awk '/c1.medium/ { print $6 }') - Try to start another instance:
euca-run-instances -k mykey $EMI -t c1.medium
It should fail stating that not enough resources are available. - Check that all instances have successfully started and are running:
[ $(euca-describe-instances | grep -c "^INSTANCE.*running") -eq $(euca-describe-availability-zones verbose | awk '/c1.medium/ { print $6 }') ] && echo OK...