Recently I had to install Devstack, the Openstack Test environment in nested VM variant on KVM with qcow VM disks.

As always I used to start with a CentOS7 minimal installation.

below you can pickup my notes to build your own:

yum install -y git yum-utils python-testrepository epel-release
yum -y update getenforce # make permissive or disable iptables-save #no rules for testing
reboot

useradd -d /opt/stack -m -s /bin/bash stack
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
su - stack
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack/
./stack.sh
# wait 1 minutes and feed passwords
# wait other 20 minutes

 

But I had some strange issues, even on a kickstarted minimal VM... here are my notes to get/got around:

 

ERROR1:

Command "python setup.py egg_info" failed with error code 1 in /opt/stack/keystone
+ /opt/stack/devstack/inc/python:pip_install:L1:   exit_trap
+ ./stack.sh:exit_trap:L474:   local r=1
++ ./stack.sh:exit_trap:L475:   jobs -p
+ ./stack.sh:exit_trap:L475:   jobs=
+ ./stack.sh:exit_trap:L478:   [[ -n '' ]]
+ ./stack.sh:exit_trap:L484:   kill_spinner
+ ./stack.sh:kill_spinner:L370:   '[' '!' -z '' ']'
+ ./stack.sh:exit_trap:L486:   [[ 1 -ne 0 ]]
+ ./stack.sh:exit_trap:L487:   echo 'Error on exit'
Error on exit
+ ./stack.sh:exit_trap:L488:   generate-subunit 1457190882 600 fail
[...]

SOLUTION1:

sudo yum -y install python-testrepository


ERROR2:

 

2016-03-06 15:01:31.414 | Starting Keystone
++ /opt/stack/devstack/functions-common:is_service_enabled:L1997:   set +o
++ /opt/stack/devstack/functions-common:is_service_enabled:L1997:   grep xtrace
+ /opt/stack/devstack/functions-common:is_service_enabled:L1997:   xtrace='set -o xtrace'
+ /opt/stack/devstack/functions-common:is_service_enabled:L1998:   set +o xtrace
+ /opt/stack/devstack/functions-common:is_service_enabled:L2026:   return 1
+ /opt/stack/devstack/lib/keystone:init_keystone:L497:   recreate_database keystone
+ /opt/stack/devstack/lib/database:recreate_database:L112:   local db=keystone
+ /opt/stack/devstack/lib/database:recreate_database:L113:   recreate_database_mysql keystone
+ /opt/stack/devstack/lib/databases/mysql:recreate_database_mysql:L56:   local db=keystone
+ /opt/stack/devstack/lib/databases/mysql:recreate_database_mysql:L57:   mysql -uroot -phdsshdk -h127.0.0.1 -e 'DROP DATABASE IF EXISTS keystone;'
+ /opt/stack/devstack/lib/databases/mysql:recreate_database_mysql:L58:   mysql -uroot -phdsshdk -h127.0.0.1 -e 'CREATE DATABASE keystone CHARACTER SET utf8;'
+ /opt/stack/devstack/lib/keystone:init_keystone:L500:   /usr/bin/keystone-manage db_sync
Traceback (most recent call last):
  File "/usr/bin/keystone-manage", line 6, in <module>
    from keystone.cmd.manage import main
  File "/opt/stack/keystone/keystone/cmd/manage.py", line 32, in <module>
    from keystone.cmd import cli
  File "/opt/stack/keystone/keystone/cmd/cli.py", line 23, in <module>
    from oslo_log import log
  File "/usr/lib/python2.7/site-packages/oslo_log/log.py", line 50, in <module>
    from oslo_log import formatters
  File "/usr/lib/python2.7/site-packages/oslo_log/formatters.py", line 27, in <module>
    from oslo_serialization import jsonutils
  File "/usr/lib/python2.7/site-packages/oslo_serialization/jsonutils.py", line 44, in <module>
    import six.moves.xmlrpc_client as xmlrpclib
ImportError: No module named xmlrpc_client
+ /opt/stack/devstack/lib/keystone:init_keystone:L1:   exit_trap
+ ./stack.sh:exit_trap:L474:   local r=1
++ ./stack.sh:exit_trap:L475:   jobs -p
+ ./stack.sh:exit_trap:L475:   jobs=
+ ./stack.sh:exit_trap:L478:   [[ -n '' ]]
+ ./stack.sh:exit_trap:L484:   kill_spinner
+ ./stack.sh:kill_spinner:L370:   '[' '!' -z '' ']'
+ ./stack.sh:exit_trap:L486:   [[ 1 -ne 0 ]]
+ ./stack.sh:exit_trap:L487:   echo 'Error on exit'
Error on exit
+ ./stack.sh:exit_trap:L488:   generate-subunit 1457275980 511 fail
Traceback (most recent call last):
  File "/bin/generate-subunit", line 7, in <module>
    from os_testr.generate_subunit import main
  File "/usr/lib/python2.7/site-packages/os_testr/generate_subunit.py", line 20, in <module>
    import subunit
  File "/usr/lib/python2.7/site-packages/subunit/__init__.py", line 141, in <module>
    from iso8601 import iso8601
ImportError: cannot import name iso8601

SOLUTION2:

sudo pip uninstall six; sudo pip install six

 

Start over:

If you got errors and do not know how to clean up... It's pretty easy:

rm -rf /opt/stack
rm -rf /usr/local/bin/

./clean.sh
./unstack.sh
userdel -r stack