DevStack
1. Reinstall the Redhat with jumpstart
2. Run the script ‘devstack.sh’ :
#!/bin/sh
#set -x
stackdir=/devstack
stackuser=stack
stackgroup=stack
stackpasswd=stack
# mkdir stack directory
if [ ! -d "$stackdir" ]; then
echo "Creating directory $stackdir ..."
mkdir -p $stackdir
fi
chmod 777 $stackdir
cd $stackdir
# Add stack user
resultstr=`grep "^$stackgroup:" /etc/group`
if [ -z "$resultstr" ]; then
echo "Adding group $stackgroup ..."
groupadd $stackgroup
fi
resultstr=`grep "^$stackuser:" /etc/passwd`
if [ -z "$resultstr" ]; then
echo "Adding user $stackuser ..."
useradd -g $stackgroup -s /bin/bash -d /opt/stack -m $stackuser
fi
chown -R $stackuser:$stackgroup /opt/stack
tmpfile=/tmp/pass.tmp
cat > $tmpfile << EOF
$stackpasswd
$stackpasswd
EOF
passwd $stackuser < $tmpfile
#rm $tmpfile
# update /etc/sudoers
stacksudoers=`grep "^$stackuser" /etc/sudoers`;
if [ -z "$stacksudoers" ]; then
echo "Adding user $stackuser in /etc/sudoers ..."
echo "$stackuser ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
fi
# upgrade python-paste since some bugs.
for rpm in `rpm -qa | grep 'python-paste'`; do
echo "Removing $rpm ..."
rpm -e --nodeps $rpm
done
echo "Upgrading paste ..."
easy_install --upgrade paste
echo "Upgrading PasteDeploy ..."
easy_install --upgrade PasteDeploy
# gid clone devstack
echo "Git clone devstack ..."
if [ ! -d "$stackdir/devstack" ]; then
su $stackuser -c 'git clone https://github.com/openstack-dev/devstack.git'
fi
chown -R $stackuser:$stackgroup devstack
cd devstack
# create localrc config file
echo "Creating localrc ..."
cat > localrc << EOF
# localrc for DevStack Havana with Neutron
ADMIN_PASSWORD=$stackpasswd
MYSQL_PASSWORD=$stackpasswd
RABBIT_PASSWORD=$stackpasswd
SERVICE_PASSWORD=$stackpasswd
SERVICE_TOKEN=token
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-meta
enable_service neutron
# Optional, to enable tempest configuration as part of DevStack
enable_service tempest
#enable_service s-proxy s-object s-container s-account
enable_service swift
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
OVS_ENABLE_TUNNELING=False
NOVA_BRANCH=stable/havana
CINDER_BRANCH=stable/havana
GLANCE_BRANCH=stable/havana
HORIZON_BRANCH=stable/havana
KEYSTONE_BRANCH=stable/havana
NEUTRON_BRANCH=stable/havana
SWIFT_BRANCH=stable/havana
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=False
SCREEN_LOGDIR=/opt/stack/logs
OVS_VLAN_RANGES=RegionOne:1:4000
EOF
chown $stackuser:$stackgroup localrc
#su $stackuser --session-command='./stack.sh'
echo "Please run 'cd $stackdir/devstack; su $stackuser; ./stack.sh'"
3. When the script stops running and tells you torun ‘stack.sh’. Don’t run it before making the following modification:
# vim /devstack/devstack/stackrc
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
4. Then
#cd /devstack/devstack
#su stack
#./stack.sh
5. Done
After installation, I read the installation log, there’sstill errors about ‘askii’ encoding, but it works anyway.
Then I installed an extra dev environment for Horizon withthe following steps:
#mkdir /home/leon
#cd /home/leon
#git clone https://github.com/openstack/horizon.git
#cd horizon
#./run_tests.sh
#cpopenstack_dashboard/local/local_settings.py.exampleopenstack_dashboard/local/local_settings.py
It will take about around half an hour. Then you can startit with
#source .venv/bin/activate
# python manage.py runserver 0.0.0.0:8000