Permalink
Browse files

UCS stuff

  • Loading branch information...
1 parent 0893580 commit dcb5c12b84b4ea15b71072bb51773eaf1b6c9277 Andrey Brindeyev committed Dec 8, 2010
Showing with 72 additions and 0 deletions.
  1. +27 −0 cleanup.sh
  2. +3 −0 getmyip.sh
  3. +42 −0 runit.sh
View
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+DB_NAME=nova
+DB_USER=nova
+DB_PASS=nova
+CC_HOST=
+PWD=nova
+ETH=eth0
+
+CC_HOST=`./getmyip.sh $ETH`
+HOSTS='gd-1 gd-2 gd-3 gd-4'
+
+for service in api compute objectstore scheduler network; do service openstack-nova-$service stop; done
+
+mysqladmin -uroot -p$PWD -f drop nova
+mysqladmin -uroot -p$PWD create nova
+rm -f /var/log/nova/nova*log
+
+for h in $HOSTS localhost; do
+ echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'$h' IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql
+done
+echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql
+echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO root IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql
+
+for service in api compute objectstore scheduler network; do service openstack-nova-$service start; done
+
+#rm -fr images
View
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ip addr show dev $1|grep 'inet '|perl -pi -e 's/^.*inet ([0-9\.]+).*$/$1/'
View
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+USER=admin
+PROJECT=admin
+NETWORK="192.168.0.0/16"
+NETWORKS_NUM=1
+ADDR_PER_NETWORK=16
+
+TMPDIR=`mktemp -d`
+
+nova-manage user admin $USER
+nova-manage project create $PROJECT $USER
+nova-manage network create $NETWORK $NETWORKS_NUM $ADDR_PER_NETWORK
+nova-manage project zip $PROJECT $USER $TMPFILE $TMPDIR/nova_creds.zip
+
+CDIR=`pwd`
+cd $TMPDIR || exit -1
+unzip nova_creds.zip
+source novarc
+
+cd $CDIR
+#tar zxf images.tgz
+
+euca-bundle-image -i images/aki-lucid/image -p kernel --kernel true
+euca-bundle-image -i images/ari-lucid/image -p ramdisk --ramdisk true
+euca-upload-bundle -m /tmp/kernel.manifest.xml -b mybucket
+euca-upload-bundle -m /tmp/ramdisk.manifest.xml -b mybucket
+AMI_KERNEL=`euca-register mybucket/kernel.manifest.xml | perl -pi -e 's/^IMAGE\s+//'`
+AMI_RAMDISK=`euca-register mybucket/ramdisk.manifest.xml | perl -pi -e 's/^IMAGE\s+//'`
+euca-bundle-image -i images/ami-tiny/image -p machine --kernel $AMI_KERNEL --ramdisk $AMI_RAMDISK
+euca-upload-bundle -m /tmp/machine.manifest.xml -b mybucket
+AMI_MACHINE=`euca-register mybucket/machine.manifest.xml | perl -pi -e 's/^IMAGE\s+//'`
+
+cd $TMPDIR || exit -1
+euca-add-keypair mykey > mykey.priv
+chmod 600 mykey.priv
+
+euca-run-instances $AMI_MACHINE --kernel $AMI_KERNEL --ramdisk $AMI_RAMDISK -k mykey
+euca-describe-instances
+sleep 2
+euca-describe-instances
+cat /var/log/nova/nova-compute.log

0 comments on commit dcb5c12

Please sign in to comment.