OpenStack Cloud Computing Platform: Installation and Configuration
In our quest to install OpenStack, we run into this thingy
# keystone user-list
Expecting authentication method via
either a service token, –token or env[SERVICE_TOKEN],
or credentials, –os-username or env[OS_USERNAME].
#
The solution for this is rather lengthy where we run into another set of error(s) before we can proceed:
# pip install -r requirements.txt
bash: pip: command not found
#
First we need to install pip (Python pip is required for the keystone installation):
# man easy_install
No manual entry for easy_install
# easy_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.3.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#md5=cbb27a191cebc58997c4da8513863153
Processing pip-1.3.1.tar.gz
Running pip-1.3.1/setup.py -q bdist_egg –dist-dir /tmp/easy_install-MR95xs/pip-1.3.1/egg-dist-tmp-kyVTUn
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.3.1 to easy-install.pth file
Installing pip script to /usr/bin
Installing pip-2.6 script to /usr/binInstalled /usr/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
# which pip
/usr/bin/pip
#
Once done, we'll be following the Keystone installations found on the OpenStack page. When running sudo pip install -r requirements.txt we ran into this:
ImportError: No module named d2to1.core
We installed django using:
yum install django
which resulted in these modules being braught in:
Installing : 1:python-sqlite2-2.3.5-2.el6.x86_64 1/3
Installing : python-psycopg2-2.0.14-1.el6_2.1.x86_64 2/3
Installing : python-django-1.2.3-2.el6.rf.noarch 3/3
Which resulted in
Successfully installed d2to1 pbr pam WebOb sqlalchemy sqlalchemy-migrate python-keystoneclient oslo.config setuptools-git requests six
Cleaning up…
After rerunning pip install -r requirements.txt. Unfortunately this failed to bring in some binaries:
# which keystone keystone-all keystone-manage
/usr/bin/keystone
/usr/bin/which: no keystone-all in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
/usr/bin/which: no keystone-manage in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
and upon further inspection, we see that:
lib/sqlalchemy/cextension/processors.c:449: error: \u2018module_methods\u2019 undeclared (first use in this function)
lib/sqlalchemy/cextension/processors.c:450: warning: statement with no effect
lib/sqlalchemy/cextension/processors.c:451: error: \u2018NULL\u2019 undeclared (first use in this function)
lib/sqlalchemy/cextension/processors.c:454: error: \u2018PyDateTime_IMPORT\u2019 undeclared (first use in this function)
lib/sqlalchemy/cextension/processors.c:454: warning: statement with no effect
lib/sqlalchemy/cextension/processors.c:457: warning: implicit declaration of function \u2018PyModule_AddObject\u2019
lib/sqlalchemy/cextension/processors.c:458: error: expected expression before \u2018)\u2019 token
lib/sqlalchemy/cextension/processors.c:458: error: invalid operands to binary * (have \u2018char **\u2019 and \u2018char **\u2019)
lib/sqlalchemy/cextension/processors.c:462: error: expected expression before \u2018)\u2019 token
lib/sqlalchemy/cextension/processors.c:462: error: invalid operands to binary * (have \u2018char **\u2019 and \u2018char **\u2019)
***************************************************************************
command 'gcc' failed with exit status 1
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
***************************************************************************
We have a bunch of errors from the installer. Looks like we may need to install python-dev (or more precisely python-devel.x86_64). So here we go:
yum install python-devel.x86_64
Following that, we retry to run the pip install -r requirements.txt command again but get this instead:
# pip install -r requirements.txt
Requirement already satisfied (use –upgrade to upgrade): d2to1>=0.2.10,<0.3 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use –upgrade to upgrade): pbr>=0.5,<0.6 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use –upgrade to upgrade): pam>=0.1.4 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use –upgrade to upgrade): WebOb==1.2.3 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 5))
Requirement already satisfied (use –upgrade to upgrade): eventlet in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 6))
Requirement already satisfied (use –upgrade to upgrade): greenlet in /usr/lib64/python2.6/site-packages (from -r requirements.txt (line 7))
Requirement already satisfied (use –upgrade to upgrade): PasteDeploy in /usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg (from -r requirements.txt (line 8))
Requirement already satisfied (use –upgrade to upgrade): paste in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 9))
Requirement already satisfied (use –upgrade to upgrade): routes in /usr/lib/python2.6/site-packages/Routes-1.12.3-py2.6.egg (from -r requirements.txt (line 10))
Requirement already satisfied (use –upgrade to upgrade): sqlalchemy>=0.7.8,<=0.7.9 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 11))
Requirement already satisfied (use –upgrade to upgrade): sqlalchemy-migrate>=0.7.2 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 12))
Requirement already satisfied (use –upgrade to upgrade): passlib in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 13))
Requirement already satisfied (use –upgrade to upgrade): lxml in /usr/lib64/python2.6/site-packages (from -r requirements.txt (line 14))
Requirement already satisfied (use –upgrade to upgrade): iso8601>=0.1.4 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 15))
Requirement already satisfied (use –upgrade to upgrade): python-keystoneclient>=0.2.1,<0.3 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 16))
Requirement already satisfied (use –upgrade to upgrade): oslo.config>=1.1.0 in /usr/lib/python2.6/site-packages (from -r requirements.txt (line 17))
Requirement already satisfied (use –upgrade to upgrade): distribute in /usr/lib/python2.6/site-packages (from d2to1>=0.2.10,<0.3->-r requirements.txt (line 2))
Requirement already satisfied (use –upgrade to upgrade): setuptools-git>=0.4 in /usr/lib/python2.6/site-packages (from pbr>=0.5,<0.6->-r requirements.txt (line 3))
Requirement already satisfied (use –upgrade to upgrade): decorator in /usr/lib/python2.6/site-packages (from sqlalchemy-migrate>=0.7.2->-r requirements.txt (line 12))
Requirement already satisfied (use –upgrade to upgrade): Tempita>=0.4 in /usr/lib/python2.6/site-packages (from sqlalchemy-migrate>=0.7.2->-r requirements.txt (line 12))
Requirement already satisfied (use –upgrade to upgrade): argparse in /usr/lib/python2.6/site-packages (from python-keystoneclient>=0.2.1,<0.3->-r requirements.txt (line 16))
Requirement already satisfied (use –upgrade to upgrade): prettytable>=0.6,<0.8 in /usr/lib/python2.6/site-packages (from python-keystoneclient>=0.2.1,<0.3->-r requirements.txt (line 16))
Requirement already satisfied (use –upgrade to upgrade): requests>=0.8.8 in /usr/lib/python2.6/site-packages (from python-keystoneclient>=0.2.1,<0.3->-r requirements.txt (line 16))
Requirement already satisfied (use –upgrade to upgrade): simplejson in /usr/lib64/python2.6/site-packages (from python-keystoneclient>=0.2.1,<0.3->-r requirements.txt (line 16))
Requirement already satisfied (use –upgrade to upgrade): six in /usr/lib/python2.6/site-packages (from python-keystoneclient>=0.2.1,<0.3->-r requirements.txt (line 16))
Cleaning up…
#
However after a few trial and errors:
# pip –upgrade -r requirements.txt
Usage:
pip <command> [options]no such option: –upgrade
# pip upgrade -r requirements.txt
ERROR: unknown command "upgrade"
# pip upgrade
ERROR: unknown command "upgrade"
# pip –upgradeUsage:
pip <command> [options]no such option: –upgrade
# which pip
/usr/bin/pip
# vi $(which pip)
#
# vi $(which pip)
# pip –upgrade -r requirements.txtUsage:
pip <command> [options]no such option: –upgrade
#
We run the following:
# pip install -r requirements.txt –upgrade
Which results in:
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
Naturally, we follow this with:
yum install libxml2-devel.x86_64 libxslt-devel.x86_64
And we repeat the pip upgrade command above. However, the result was the same and the following were missing:
# which keystone keystone-all keystone-manage
/usr/bin/keystone
/usr/bin/which: no keystone-all in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
/usr/bin/which: no keystone-manage in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
#
So we yum'med it instead:
yum install openstack-keystone.noarch python-keystone.noarch python-keystoneclient.noarch openstack-keystone-doc.noarch
And that gives us:
# which keystone keystone-all keystone-manage
/usr/bin/keystone
/usr/bin/keystone-all
/usr/bin/keystone-manage
## ls -al /etc/keystone/|grep -Ei "keystone.conf|keystone-paste.ini|logging.conf|policy.json|default_catalog.templates"
-rw-r—–. 1 root keystone 1539 Apr 4 10:24 default_catalog.templates
-rw-r—–. 1 root keystone 10023 Apr 5 02:00 keystone.conf
-rw-r—–. 1 root keystone 1046 Apr 4 10:24 logging.conf
-rw-r—–. 1 keystone keystone 3919 Apr 4 10:24 policy.json
#
All we need. Next we return to the OpenStack page to continue but this time we'll just follow the Fedora 17 instructions for our Scientific Linux 6.3 install. Having said taht, we'll migrate otuselves over to the Fedora OpenStack Installation page and yum the thing into installation. Unfortunately, when running the yum lines specified:
# yum install openstack-utils openstack-nova openstack-glance openstack-keystone openstack-swift openstack-dashboard openstack-swift-proxy openstack-swift-account openstack-swift-container openstack-swift-object
We get thousands of lines like this:
file /usr/lib/python2.6/site-packages/django/utils/tree.py from install of Django14-1.4.5-1.el6.noarch conflicts with file from package python-django-1.2.3-2.el6.rf.noarch
file /usr/lib/python2.6/site-packages/django/utils/tree.pyc from install of Django14-1.4.5-1.el6.noarch conflicts with file from package python-django-1.2.3-2.el6.rf.noarch
Which means we need to rollback django.
# rpm -e python-django-1.2.3-2.el6.rf.noarch
Which is fine. (Django get's reinstalled as part of the yum line.) We rerun the yum line above. (Don't forget the latest stable repository repo):
cd /etc/yum.repo.d/; curl http://repos.fedorapeople.org/repos/openstack/openstack-folsom/fedora-openstack-folsom.repo -o /etc/yum.repos.d/fedora-openstack-grizzly.repo
A few messages pop up we need to pay attention too:
No package rubygem-openstack available.
No package rubygem-openstack-compute available.No package appliance-tools available.
No package appliance-tools-minimizer available.
No package rubygem-boxgrinder-build available.No package openstack-tempo available.
But let's continue. (STB FLW: These might be just helper packages and not part of the core.) On to the next command:
openstack-db –service nova –init
If you forgot your MySQL password, see here. Unfortunately, things don't go according to plan:
# sudo openstack-db –service nova –init
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Creating 'nova' database.
Initializing the nova database, please wait…
Traceback (most recent call last):
File "/usr/bin/nova-manage", line 1263, in <module>
main()
File "/usr/bin/nova-manage", line 1203, in main
logging.setup("nova")
File "/usr/lib/python2.6/site-packages/nova/openstack/common/log.py", line 331, in setup
_setup_logging_from_conf(product_name)
File "/usr/lib/python2.6/site-packages/nova/openstack/common/log.py", line 378, in _setup_logging_from_conf
filelog = logging.handlers.WatchedFileHandler(logpath)
File "/usr/lib64/python2.6/logging/handlers.py", line 377, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib64/python2.6/logging/__init__.py", line 827, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib64/python2.6/logging/__init__.py", line 846, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/nova/nova-manage.log'
ERROR 1146 (42S02) at line 1: Table 'nova.migrate_version' doesn't exist
Final sanity check failed.
Please file a bug report on bugzilla.redhat.com against the openstack-nova package.
# rpm -aq|grep -i mysql-server
mysql-server-5.1.69-1.el6_4.x86_64
# yum update mysql
Loaded plugins: downloadonly, fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* elrepo: mirror.symnds.com
* epel: mirrors.rit.edu
* rpmfusion-free-updates: mirror.nexcess.net
* rpmfusion-nonfree-updates: mirror.nexcess.net
* sl: ftp1.scientificlinux.org
* sl-security: ftp1.scientificlinux.org
http://repos.fedorapeople.org/repos/openstack/openstack-folsom/fedora-6.3/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – "The requested URL returned error: 404 Not Found"
Trying other mirror.
Setting up Update Process
No Packages marked for Update
# ls -al /var/log/nova/nova-manage.log
-rw-r–r–. 1 root root 0 Jun 9 23:06 /var/log/nova/nova-manage.log
# sudo openstack-db –service nova –init
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Database 'nova' already exists. Please consider first running:
/usr/bin/openstack-db –drop –service nova
# /usr/bin/openstack-db –drop –service nova
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Dropping 'nova' database.
Complete!
#
Trying again without the sudo prefix command yields the same results. However, we try to remove the offending file first then dropping the database and rerunning the above init line:
# ls -al /var/log/nova/nova-manage.log
-rw-r–r–. 1 root root 0 Jun 9 23:06 /var/log/nova/nova-manage.log
# rm /var/log/nova/nova-manage.log
rm: remove regular empty file `/var/log/nova/nova-manage.log'? y
# /usr/bin/openstack-db –drop –service nova
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Dropping 'nova' database.
Complete!
#
This time running openstack-db –service nova –init yielded the desired results.
# openstack-db –service nova –init
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Creating 'nova' database.
Initializing the nova database, please wait…
Complete!
#
The above issue was likely due to the service or installation as root but it should have been owned by the nova user:
# ls -al /var/log/nova/nova-manage.log
-rw-r–r–. 1 nova nova 0 Jun 9 23:45 /var/log/nova/nova-manage.log
#
so a change of user on the file would be sufficient as well. And so on to the next step:
# nova-manage db sync
#
Which went the best so far.
# openstack-db –service glance –init
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Creating 'glance' database.
Initializing the glance database, please wait…
Complete!
#
Followed by openstack-db –service cinder –init which had the same successful results as above. Next we try to run:
# systemctl start qpidd.service && sudo systemctl enable qpidd.service
bash: systemctl: command not found
#
But after a quick yum search systemctl we realize we need the following:
novacom.x86_64 : Utility to connect to WebOS devices
novacom-server.x86_64 : Service for utility that connects to WebOS devices
After a quick yum install the above two, we try again but with same results. Looks like we need to replace some things with chkconfig instead. Looks like there was a recent migration to systemctl of which RHEL isn't a part of yet. So we just ensure it's enabled and started:
# systemctl start qpidd.service && systemctl enable qpidd.service^C
# chkconfig qpidd.service
# chkconfig |grep qpidd.service
# chkconfig |grep qpidd
qpidd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
And the same for the libvirtd service.
# chkconfig –level 2345 libvirtd on
# chkconfig|grep libvirtd
libvirtd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
Since this is RHEL Clone, instead of running systemctl, we need to do this:
# chkconfig|grep -Ei "api|registry"
openstack-cinder-api 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openstack-glance-api 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openstack-glance-registry 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openstack-nova-api 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openstack-nova-metadata-api 0:off 1:off 2:off 3:off 4:off 5:off 6:off
#
#
# for SVC in $(chkconfig|grep -Ei "api|registry"|awk '{ print $1; }' ); do chkconfig –level 2345 $SVC on; done
# chkconfig|grep -Ei "api|registry"
openstack-cinder-api 0:off 1:off 2:on 3:on 4:on 5:on 6:off
openstack-glance-api 0:off 1:off 2:on 3:on 4:on 5:on 6:off
openstack-glance-registry 0:off 1:off 2:on 3:on 4:on 5:on 6:off
openstack-nova-api 0:off 1:off 2:on 3:on 4:on 5:on 6:off
openstack-nova-metadata-api 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
which does the trick. On to creating the Cinder and Nova volumes:
# man truncate
# truncate –size=20G /var/lib/cinder/cinder-volumes.img
# ls -al /var/lib/cinder/cinder-volumes.img
-rw-r–r–. 1 root root 21474836480 Jun 10 00:09 /var/lib/cinder/cinder-volumes.img
#
Nova and Cinder volumes:
# losetup –show -f /var/lib/cinder/cinder-volumes.img
/dev/loop0
# CINDER_VOL_DEVICE=$(losetup -a | grep "/var/lib/cinder/cinder-volumes.img" | cut -d':' -f1)
# echo $CINDER_VOL_DEVICE
/dev/loop0
# sudo vgcreate nova-volumes $NOVA_VOL_DEVICE
Please enter a physical volume path
Run `vgcreate –help' for more information.
# losetup -a
/dev/loop0: [fd00]:1848324 (/var/lib/cinder/cinder-volumes.img)
# lvm vgcreate nova-volumes $NOVA_VOL_DEVICE
Please enter a physical volume path
Run `vgcreate –help' for more information.
# vgcreate cinder-volumes $CINDER_VOL_DEVICE
No physical volume label read from /dev/loop0
Writing physical volume data to disk "/dev/loop0"
Physical volume "/dev/loop0" successfully created
Volume group "cinder-volumes" successfully created
# lvm lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
MBPCBackup MBPCStorage -wi-ao– 2.73t
oLogVol02 VGEntertain -wi-ao– 151.00g
olv_root VGEntertain -wi-ao– 32.00g
olv_swap VGEntertain -wi-a— 4.00g
fmlv mbpcvg -wi-ao– 1.15t
rootlv mbpcvg -wi-ao– 31.25g
swaplv mbpcvg -wi-ao– 4.00g
# lvm vgs
VG #PV #LV #SN Attr VSize VFree
MBPCStorage 1 1 0 wz–n- 3.64t 931.70g
VGEntertain 1 3 0 wz–n- 187.00g 0
cinder-volumes 1 0 0 wz–n- 20.00g 20.00g
mbpcvg 1 3 0 wz–n- 1.18t 0
# sudo losetup –show -f /var/lib/nova/nova-volumes.img
/dev/loop1
# NOVA_VOL_DEVICE=$(losetup -a | grep "/var/lib/nova/nova-volumes.img" | cut -d':' -f1)
# sudo vgcreate nova-volumes $NOVA_VOL_DEVICE
No physical volume label read from /dev/loop1
Writing physical volume data to disk "/dev/loop1"
Physical volume "/dev/loop1" successfully created
Volume group "nova-volumes" successfully created
# lvm vgs
VG #PV #LV #SN Attr VSize VFree
MBPCStorage 1 1 0 wz–n- 3.64t 931.70g
VGEntertain 1 3 0 wz–n- 187.00g 0
cinder-volumes 1 0 0 wz–n- 20.00g 20.00g
mbpcvg 1 3 0 wz–n- 1.18t 0
nova-volumes 1 0 0 wz–n- 20.00g 20.00g
#
Start the Cinder volume service:
# chkconfig|grep -Ei "volume"
openstack-cinder-volume 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig –level 2345 openstack-cinder-volume on
# chkconfig|grep -Ei "volume"
openstack-cinder-volume 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
Start nova volumes service if applicable because it was deprecated in Folsom so it didn't get added under Grizzley. So none existed for us. We therefore check to see if one is availble using yum, however though we find out, it it looking for openstack-nova-volume-2012.2.3-1.el6.noarch which is outdated (we have 2013). Hence the deprecation. So we continue with the Fedora Installation for our RHEL environment.
TO BE CONTINUED….