From e45809d279865f8508aee1e9db81c5bf5c300ac1 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Mon, 2 Apr 2012 23:04:01 +0000 Subject: [PATCH 1/9] added local customizations and beginning work to get this script to work on CentOS 6.2 --- .gitignore | 4 +-- files/rpms/general | 21 ++++++++++++++++ files/rpms/glance | 9 +++++++ files/rpms/horizon | 25 +++++++++++++++++++ files/rpms/keystone | 17 +++++++++++++ files/rpms/n-api | 1 + files/rpms/n-cpu | 4 +++ files/rpms/n-novnc | 1 + files/rpms/n-vol | 2 ++ files/rpms/nova | 44 ++++++++++++++++++++++++++++++++ files/rpms/swift | 17 +++++++++++++ functions | 2 +- localrc | 6 +++++ setup-env.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++ stack.sh | 44 ++++++++++++++++---------------- stackrc | 33 ++++++++++++++++-------- 16 files changed, 255 insertions(+), 36 deletions(-) create mode 100644 files/rpms/general create mode 100644 files/rpms/glance create mode 100644 files/rpms/horizon create mode 100644 files/rpms/keystone create mode 100644 files/rpms/n-api create mode 100644 files/rpms/n-cpu create mode 100644 files/rpms/n-novnc create mode 100644 files/rpms/n-vol create mode 100644 files/rpms/nova create mode 100644 files/rpms/swift create mode 100644 localrc create mode 100755 setup-env.sh diff --git a/.gitignore b/.gitignore index c8d25605ee..4bf6fa72e0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ proto *~ *.log src -localrc -local.sh +localrc-not +local.sh-not diff --git a/files/rpms/general b/files/rpms/general new file mode 100644 index 0000000000..5e023c8e9a --- /dev/null +++ b/files/rpms/general @@ -0,0 +1,21 @@ +python-pep8 +pylint +python-pip +screen +unzip +wget +psmisc +git-core +lsof # useful when debugging +openssh-server +vim +mlocate # useful when debugging +python-virtualenv +python-unittest2 +iputils +wget +curl +tcpdump +euca2ools # only for testing client +python-pip +gcc diff --git a/files/rpms/glance b/files/rpms/glance new file mode 100644 index 0000000000..293909ef88 --- /dev/null +++ b/files/rpms/glance @@ -0,0 +1,9 @@ +python-eventlet +python-routes +python-greenlet +python-argparse # dist:oneiric +python-sqlalchemy +mod_wsgi +python-paste-deploy +python-xattr +python-iso8601 diff --git a/files/rpms/horizon b/files/rpms/horizon new file mode 100644 index 0000000000..c98771445d --- /dev/null +++ b/files/rpms/horizon @@ -0,0 +1,25 @@ +apache2 # NOPRIME +libapache2-mod-wsgi # NOPRIME +python-dateutil +python-paste +python-paste-deploy +python-anyjson +python-routes +python-xattr +python-sqlalchemy +python-webob +python-kombu +pylint +python-pep8 +python-eventlet +python-nose +python-sphinx +python-mox +python-kombu +python-coverage +python-cherrypy2 # why? +Django +python-django-mailer +python-django-nose +django-registration +python-migrate diff --git a/files/rpms/keystone b/files/rpms/keystone new file mode 100644 index 0000000000..f3de4944d9 --- /dev/null +++ b/files/rpms/keystone @@ -0,0 +1,17 @@ +python-setuptools +python-devel +python-lxml +python-paste-script +python-paste-deploy +python-paste +sqlite +python-sqlite2 +python-sqlalchemy +MySQL-python +python-webob +python-greenlet +python-routes +openldap-devel +cyrus-sasl-devel +python-bcrypt +gmp-devel diff --git a/files/rpms/n-api b/files/rpms/n-api new file mode 100644 index 0000000000..0f08daace3 --- /dev/null +++ b/files/rpms/n-api @@ -0,0 +1 @@ +python-dateutil diff --git a/files/rpms/n-cpu b/files/rpms/n-cpu new file mode 100644 index 0000000000..0efa7589fd --- /dev/null +++ b/files/rpms/n-cpu @@ -0,0 +1,4 @@ +# Stuff for diablo volumes +lvm2 +iscsi-initiator-utils +iscsi-initiator-utils diff --git a/files/rpms/n-novnc b/files/rpms/n-novnc new file mode 100644 index 0000000000..24ce15ab7e --- /dev/null +++ b/files/rpms/n-novnc @@ -0,0 +1 @@ +numpy diff --git a/files/rpms/n-vol b/files/rpms/n-vol new file mode 100644 index 0000000000..0142589a30 --- /dev/null +++ b/files/rpms/n-vol @@ -0,0 +1,2 @@ +scsi-target-utils +lvm2 diff --git a/files/rpms/nova b/files/rpms/nova new file mode 100644 index 0000000000..56f6ee3986 --- /dev/null +++ b/files/rpms/nova @@ -0,0 +1,44 @@ +dnsmasq +dnsmasq-utils # for dhcp_release only available in dist:oneiric +kpartx +parted +arping # only available in dist:natty +iputils-arping # only available in dist:oneiric +mysql-server # NOPRIME +MySQL-python +python-xattr # needed for glance which is needed for nova --- this shouldn't be here +python-lxml # needed for glance which is needed for nova --- this shouldn't be here +kvm +gawk +iptables +ebtables +sqlite +sudo +kvm +libvirt-bin # NOPRIME +vlan +curl +rabbitmq-server # NOPRIME +socat # used by ajaxterm +python-mox +python-paste +python-migrate +python-gflags +python-greenlet +libvirt-python +python-lxml +python-routes +python-netaddr +python-paste-deploy +python-eventlet +python-cheetah +python-carrot +python-tempita +python-sqlalchemy +python-suds +python-lockfile +m2crypto +python-boto +python-kombu +python-feedparser +python-iso8601 diff --git a/files/rpms/swift b/files/rpms/swift new file mode 100644 index 0000000000..a349b72bfd --- /dev/null +++ b/files/rpms/swift @@ -0,0 +1,17 @@ +curl +gcc +memcached # NOPRIME +python-configobj +python-coverage +python-devel +python-eventlet +python-greenlet +python-netifaces +python-nose +python-paste-deploy +python-setuptools +python-simplejson +python-webob +python-xattr +sqlite +xfsprogs diff --git a/functions b/functions index 75c20d7577..d40a28dce9 100644 --- a/functions +++ b/functions @@ -156,7 +156,7 @@ function pip_install { sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \ HTTP_PROXY=$http_proxy \ HTTPS_PROXY=$https_proxy \ - pip install --use-mirrors $@ + pip-python install $@ } diff --git a/localrc b/localrc new file mode 100644 index 0000000000..19656bce0b --- /dev/null +++ b/localrc @@ -0,0 +1,6 @@ +API_RATE_LIMIT=False +MYSQL_PASSWORD=pass +RABBIT_PASSWORD=pass +SERVICE_PASSWORD=pass +ADMIN_PASSWORD=pass +SERVICE_TOKEN=servicetoken diff --git a/setup-env.sh b/setup-env.sh new file mode 100755 index 0000000000..a1c5ee2c10 --- /dev/null +++ b/setup-env.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +PKGS=" git emacs-nox screen redhat-lsb python-pip " +EPEL_RPM_URL="http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm" +RPM="sudo rpm" +YUM="sudo yum " + +# +# Setup EPEL +# +$RPM -Uhv $EPEL_RPM_URL + +# +# Update the systems +# +$YUM -y upgrade + +# +# Install your custom packages and environment +# +$YUM -y install $PKGS + +( +cat < Read /etc/bashrc, if present. +fi +if [ -f /etc/bash.bashrc ]; then + . /etc/bash.bashrc # --> Read /etc/bash.bashrc, if present. +fi + +if [ -f $HOME/.bashrc ]; then + . $HOME/.bashrc # --> Read /etc/bash.bashrc, if present. +fi + +export EDITOR=emacs +export PROMPT="\u@\h \W> " +export PS1=$PROMPT + +TTY=`/usr/bin/tty` +if [ "$TTY" != "not a tty" -a "$TERM" != "screen" -a "$SHLVL" -eq 1 -a -n "$SSH_CLIENT" ]; then + screen -t `hostname` -x -RR remote +fi + +EOF +) >> ~/.bash_profile + +( +cat < ~/.screenrc + diff --git a/stack.sh b/stack.sh index ae4ee87d9a..5fe6d4eaee 100755 --- a/stack.sh +++ b/stack.sh @@ -26,13 +26,13 @@ # installation with ``FORCE=yes ./stack`` DISTRO=$(lsb_release -c -s) -if [[ ! ${DISTRO} =~ (oneiric|precise) ]]; then - echo "WARNING: this script has only been tested on oneiric" - if [[ "$FORCE" != "yes" ]]; then - echo "If you wish to run this script anyway run with FORCE=yes" - exit 1 - fi -fi +#if [[ ! ${DISTRO} =~ (oneiric|precise) ]]; then +# echo "WARNING: this script has only been tested on oneiric" +# if [[ "$FORCE" != "yes" ]]; then +# echo "If you wish to run this script anyway run with FORCE=yes" +# exit 1 +# fi +#fi # Keep track of the current devstack directory. TOP_DIR=$(cd $(dirname "$0") && pwd) @@ -107,7 +107,7 @@ if [[ $EUID -eq 0 ]]; then # since this script runs as a normal user, we need to give that user # ability to run sudo - dpkg -l sudo || apt_get update && apt_get install sudo + which sudo || yum -y update && yum -y install sudo if ! getent passwd stack >/dev/null; then echo "Creating a user called stack" @@ -133,7 +133,7 @@ if [[ $EUID -eq 0 ]]; then exit 1 else # We're not root, make sure sudo is available - dpkg -l sudo || die "Sudo is required. Re-run stack.sh as root ONE TIME ONLY to set up sudo." + which sudo || die "Sudo is required. Re-run stack.sh as root ONE TIME ONLY to set up sudo." # UEC images /etc/sudoers does not have a '#includedir'. add one. sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || @@ -588,9 +588,9 @@ function get_packages() { done } -# install apt requirements -apt_get update -apt_get install $(get_packages $FILES/apts) +# install yum requirements +sudo yum -y update +sudo yum -y install $(get_packages $FILES/rpms) # install python requirements pip_install $(get_packages $FILES/pips | sort -u) @@ -677,7 +677,7 @@ fi # ------ if [[ $SYSLOG != "False" ]]; then - apt_get install -y rsyslog-relp + yum -y install -y rsyslog-relp if [[ "$SYSLOG_HOST" = "$HOST_IP" ]]; then # Configure the master host to receive cat </tmp/90-stack-m.conf @@ -703,7 +703,7 @@ if is_service_enabled rabbit; then # Install and start rabbitmq-server # the temp file is necessary due to LP: #878600 tfile=$(mktemp) - apt_get install rabbitmq-server > "$tfile" 2>&1 + yum -y install rabbitmq-server > "$tfile" 2>&1 cat "$tfile" rm -f "$tfile" # change the rabbit password since the default is "guest" @@ -738,7 +738,7 @@ EOF fi # Install and start mysql-server - apt_get install mysql-server + yum -y install mysql-server # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases: sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASSWORD';" @@ -801,7 +801,7 @@ screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< if is_service_enabled horizon; then # Install apache2, which is NOPRIME'd - apt_get install apache2 libapache2-mod-wsgi + yum -y install apache2 libapache2-mod-wsgi # Remove stale session database. @@ -905,8 +905,8 @@ if is_service_enabled q-svc; then # Install deps # FIXME add to files/apts/quantum, but don't install if not needed! kernel_version=`cat /proc/version | cut -d " " -f3` - apt_get install linux-headers-$kernel_version - apt_get install openvswitch-switch openvswitch-datapath-dkms + yum -y install linux-headers-$kernel_version + yum -y install openvswitch-switch openvswitch-datapath-dkms # Create database for the plugin/agent if is_service_enabled mysql; then mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;' @@ -1019,7 +1019,7 @@ if is_service_enabled n-cpu; then # Virtualization Configuration # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - apt_get install libvirt-bin + yum -y install libvirt-bin # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 @@ -1043,7 +1043,7 @@ if is_service_enabled n-cpu; then # to simulate multiple systems. if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then if [[ "$DISTRO" > natty ]]; then - apt_get install cgroup-lite + yum -y install cgroup-lite else cgline="none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0" sudo mkdir -p /cgroup @@ -1113,7 +1113,7 @@ fi # Storage Service if is_service_enabled swift; then # Install memcached for swift. - apt_get install memcached + yum -y install memcached # We first do a bit of setup by creating the directories and # changing the permissions so we can run it as our user. @@ -1297,7 +1297,7 @@ if is_service_enabled n-vol; then # By default, the backing file is 2G in size, and is stored in /opt/stack. # install the package - apt_get install tgt + yum -y install tgt if ! sudo vgs $VOLUME_GROUP; then VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file} diff --git a/stackrc b/stackrc index d0fa1c25a0..17cb22252c 100644 --- a/stackrc +++ b/stackrc @@ -1,3 +1,11 @@ +# +# devstack rc file as specified in blog post +# +# http://www.joinfu.com/2012/03/testing-essex-rc1-with-devstack-and-tempest/ +# +# In addition I've added testing for Quantum and melange, whatever that is + + # Find the other rc files RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) @@ -7,11 +15,14 @@ RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) # your localrc. For example for swift you can just add this in your # localrc to add it with the other services: # ENABLED_SERVICES="$ENABLED_SERVICES,swift" -ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit +ENABLED_SERVICES=general,g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit + +# This is for more stuff that isn't tested by default +ENABLED_SERVICES="$ENABLED_SERVICES,quantum,melange" # compute service NOVA_REPO=https://github.com/openstack/nova.git -NOVA_BRANCH=master +NOVA_BRANCH=milestone-proposed # storage service SWIFT_REPO=https://github.com/openstack/swift.git @@ -23,11 +34,11 @@ SWIFT_KEYSTONE_BRANCH=master # image catalog service GLANCE_REPO=https://github.com/openstack/glance.git -GLANCE_BRANCH=master +GLANCE_BRANCH=milestone-proposed # unified auth system (manages accounts/tokens) KEYSTONE_REPO=https://github.com/openstack/keystone.git -KEYSTONE_BRANCH=master +KEYSTONE_BRANCH=milestone-proposed # a websockets/html5 or flash powered VNC console for vm instances NOVNC_REPO=https://github.com/cloudbuilders/noVNC.git @@ -35,23 +46,23 @@ NOVNC_BRANCH=master # django powered web control panel for openstack HORIZON_REPO=https://github.com/openstack/horizon.git -HORIZON_BRANCH=master +HORIZON_BRANCH=milestone-proposed # python client library to nova that horizon (and others) use NOVACLIENT_REPO=https://github.com/openstack/python-novaclient.git -NOVACLIENT_BRANCH=master +NOVACLIENT_BRANCH=milestone-proposed # python keystone client library to nova that horizon uses KEYSTONECLIENT_REPO=https://github.com/openstack/python-keystoneclient -KEYSTONECLIENT_BRANCH=master +KEYSTONECLIENT_BRANCH=milestone-proposed # quantum service QUANTUM_REPO=https://github.com/openstack/quantum -QUANTUM_BRANCH=master +QUANTUM_BRANCH=milestone-proposed # quantum client QUANTUM_CLIENT_REPO=https://github.com/openstack/python-quantumclient -QUANTUM_CLIENT_BRANCH=master +QUANTUM_CLIENT_BRANCH=milesetone-proposed # Tempest test suite TEMPEST_REPO=https://github.com/openstack/tempest.git @@ -59,11 +70,11 @@ TEMPEST_BRANCH=master # melange service MELANGE_REPO=https://github.com/openstack/melange.git -MELANGE_BRANCH=master +MELANGE_BRANCH=milesetone-proposed # python melange client library MELANGECLIENT_REPO=https://github.com/openstack/python-melangeclient.git -MELANGECLIENT_BRANCH=master +MELANGECLIENT_BRANCH=milesetone-proposed # Specify a comma-separated list of uec images to download and install into glance. # supported urls here are: From 616f7cc250eb849dee161e46a613b0ff8b8cf0a8 Mon Sep 17 00:00:00 2001 From: "Robert E. Parrott" Date: Mon, 2 Apr 2012 23:08:44 +0000 Subject: [PATCH 2/9] fix branch names --- stackrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stackrc b/stackrc index 17cb22252c..716c17a96f 100644 --- a/stackrc +++ b/stackrc @@ -62,7 +62,7 @@ QUANTUM_BRANCH=milestone-proposed # quantum client QUANTUM_CLIENT_REPO=https://github.com/openstack/python-quantumclient -QUANTUM_CLIENT_BRANCH=milesetone-proposed +QUANTUM_CLIENT_BRANCH=milestone-proposed # Tempest test suite TEMPEST_REPO=https://github.com/openstack/tempest.git @@ -70,11 +70,11 @@ TEMPEST_BRANCH=master # melange service MELANGE_REPO=https://github.com/openstack/melange.git -MELANGE_BRANCH=milesetone-proposed +MELANGE_BRANCH=milestone-proposed # python melange client library MELANGECLIENT_REPO=https://github.com/openstack/python-melangeclient.git -MELANGECLIENT_BRANCH=milesetone-proposed +MELANGECLIENT_BRANCH=milestone-proposed # Specify a comma-separated list of uec images to download and install into glance. # supported urls here are: From d4e97b4e94fea90b9b791011270ca684cc44289f Mon Sep 17 00:00:00 2001 From: "Robert E. Parrott" Date: Tue, 3 Apr 2012 03:30:07 +0000 Subject: [PATCH 3/9] nearly working now ... nova not starting due to versioning issues with paste-deploy --- files/pips/nova | 1 + files/rpms/general | 11 +++++++ files/rpms/glance | 2 +- files/rpms/horizon | 12 +++---- files/rpms/keystone | 2 +- files/rpms/nova | 5 +-- functions | 2 +- setup-env.sh | 2 +- stack.sh | 78 ++++++++++++++++++++++++++------------------- stackrc | 4 +-- 10 files changed, 73 insertions(+), 46 deletions(-) create mode 100644 files/pips/nova diff --git a/files/pips/nova b/files/pips/nova new file mode 100644 index 0000000000..dedc0029ae --- /dev/null +++ b/files/pips/nova @@ -0,0 +1 @@ +pastedeploy==1.5 diff --git a/files/rpms/general b/files/rpms/general index 5e023c8e9a..be902c7032 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -19,3 +19,14 @@ tcpdump euca2ools # only for testing client python-pip gcc + +python-distutils-extra +bpython +python-novaclient +python-prettytable +python-greenlet +python-eventlet +python-passlib +python-sqlalchemy0.7 +python-nose1.1 +python-webob1.0 diff --git a/files/rpms/glance b/files/rpms/glance index 293909ef88..2d90dd1e64 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -2,7 +2,7 @@ python-eventlet python-routes python-greenlet python-argparse # dist:oneiric -python-sqlalchemy +python-sqlalchemy0.7 mod_wsgi python-paste-deploy python-xattr diff --git a/files/rpms/horizon b/files/rpms/horizon index c98771445d..b21f16d68a 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -6,20 +6,20 @@ python-paste-deploy python-anyjson python-routes python-xattr -python-sqlalchemy +python-sqlalchemy0.7 python-webob python-kombu pylint python-pep8 python-eventlet -python-nose +python-nose1.1 python-sphinx python-mox python-kombu python-coverage python-cherrypy2 # why? -Django -python-django-mailer -python-django-nose -django-registration +#Django +#python-django-mailer +#python-django-nose +#django-registration python-migrate diff --git a/files/rpms/keystone b/files/rpms/keystone index f3de4944d9..98044f6117 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -6,7 +6,7 @@ python-paste-deploy python-paste sqlite python-sqlite2 -python-sqlalchemy +python-sqlalchemy0.7 MySQL-python python-webob python-greenlet diff --git a/files/rpms/nova b/files/rpms/nova index 56f6ee3986..c8fe66625e 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -16,7 +16,8 @@ sqlite sudo kvm libvirt-bin # NOPRIME -vlan +#vlan +bridge-utils curl rabbitmq-server # NOPRIME socat # used by ajaxterm @@ -34,7 +35,7 @@ python-eventlet python-cheetah python-carrot python-tempita -python-sqlalchemy +python-sqlalchemy0.7 python-suds python-lockfile m2crypto diff --git a/functions b/functions index d40a28dce9..46aef4c0fa 100644 --- a/functions +++ b/functions @@ -156,7 +156,7 @@ function pip_install { sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \ HTTP_PROXY=$http_proxy \ HTTPS_PROXY=$https_proxy \ - pip-python install $@ + pip-python install --upgrade $@ } diff --git a/setup-env.sh b/setup-env.sh index a1c5ee2c10..b050fd8385 100755 --- a/setup-env.sh +++ b/setup-env.sh @@ -1,6 +1,6 @@ #!/bin/bash -PKGS=" git emacs-nox screen redhat-lsb python-pip " +PKGS=" git emacs-nox screen redhat-lsb python-pip telnet bash-completion " EPEL_RPM_URL="http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm" RPM="sudo rpm" YUM="sudo yum " diff --git a/stack.sh b/stack.sh index 5fe6d4eaee..143f0f4e19 100755 --- a/stack.sh +++ b/stack.sh @@ -18,6 +18,9 @@ # Learn more and get the most recent version at http://devstack.org +UPDATE="sudo yum -y update" +INSTALL="sudo yum -y install" +SERVICE="sudo /sbin/service" # Sanity Check # ============ @@ -107,7 +110,7 @@ if [[ $EUID -eq 0 ]]; then # since this script runs as a normal user, we need to give that user # ability to run sudo - which sudo || yum -y update && yum -y install sudo + which sudo || $UPDATE && $INSTALL sudo if ! getent passwd stack >/dev/null; then echo "Creating a user called stack" @@ -589,8 +592,8 @@ function get_packages() { } # install yum requirements -sudo yum -y update -sudo yum -y install $(get_packages $FILES/rpms) +$UPDATE +$INSTALL $(get_packages $FILES/rpms) # install python requirements pip_install $(get_packages $FILES/pips | sort -u) @@ -677,7 +680,7 @@ fi # ------ if [[ $SYSLOG != "False" ]]; then - yum -y install -y rsyslog-relp + $INSTALL -y rsyslog-relp if [[ "$SYSLOG_HOST" = "$HOST_IP" ]]; then # Configure the master host to receive cat </tmp/90-stack-m.conf @@ -692,7 +695,7 @@ EOF EOF sudo mv /tmp/90-stack-s.conf /etc/rsyslog.d fi - sudo /usr/sbin/service rsyslog restart + $SERVICE rsyslog restart fi @@ -703,11 +706,15 @@ if is_service_enabled rabbit; then # Install and start rabbitmq-server # the temp file is necessary due to LP: #878600 tfile=$(mktemp) - yum -y install rabbitmq-server > "$tfile" 2>&1 + $INSTALL rabbitmq-server > "$tfile" 2>&1 cat "$tfile" rm -f "$tfile" + # Start the server first + $SERVICE rabbitmq-server start + sudo chkconfig rabbitmq-server on + # change the rabbit password since the default is "guest" - sudo rabbitmqctl change_password guest $RABBIT_PASSWORD + sudo rabbitmqctl change_password guest $RABBIT_PASSWORD fi @@ -718,11 +725,11 @@ if is_service_enabled mysql; then # Seed configuration with mysql password so that apt-get install doesn't # prompt us for a password upon install. - cat <%n%f* %t%{-}%+Lw%< if is_service_enabled horizon; then # Install apache2, which is NOPRIME'd - yum -y install apache2 libapache2-mod-wsgi - + $INSTALL httpd mod_wsgi mod_ssl # Remove stale session database. rm -f $HORIZON_DIR/openstack_dashboard/local/dashboard_openstack.sqlite3 @@ -820,13 +832,14 @@ if is_service_enabled horizon; then sudo mkdir -p $HORIZON_DIR/.blackhole ## Configure apache's 000-default to run horizon - sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default + HTTPD_CONF=/etc/httpd/conf.d/000-default + sudo cp $FILES/000-default.template $HTTPD_CONF sudo sed -e " s,%USER%,$APACHE_USER,g; s,%GROUP%,$APACHE_GROUP,g; s,%HORIZON_DIR%,$HORIZON_DIR,g; - " -i /etc/apache2/sites-enabled/000-default - sudo service apache2 restart + " -i $HTTPD_CONF + $SERVICE httpd restart fi @@ -905,8 +918,8 @@ if is_service_enabled q-svc; then # Install deps # FIXME add to files/apts/quantum, but don't install if not needed! kernel_version=`cat /proc/version | cut -d " " -f3` - yum -y install linux-headers-$kernel_version - yum -y install openvswitch-switch openvswitch-datapath-dkms + $INSTALL linux-headers-$kernel_version + $INSTALL openvswitch-switch openvswitch-datapath-dkms # Create database for the plugin/agent if is_service_enabled mysql; then mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;' @@ -1019,7 +1032,7 @@ if is_service_enabled n-cpu; then # Virtualization Configuration # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - yum -y install libvirt-bin + $INSTALL libvirt-client # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 @@ -1043,7 +1056,7 @@ if is_service_enabled n-cpu; then # to simulate multiple systems. if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then if [[ "$DISTRO" > natty ]]; then - yum -y install cgroup-lite + $INSTALL cgroup-lite else cgline="none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0" sudo mkdir -p /cgroup @@ -1058,12 +1071,13 @@ if is_service_enabled n-cpu; then # The user that nova runs as needs to be member of libvirtd group otherwise # nova-compute will be unable to use libvirt. - sudo usermod -a -G libvirtd `whoami` + sudo usermod -a -G qemu `whoami` + # libvirt detects various settings on startup, as we potentially changed # the system configuration (modules, filesystems), we need to restart # libvirt to detect those changes. - sudo /etc/init.d/libvirt-bin restart - + #sudo /etc/init.d/libvirt-bin restart + $SERVICE libvirt-guests restart # Instance Storage # ~~~~~~~~~~~~~~~~ @@ -1297,7 +1311,7 @@ if is_service_enabled n-vol; then # By default, the backing file is 2G in size, and is stored in /opt/stack. # install the package - yum -y install tgt + $INSTALL scsi-target-utils if ! sudo vgs $VOLUME_GROUP; then VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file} @@ -1323,8 +1337,8 @@ if is_service_enabled n-vol; then # tgt in oneiric doesn't restart properly if tgtd isn't running # do it in two steps - sudo stop tgt || true - sudo start tgt + $SERVICE tgtd stop || true + $SERVICE tgtd start fi NOVA_CONF=nova.conf diff --git a/stackrc b/stackrc index 716c17a96f..1d8286618f 100644 --- a/stackrc +++ b/stackrc @@ -70,11 +70,11 @@ TEMPEST_BRANCH=master # melange service MELANGE_REPO=https://github.com/openstack/melange.git -MELANGE_BRANCH=milestone-proposed +MELANGE_BRANCH=master # python melange client library MELANGECLIENT_REPO=https://github.com/openstack/python-melangeclient.git -MELANGECLIENT_BRANCH=milestone-proposed +MELANGECLIENT_BRANCH=master # Specify a comma-separated list of uec images to download and install into glance. # supported urls here are: From 76c7413588831056abdf057558c3320e276a4bef Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Tue, 3 Apr 2012 21:56:45 +0000 Subject: [PATCH 4/9] got to first mostly running version. Various changes to stack.sh rearding ubuntu->centos and package lists --- README-SEAS.txt | 4 ++++ files/pips/nova | 2 +- files/rpms/glance | 2 +- files/rpms/horizon | 2 +- files/rpms/keystone | 4 ++-- files/rpms/nova | 2 +- files/rpms/swift | 2 +- stack.sh | 37 +++++++++++++++++++++++++++++++------ stackrc | 3 ++- 9 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 README-SEAS.txt diff --git a/README-SEAS.txt b/README-SEAS.txt new file mode 100644 index 0000000000..884356bbcb --- /dev/null +++ b/README-SEAS.txt @@ -0,0 +1,4 @@ +Running in EC2, we're using AMI "ami-3ecd1e57", a CentOS 6.2 64-bit image. + +Using "OpenStack" security group, with a "m1.small" image size. + diff --git a/files/pips/nova b/files/pips/nova index dedc0029ae..12a9470f0a 100644 --- a/files/pips/nova +++ b/files/pips/nova @@ -1 +1 @@ -pastedeploy==1.5 +pastedeploy diff --git a/files/rpms/glance b/files/rpms/glance index 2d90dd1e64..52daf516a7 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -4,6 +4,6 @@ python-greenlet python-argparse # dist:oneiric python-sqlalchemy0.7 mod_wsgi -python-paste-deploy +#python-paste-deploy python-xattr python-iso8601 diff --git a/files/rpms/horizon b/files/rpms/horizon index b21f16d68a..897d4073c0 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -2,7 +2,7 @@ apache2 # NOPRIME libapache2-mod-wsgi # NOPRIME python-dateutil python-paste -python-paste-deploy +#python-paste-deploy python-anyjson python-routes python-xattr diff --git a/files/rpms/keystone b/files/rpms/keystone index 98044f6117..0709866ca2 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -1,8 +1,8 @@ python-setuptools python-devel python-lxml -python-paste-script -python-paste-deploy +#python-paste-script +#python-paste-deploy python-paste sqlite python-sqlite2 diff --git a/files/rpms/nova b/files/rpms/nova index c8fe66625e..c17899106b 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -30,7 +30,7 @@ libvirt-python python-lxml python-routes python-netaddr -python-paste-deploy +#python-paste-deploy python-eventlet python-cheetah python-carrot diff --git a/files/rpms/swift b/files/rpms/swift index a349b72bfd..447e9a465e 100644 --- a/files/rpms/swift +++ b/files/rpms/swift @@ -8,7 +8,7 @@ python-eventlet python-greenlet python-netifaces python-nose -python-paste-deploy +#python-paste-deploy python-setuptools python-simplejson python-webob diff --git a/stack.sh b/stack.sh index 143f0f4e19..b0fce355aa 100755 --- a/stack.sh +++ b/stack.sh @@ -89,6 +89,20 @@ source ./stackrc # Destination path for installation ``DEST`` DEST=${DEST:-/opt/stack} +# Set the destination directories for openstack projects +NOVA_DIR=$DEST/nova +HORIZON_DIR=$DEST/horizon +GLANCE_DIR=$DEST/glance +KEYSTONE_DIR=$DEST/keystone +NOVACLIENT_DIR=$DEST/python-novaclient +KEYSTONECLIENT_DIR=$DEST/python-keystoneclient +NOVNC_DIR=$DEST/noVNC +SWIFT_DIR=$DEST/swift +QUANTUM_DIR=$DEST/quantum +QUANTUM_CLIENT_DIR=$DEST/python-quantumclient +MELANGE_DIR=$DEST/melange +MELANGECLIENT_DIR=$DEST/python-melangeclient + # Check to see if we are already running a stack.sh if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].stack"; then echo "You are already running a stack.sh session." @@ -151,7 +165,7 @@ else # Set up the rootwrap sudoers TEMPFILE=`mktemp` - echo "$USER ALL=(root) NOPASSWD: /usr/local/bin/nova-rootwrap" >$TEMPFILE + echo "$USER ALL=(root) NOPASSWD: ${NOVA_DIR}/bin/nova-rootwrap" >$TEMPFILE chmod 0440 $TEMPFILE sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/nova-rootwrap @@ -918,8 +932,19 @@ if is_service_enabled q-svc; then # Install deps # FIXME add to files/apts/quantum, but don't install if not needed! kernel_version=`cat /proc/version | cut -d " " -f3` - $INSTALL linux-headers-$kernel_version - $INSTALL openvswitch-switch openvswitch-datapath-dkms + $INSTALL rpm-build openssl-devel + +# $INSTALL linux-headers-$kernel_version +# $INSTALL openvswitch-switch openvswitch-datapath-dkms + + # Build openvswitch RPMS from source + mkdir -p ~/rpmbuild/SOURCES + cd ~/rpmbuild/SOURCES + wget http://openvswitch.org/releases/openvswitch-1.3.0.tar.gz + tar xzvf openvswitch-1.3.0.tar.gz + rpmbuild -bb openvswitch-1.3.0/rhel/openvswitch.spec + rpmbuild -bb openvswitch-1.3.0/rhel/ + # Create database for the plugin/agent if is_service_enabled mysql; then mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;' @@ -1282,7 +1307,7 @@ if is_service_enabled swift; then } && popd >/dev/null - sudo chmod +x /usr/local/bin/swift-* + sudo chmod +x ${SWIFT_DIR}/bin/swift-* # We then can start rsync. sudo /etc/init.d/rsync restart || : @@ -1355,7 +1380,7 @@ add_nova_opt "[DEFAULT]" add_nova_opt "verbose=True" add_nova_opt "auth_strategy=keystone" add_nova_opt "allow_resize_to_same_host=True" -add_nova_opt "root_helper=sudo /usr/local/bin/nova-rootwrap" +add_nova_opt "root_helper=sudo ${NOVA_DIR}/bin/nova-rootwrap" add_nova_opt "compute_scheduler_driver=$SCHEDULER" add_nova_opt "dhcpbridge_flagfile=$NOVA_CONF_DIR/$NOVA_CONF" add_nova_opt "fixed_range=$FIXED_RANGE" @@ -1623,7 +1648,7 @@ screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler" screen_it n-novnc "cd $NOVNC_DIR && ./utils/nova-novncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF --web ." screen_it n-xvnc "cd $NOVA_DIR && ./bin/nova-xvpvncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF" screen_it n-cauth "cd $NOVA_DIR && ./bin/nova-consoleauth" -screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/apache2/error.log" +screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/httpd/*log" screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_LOCATION}/proxy-server.conf -v" # Starting the nova-objectstore only if swift service is not enabled. diff --git a/stackrc b/stackrc index 1d8286618f..ce8f166ce5 100644 --- a/stackrc +++ b/stackrc @@ -18,7 +18,8 @@ RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) ENABLED_SERVICES=general,g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit # This is for more stuff that isn't tested by default -ENABLED_SERVICES="$ENABLED_SERVICES,quantum,melange" +#ENABLED_SERVICES="$ENABLED_SERVICES,q-svc,q-agt,quantum,m-svc,melange" +ENABLED_SERVICES="$ENABLED_SERVICES,m-svc,melange" # compute service NOVA_REPO=https://github.com/openstack/nova.git From d5e8d6bc7a8ed0555d97f0f38fba18f660d2b985 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Tue, 3 Apr 2012 23:14:12 +0000 Subject: [PATCH 5/9] fixed web app and libvirt security ... still outstanding issue about emulator --- files/000-default.template | 18 ++++++++++++++---- stack.sh | 13 ++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/files/000-default.template b/files/000-default.template index f499ea073b..4b98159778 100644 --- a/files/000-default.template +++ b/files/000-default.template @@ -1,4 +1,14 @@ - +LoadModule wsgi_module modules/mod_wsgi.so +LoadModule rewrite_module modules/mod_rewrite.so + +WSGISocketPrefix /var/run/wsgi + +# + + RewriteEngine On + RewriteCond %{HTTPS} off + RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + WSGIScriptAlias / %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10 SetEnv APACHE_RUN_USER %USER% @@ -21,8 +31,8 @@ allow from all - ErrorLog /var/log/apache2/error.log + ErrorLog /var/log/httpd/error_log LogLevel warn - CustomLog /var/log/apache2/access.log combined - + CustomLog /var/log/httpd/horizon_log combined +# diff --git a/stack.sh b/stack.sh index b0fce355aa..7f47b2b381 100755 --- a/stack.sh +++ b/stack.sh @@ -846,7 +846,7 @@ if is_service_enabled horizon; then sudo mkdir -p $HORIZON_DIR/.blackhole ## Configure apache's 000-default to run horizon - HTTPD_CONF=/etc/httpd/conf.d/000-default + HTTPD_CONF=/etc/httpd/conf.d/horizon.conf sudo cp $FILES/000-default.template $HTTPD_CONF sudo sed -e " s,%USER%,$APACHE_USER,g; @@ -1057,7 +1057,7 @@ if is_service_enabled n-cpu; then # Virtualization Configuration # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - $INSTALL libvirt-client + $INSTALL libvirt libvirt-client # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 @@ -1096,13 +1096,16 @@ if is_service_enabled n-cpu; then # The user that nova runs as needs to be member of libvirtd group otherwise # nova-compute will be unable to use libvirt. - sudo usermod -a -G qemu `whoami` + sudo groupadd libvirt + sudo echo "unix_sock_group=\"libvirt\"" >> /etc/libvirt/libvirtd.conf + sudo usermod -a -G libvirt `whoami` # libvirt detects various settings on startup, as we potentially changed # the system configuration (modules, filesystems), we need to restart # libvirt to detect those changes. #sudo /etc/init.d/libvirt-bin restart - $SERVICE libvirt-guests restart + $SERVICE libvirtd restart + $SERVICE libvirt-guests restart # Instance Storage # ~~~~~~~~~~~~~~~~ @@ -1640,7 +1643,7 @@ fi # within the context of our original shell (so our groups won't be updated). # Use 'sg' to execute nova-compute as a member of the libvirtd group. # We don't check for is_service_enable as screen_it does it for us -screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_DIR/bin/nova-compute" +screen_it n-cpu "cd $NOVA_DIR && sg libvirt $NOVA_DIR/bin/nova-compute" screen_it n-crt "cd $NOVA_DIR && $NOVA_DIR/bin/nova-cert" screen_it n-vol "cd $NOVA_DIR && $NOVA_DIR/bin/nova-volume" screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network" From 7062401ac22f81ed49615a17cac10fdb43713332 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 4 Apr 2012 17:03:49 +0000 Subject: [PATCH 6/9] can now fire up VMs using qemu, and connect via VNC (after fudging the server IPs on EC2) --- files/libvirtd.conf | 5 +++++ files/seas.repo | 20 ++++++++++++++++++++ setup-env.sh | 17 +++++++++++++---- stack.sh | 43 +++++++++++++++++++++++++++++++------------ stackrc | 2 ++ 5 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 files/libvirtd.conf create mode 100644 files/seas.repo diff --git a/files/libvirtd.conf b/files/libvirtd.conf new file mode 100644 index 0000000000..d6107f7c07 --- /dev/null +++ b/files/libvirtd.conf @@ -0,0 +1,5 @@ +auth_unix_ro="none" +auth_unix_rw="none" +unix_sock_group="libvirt" +unix_sock_rw_perms="0770" + diff --git a/files/seas.repo b/files/seas.repo new file mode 100644 index 0000000000..fe65d72d4a --- /dev/null +++ b/files/seas.repo @@ -0,0 +1,20 @@ +[seas-stable] +name=Stable SEAS Linux Packages for Enterprise Linux $releasever - $basearch +baseurl=http://linux.seas.harvard.edu/seas/$releasever/stable/$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-SEAS-6 + +[seas-testing] +name=In-Testing SEAS Linux Packages for Enterprise Linux $releasever - $basearch +baseurl=http://linux.seas.harvard.edu/seas/$releasever/testing/$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-SEAS-6 + +[seas-unstable] +name=Unstable SEAS Linux Packages for Enterprise Linux $releasever - $basearch +baseurl=http://linux.seas.harvard.edu/seas/$releasever/unstable/$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-SEAS-6 \ No newline at end of file diff --git a/setup-env.sh b/setup-env.sh index b050fd8385..0384d928a5 100755 --- a/setup-env.sh +++ b/setup-env.sh @@ -2,6 +2,7 @@ PKGS=" git emacs-nox screen redhat-lsb python-pip telnet bash-completion " EPEL_RPM_URL="http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm" +REPOFORGE_RPM_URL="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm" RPM="sudo rpm" YUM="sudo yum " @@ -9,6 +10,7 @@ YUM="sudo yum " # Setup EPEL # $RPM -Uhv $EPEL_RPM_URL +$RPM -Uhv $REPOFORGE_RPM_URL # # Update the systems @@ -37,10 +39,10 @@ export EDITOR=emacs export PROMPT="\u@\h \W> " export PS1=$PROMPT -TTY=`/usr/bin/tty` -if [ "$TTY" != "not a tty" -a "$TERM" != "screen" -a "$SHLVL" -eq 1 -a -n "$SSH_CLIENT" ]; then - screen -t `hostname` -x -RR remote -fi +#TTY=`/usr/bin/tty` +#if [ "$TTY" != "not a tty" -a "$TERM" != "screen" -a "$SHLVL" -eq 1 -a -n "$SSH_CLIENT" ]; then +# screen -t `hostname` -x -RR remote +#fi EOF ) >> ~/.bash_profile @@ -59,3 +61,10 @@ cat < ~/.screenrc + + +# +# Setup the ephemeral storage as the target for openstack +# +sudo mkdir -p /media/ephemeral0/stack +sudo ln -s /media/ephemeral0/stack /opt/stack diff --git a/stack.sh b/stack.sh index 7f47b2b381..944c5e7112 100755 --- a/stack.sh +++ b/stack.sh @@ -53,6 +53,24 @@ if [ ! -d $FILES ]; then exit 1 fi +# +# Install some RPM repos as needed: EPEL, RPMFORGE but only for qemu-system-x86(_64), +# and the SEAS repo for openvswitch +# +EPEL_RPM_URL="http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm" +REPOFORGE_RPM_URL="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm" +SEAS_REPO_URL="http://linux.seas.harvard.edu/seas/6/" +RPM="sudo rpm" + +$RPM -Uhv $EPEL_RPM_URL +$RPM -Uhv $REPOFORGE_RPM_URL + +# Disable RPMFORGE +sudo perl -i -p -e 's/enabled = 1/enabled = 0/g' /etc/yum.repos.d/rpmforge.repo + +# Copy over the SEAS repo +sudo cp $TOP_DIR/files/seas.repo /etc/yum.repos.d/ +$RPM --import ${SEAS_REPO_URL}/RPM-GPG-KEY-SEAS-6 # Settings # ======== @@ -932,19 +950,10 @@ if is_service_enabled q-svc; then # Install deps # FIXME add to files/apts/quantum, but don't install if not needed! kernel_version=`cat /proc/version | cut -d " " -f3` - $INSTALL rpm-build openssl-devel # $INSTALL linux-headers-$kernel_version -# $INSTALL openvswitch-switch openvswitch-datapath-dkms + $INSTALL --enablerepo=seas-testing --enablerepo=seas-stable openvswitch - # Build openvswitch RPMS from source - mkdir -p ~/rpmbuild/SOURCES - cd ~/rpmbuild/SOURCES - wget http://openvswitch.org/releases/openvswitch-1.3.0.tar.gz - tar xzvf openvswitch-1.3.0.tar.gz - rpmbuild -bb openvswitch-1.3.0/rhel/openvswitch.spec - rpmbuild -bb openvswitch-1.3.0/rhel/ - # Create database for the plugin/agent if is_service_enabled mysql; then mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;' @@ -1059,6 +1068,14 @@ if is_service_enabled n-cpu; then # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $INSTALL libvirt libvirt-client + # This package comes from repoforge: + # + # http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm + # + # and is required to run on EC2 in emulated mode (provides qemu-system-x86_64) + # + $INSTALL --enablerepo=rpmforge --enablerepo=rpmforge-extras qemu || true + # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 @@ -1096,9 +1113,11 @@ if is_service_enabled n-cpu; then # The user that nova runs as needs to be member of libvirtd group otherwise # nova-compute will be unable to use libvirt. - sudo groupadd libvirt - sudo echo "unix_sock_group=\"libvirt\"" >> /etc/libvirt/libvirtd.conf + sudo groupadd libvirt || true sudo usermod -a -G libvirt `whoami` + sudo mv /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig || true + sudo cp $FILES/libvirtd.conf /etc/libvirt/libvirtd.conf + # libvirt detects various settings on startup, as we potentially changed # the system configuration (modules, filesystems), we need to restart diff --git a/stackrc b/stackrc index ce8f166ce5..a453f8137c 100644 --- a/stackrc +++ b/stackrc @@ -99,6 +99,8 @@ case "$LIBVIRT_TYPE" in IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz";; esac +IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz,http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" + # allow local overrides of env variables if [ -f $RC_DIR/localrc ]; then source $RC_DIR/localrc From 032d357e0c889ff4cb8f2095cf240230fc453807 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 4 Apr 2012 18:55:19 +0000 Subject: [PATCH 7/9] pull an ubuntu image as well --- stackrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stackrc b/stackrc index a453f8137c..8f795d7fea 100644 --- a/stackrc +++ b/stackrc @@ -99,7 +99,9 @@ case "$LIBVIRT_TYPE" in IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz";; esac -IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz,http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" +IMAGE_URLS="http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" +IMAGE_URLS="${IMAGE_URLS},http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz" +IMAGE_URLS="${IMAGE_URLS},http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-armel-disk1.img" # allow local overrides of env variables if [ -f $RC_DIR/localrc ]; then From dd60101a9dae194d31c9fd8c5b672f31fc0a4720 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 4 Apr 2012 21:38:22 +0000 Subject: [PATCH 8/9] now sets up a mostly working instance. Quantum still not functional --- files/pips/glance | 1 + files/pips/horizon | 1 + files/pips/keystone | 1 + files/pips/nova | 1 + files/rpms/glance | 2 +- files/rpms/horizon | 2 +- files/rpms/keystone | 2 +- files/rpms/nova | 2 +- setup-env.sh | 2 +- 9 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 files/pips/glance diff --git a/files/pips/glance b/files/pips/glance new file mode 100644 index 0000000000..5e4d623dbd --- /dev/null +++ b/files/pips/glance @@ -0,0 +1 @@ +routes diff --git a/files/pips/horizon b/files/pips/horizon index f15602e95b..8b03b38872 100644 --- a/files/pips/horizon +++ b/files/pips/horizon @@ -1,3 +1,4 @@ django-nose-selenium pycrypto==2.3 python-cloudfiles +routes diff --git a/files/pips/keystone b/files/pips/keystone index 09636e4991..fc6899f972 100644 --- a/files/pips/keystone +++ b/files/pips/keystone @@ -1 +1,2 @@ PassLib +routes diff --git a/files/pips/nova b/files/pips/nova index 12a9470f0a..cb30ab2e11 100644 --- a/files/pips/nova +++ b/files/pips/nova @@ -1 +1,2 @@ pastedeploy +routes diff --git a/files/rpms/glance b/files/rpms/glance index 52daf516a7..465d521973 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -1,5 +1,5 @@ python-eventlet -python-routes +#python-routes python-greenlet python-argparse # dist:oneiric python-sqlalchemy0.7 diff --git a/files/rpms/horizon b/files/rpms/horizon index 897d4073c0..b2bafcef3f 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -4,7 +4,7 @@ python-dateutil python-paste #python-paste-deploy python-anyjson -python-routes +#python-routes python-xattr python-sqlalchemy0.7 python-webob diff --git a/files/rpms/keystone b/files/rpms/keystone index 0709866ca2..a11e7369f6 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -10,7 +10,7 @@ python-sqlalchemy0.7 MySQL-python python-webob python-greenlet -python-routes +#python-routes openldap-devel cyrus-sasl-devel python-bcrypt diff --git a/files/rpms/nova b/files/rpms/nova index c17899106b..a51868ccb7 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -28,7 +28,7 @@ python-gflags python-greenlet libvirt-python python-lxml -python-routes +#python-routes python-netaddr #python-paste-deploy python-eventlet diff --git a/setup-env.sh b/setup-env.sh index 0384d928a5..ffde83b96a 100755 --- a/setup-env.sh +++ b/setup-env.sh @@ -67,4 +67,4 @@ EOF # Setup the ephemeral storage as the target for openstack # sudo mkdir -p /media/ephemeral0/stack -sudo ln -s /media/ephemeral0/stack /opt/stack +sudo ln -s /media/ephemeral0/stack /opt/ From 24bd338945bb8558b7053b3e4a0257a7a5c41066 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 4 Apr 2012 22:22:53 +0000 Subject: [PATCH 9/9] finalized merging of changes from vendor --- functions | 49 ++++++++++++++++++++++++++++++++++++++++++++----- stack.sh | 23 +++++++++++------------ 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/functions b/functions index c7f4a3e5c3..e66bddae9d 100644 --- a/functions +++ b/functions @@ -255,6 +255,18 @@ function install_package() { fi } +# Distro-agnostic package installer +# update_packages +function update_packages() { + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + if [[ "$os_PACKAGE" = "deb" ]]; then + apt_get update + else + sudo yum -y update + fi +} # Test if the named environment variable is set and not zero length # is_set env-var @@ -282,29 +294,56 @@ function pip_install { sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \ HTTP_PROXY=$http_proxy \ HTTPS_PROXY=$https_proxy \ -# pip-python install --upgrade $@ - $CMD_PIP install --use-mirrors $@ + $CMD_PIP install --upgrade $@ } # Service wrapper to restart services # restart_service service-name function restart_service() { - sudo /usr/sbin/service $1 restart + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + if [[ "$os_PACKAGE" = "deb" ]]; then + SERVICE=/usr/sbin/service + else + SERVICE=/sbin/service + fi + + + sudo $SERVICE $1 restart } # Service wrapper to start services # start_service service-name function start_service() { - sudo /usr/sbin/service $1 start + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + if [[ "$os_PACKAGE" = "deb" ]]; then + SERVICE=/usr/sbin/service + else + SERVICE=/sbin/service + fi + sudo $SERVICE $1 start } # Service wrapper to stop services # stop_service service-name function stop_service() { - sudo /usr/sbin/service $1 stop + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + if [[ "$os_PACKAGE" = "deb" ]]; then + SERVICE=/usr/sbin/service + else + SERVICE=/sbin/service + fi + + sudo $SERVICE $1 stop + } diff --git a/stack.sh b/stack.sh index 59b11a24c4..58bcc6f139 100755 --- a/stack.sh +++ b/stack.sh @@ -18,9 +18,9 @@ # Learn more and get the most recent version at http://devstack.org -UPDATE="sudo yum -y update" -INSTALL="sudo yum -y install" -SERVICE="sudo /sbin/service" +#UPDATE="sudo yum -y update" +#INSTALL="sudo yum -y install" +#SERVICE="sudo /sbin/service" # Sanity Check # ============ @@ -751,11 +751,11 @@ if is_service_enabled rabbit; then cat "$tfile" rm -f "$tfile" # Start the server first - $SERVICE rabbitmq-server start + start_service rabbitmq-server sudo chkconfig rabbitmq-server on # change the rabbit password since the default is "guest" - sudo rabbitmqctl change_password guest $RABBIT_PASSWORD + sudo rabbitmqctl change_password guest $RABBIT_PASSWORD fi @@ -788,7 +788,7 @@ EOF # Install and start mysql-server install_package mysql-server - $SERVICE mysqld restart + restart_service mysqld sudo chkconfig mysqld on # Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service: @@ -965,7 +965,7 @@ if is_service_enabled q-svc; then # FIXME add to files/apts/quantum, but don't install if not needed! kernel_version=`cat /proc/version | cut -d " " -f3` - #$INSTALL linux-headers-$kernel_version + #install_package linux-headers-$kernel_version install_package --enablerepo=seas-testing --enablerepo=seas-stable openvswitch #install_package openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version @@ -1093,15 +1093,13 @@ if is_service_enabled n-cpu; then install_package libvirt libvirt-client # install_package libvirt-bin - $INSTALL libvirt libvirt-client - # This package comes from repoforge: # # http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm # # and is required to run on EC2 in emulated mode (provides qemu-system-x86_64) # - $INSTALL --enablerepo=rpmforge --enablerepo=rpmforge-extras qemu || true + install_package --enablerepo=rpmforge --enablerepo=rpmforge-extras qemu || true # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 @@ -1387,6 +1385,7 @@ if is_service_enabled n-vol; then # install the package install_package scsi-target-utils + start_service tgtd if ! sudo vgs $VOLUME_GROUP; then VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file} @@ -1412,8 +1411,8 @@ if is_service_enabled n-vol; then # tgt in oneiric doesn't restart properly if tgtd isn't running # do it in two steps - $SERVICE tgtd stop || true - $SERVICE tgtd start + stop_service tgtd || true + start_service tgtd fi NOVA_CONF=nova.conf