@@ -245,7 +245,6 @@ sudo chown `whoami` $DATA_DIR
245245# Get project function libraries
246246source $TOP_DIR /lib/cinder
247247
248-
249248# Set the destination directories for openstack projects
250249NOVA_DIR=$DEST /nova
251250HORIZON_DIR=$DEST /horizon
463462GLANCE_HOSTPORT=${GLANCE_HOSTPORT:- $SERVICE_HOST : 9292}
464463
465464
466- # SWIFT
465+ # Swift
467466# -----
468- # TODO: implement glance support
467+
469468# TODO: add logging to different location.
470469
471470# By default the location of swift drives and objects is located inside
@@ -477,7 +476,7 @@ SWIFT_DATA_DIR=${SWIFT_DATA_DIR:-${DEST}/data/swift}
477476# directory, change SWIFT_CONFIG_DIR if you want to adjust that.
478477SWIFT_CONFIG_DIR=${SWIFT_CONFIG_DIR:-/ etc/ swift}
479478
480- # devstack will create a loop-back disk formatted as XFS to store the
479+ # DevStack will create a loop-back disk formatted as XFS to store the
481480# swift data. By default the disk size is 1 gigabyte. The variable
482481# SWIFT_LOOPBACK_DISK_SIZE specified in bytes allow you to change
483482# that.
512511# Set default port for nova-objectstore
513512S3_SERVICE_PORT=${S3_SERVICE_PORT:- 3333}
514513
514+
515515# Keystone
516516# --------
517517
@@ -609,23 +609,24 @@ set -o xtrace
609609
610610# Install Packages
611611# ================
612- #
612+
613613# Openstack uses a fair number of other projects.
614614
615- # install package requirements
615+ # Install package requirements
616616if [[ " $os_PACKAGE " = " deb" ]]; then
617617 apt_get update
618618 install_package $( get_packages $FILES /apts)
619619else
620620 install_package $( get_packages $FILES /rpms)
621621fi
622622
623- # install python requirements
623+ # Install python requirements
624624pip_install $( get_packages $FILES /pips | sort -u)
625625
626- # compute service
626+ # Check out OpenStack sources
627627git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
628- # python client library to nova that horizon (and others) use
628+
629+ # Check out the client libs that are used most
629630git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
630631git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
631632git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH
678679# Initialization
679680# ==============
680681
681- # setup our checkouts so they are installed into python path
682+ # Set up our checkouts so they are installed into python path
682683# allowing ``import nova`` or ``import glance.client``
683684setup_develop $KEYSTONECLIENT_DIR
684685setup_develop $NOVACLIENT_DIR
@@ -874,16 +875,17 @@ function screen_it {
874875 fi
875876}
876877
877- # create a new named screen to run processes in
878+ # Create a new named screen to run processes in
878879screen -d -m -S stack -t stack -s /bin/bash
879880sleep 1
880- # set a reasonable statusbar
881+ # Set a reasonable statusbar
881882screen -r stack -X hardstatus alwayslastline " $SCREEN_HARDSTATUS "
882883
884+
883885# Horizon
884886# -------
885887
886- # Setup the django horizon application to serve via apache/wsgi
888+ # Set up the django horizon application to serve via apache/wsgi
887889
888890if is_service_enabled horizon; then
889891
@@ -900,7 +902,7 @@ if is_service_enabled horizon; then
900902 python manage.py syncdb
901903 cd $TOP_DIR
902904
903- # create an empty directory that apache uses as docroot
905+ # Create an empty directory that apache uses as docroot
904906 sudo mkdir -p $HORIZON_DIR /.blackhole
905907
906908 if [[ " $os_PACKAGE " = " deb" ]]; then
@@ -1007,8 +1009,10 @@ if is_service_enabled g-reg; then
10071009
10081010fi
10091011
1010- # Quantum (for controller or agent nodes)
1012+
1013+ # Quantum
10111014# -------
1015+
10121016if is_service_enabled quantum; then
10131017 # Put config files in /etc/quantum for everyone to find
10141018 if [[ ! -d /etc/quantum ]]; then
@@ -1034,7 +1038,7 @@ if is_service_enabled quantum; then
10341038 exit 1
10351039 fi
10361040
1037- # if needed, move config file from $QUANTUM_DIR/etc/quantum to /etc/quantum
1041+ # If needed, move config file from $QUANTUM_DIR/etc/quantum to /etc/quantum
10381042 mkdir -p /$Q_PLUGIN_CONF_PATH
10391043 Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH /$Q_PLUGIN_CONF_FILENAME
10401044 if [[ -e $QUANTUM_DIR /$Q_PLUGIN_CONF_FILE ]]; then
@@ -1143,7 +1147,6 @@ if is_service_enabled m-svc; then
11431147fi
11441148
11451149
1146-
11471150# Nova
11481151# ----
11491152
@@ -1279,7 +1282,7 @@ if is_service_enabled n-cpu; then
12791282
12801283 QEMU_CONF=/etc/libvirt/qemu.conf
12811284 if is_service_enabled quantum && [[ $Q_PLUGIN = " openvswitch" ]] && ! sudo grep -q ' ^cgroup_device_acl' $QEMU_CONF ; then
1282- # add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
1285+ # Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
12831286 sudo chmod 666 $QEMU_CONF
12841287 sudo cat << EOF >> /etc/libvirt/qemu.conf
12851288cgroup_device_acl = [
@@ -1363,7 +1366,10 @@ if is_service_enabled n-net; then
13631366 sudo sysctl -w net.ipv4.ip_forward=1
13641367fi
13651368
1369+
13661370# Storage Service
1371+ # ---------------
1372+
13671373if is_service_enabled swift; then
13681374 # Install memcached for swift.
13691375 install_package memcached
@@ -1663,7 +1669,7 @@ function add_nova_opt {
16631669 echo "$1 " >> $NOVA_CONF_DIR /$NOVA_CONF
16641670}
16651671
1666- # remove legacy nova.conf
1672+ # Remove legacy nova.conf
16671673rm -f $NOVA_DIR /bin/nova.conf
16681674
16691675# (re)create nova.conf
@@ -1924,7 +1930,7 @@ if is_service_enabled key; then
19241930 iniset $KEYSTONE_CONF_DIR /logging.conf logger_root level "DEBUG"
19251931 iniset $KEYSTONE_CONF_DIR /logging.conf logger_root handlers "devel,production"
19261932
1927- # Set up the keystone database
1933+ # Initialize keystone database
19281934 $KEYSTONE_DIR /bin/keystone-manage db_sync
19291935
19301936 # launch keystone and wait for it to answer before continuing
@@ -1950,7 +1956,7 @@ if is_service_enabled key; then
19501956 export OS_USERNAME=admin
19511957 export OS_PASSWORD=$ADMIN_PASSWORD
19521958
1953- # create an access key and secret key for nova ec2 register image
1959+ # Create an access key and secret key for nova ec2 register image
19541960 if is_service_enabled swift && is_service_enabled nova; then
19551961 NOVA_USER_ID=$( keystone user-list | grep ' nova ' | get_field 1)
19561962 NOVA_TENANT_ID=$( keystone tenant-list | grep " $SERVICE_TENANT_NAME " | get_field 1)
@@ -1963,7 +1969,7 @@ if is_service_enabled key; then
19631969 fi
19641970fi
19651971
1966- # launch the nova-api and wait for it to answer before continuing
1972+ # Launch the nova-api and wait for it to answer before continuing
19671973if is_service_enabled n-api; then
19681974 add_nova_opt "enabled_apis=$NOVA_ENABLED_APIS "
19691975 screen_it n-api "cd $NOVA_DIR && $NOVA_DIR /bin/nova-api"
@@ -1977,13 +1983,13 @@ fi
19771983# If we're using Quantum (i.e. q-svc is enabled), network creation has to
19781984# happen after we've started the Quantum service.
19791985if is_service_enabled mysql && is_service_enabled nova; then
1980- # create a small network
1986+ # Create a small network
19811987 $NOVA_DIR /bin/nova-manage network create private $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS
19821988
1983- # create some floating ips
1989+ # Create some floating ips
19841990 $NOVA_DIR /bin/nova-manage floating create $FLOATING_RANGE
19851991
1986- # create a second pool
1992+ # Create a second pool
19871993 $NOVA_DIR /bin/nova-manage floating create --ip_range=$TEST_FLOATING_RANGE --pool=$TEST_FLOATING_POOL
19881994fi
19891995
@@ -2012,6 +2018,7 @@ screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONF
20122018is_service_enabled swift || \
20132019 screen_it n-obj "cd $NOVA_DIR && $NOVA_DIR /bin/nova-objectstore"
20142020
2021+
20152022# Install Images
20162023# ==============
20172024
0 commit comments