diff --git a/tools/openstack b/tools/openstack index 8d2a419e6..626ae65d6 100755 --- a/tools/openstack +++ b/tools/openstack @@ -53,10 +53,18 @@ then echo "status - show service status for all required OpenStack services" fi -OS_SERVICES=(qpidd mysqld openstack-keystone tgtd openstack-glance-api openstack-glance-registry openstack-nova-api openstack-nova-objectstore openstack-nova-compute openstack-nova-network openstack-nova-scheduler openstack-nova-cert $VOLUME_SERVICE-volume) -if [[ $VOLUME_SERVICE == "openstack-cinder" ]]; then - OS_SERVICES+=($VOLUME_SERVICE-api $VOLUME_SERVICE-scheduler) -fi +os_dist='unknown' +function check_os_version() { + #determine which OpenStack version we'll be running + os_version=$(rpm -q openstack-nova-common --qf='%{VERSION}') + case $os_version in + 2012.1|2012.1.*) os_dist='essex';; + 2012.2|2012.2.*) os_dist='folsom';; + 2013.1|2013.1.*) os_dist='grizzly';; + *) echo 'Could not detect installed OpenStack version';; + esac + echo "Detected os_version $os_version os_dist=$os_dist" +} function os_status() { for service in ${OS_SERVICES[@]} @@ -132,6 +140,11 @@ function os_start() { # policy problem. See https://bugzilla.redhat.com/show_bug.cgi?id=857747 sleep 2 sudo systemctl $action openstack-nova-network.service + + # conductor service is new for grizzly + if [ "$os_dist" = 'grizzly' ]; then + sudo systemctl $action openstack-nova-conductor.service + fi } function os_stop() { @@ -204,6 +217,9 @@ function os_erase() { function os_install() { sudo yum -q -y groupinstall Virtualization sudo yum -q -y install openstack-utils openstack-nova openstack-glance openstack-keystone openstack-dashboard scsi-target-utils qpid-cpp-server qpid-cpp-server-daemon $VOLUME_SERVICE + + check_os_version + sudo dd if=/dev/zero of=$VOLUME_PATH bs=1M seek=20k count=0 # Note if mysql-server is not installed, this will fail # and openstack-db --yes will install/start it @@ -220,8 +236,24 @@ function os_install() { fi # Create a keystone RC file + # Note that keystone bug #1073291 "fix" removes a chunk of stuff from + # /usr/share/openstack-keystone/sample_data.sh (called from + # openstack-keystone-sample-data below), so for grizzly we have to align + # our RC file with the hardcoded values, because the password variables + # are now ignored, also the admin tenant is no longer created. + # I raised bug #1166182 to potentially fix this, but for now workaround: mkdir -p $HOME/.openstack - cat > $HOME/.openstack/keystonerc < $HOME/.openstack/keystonerc < $HOME/.openstack/keystonerc <