Installing OpenStack on CentOS in Private Network

With increasing popularity of OpenStack, I finally got chance to try it out by myself. As the first step, I chose to install everything into one machine (update: for multi-node deployment, check here). Thanks to the packstack project and RedHat documentation (http://openstack.redhat.com/Quickstart), it’s supposed to be straight forward and painless on CentOS. It turned out to be true if and only if you install it with direct HTTP(s) access to the Internet.

If you have to go through a proxy from your installation machine to the Internet, you may get into trouble. That’s what happened with my installation. Following are a few tips that you may find useful if you install OpenStack within private network. Because it turned out to be really about setting http(s) proxy, the instructions should also work with installation of other software.

Bothered by SLOW Web UI to manage vSphere? Want to manage ALL your VMware vCenters, AWS, Azure, Openstack, container behind a SINGLE pane of glass? Want to search, analyze, report, visualize VMs, hosts, networks, datastores, events as easily as Google the Web? Find out more about vSearch 3.0: the search engine for all your private and public clouds.

Note that not everyone private network forces you to use proxy, but it’s common enough that there is a good chance to fail your OpenStack installation. Some errors I got through multiple runs include:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 6 – “Couldn’t resolve host ‘mirrorlist.centos.org'”

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 7 – “Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable”

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 7 – “Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable”

mError: /Stage[main]/Mysql::Server/Package[mysql-server]/ensure: change from absent to present failed: Execution of ‘/usr/bin/yum -d 0 -e 0 -y install mysql-server’ returned 1: Error: Cannot find a valid baseurl for repo: base

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 7 – “Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable”

The following is the fix:

# vim /etc/profile

# add the following two line with your proxy ip and port

export http_proxy=192.168.100.25:8080

export https_proxy=192.168.100.25:8080

# source /etc/profile

# vim /etc/yum.conf

# insert the following line with your proxy ip and port

proxy=http://192.168.100.25:8080

A Bit More With MySQL Server

After the proxy setting, I got into another problem seemingly related to the password to the mySQL server. After searching the Web, I found a clue that you have to remove the /root/.my.cnf file if a previous installation has been tried but not successful. The problem is that it still didn’t work after removing the file in my case. The error message (see the end) showed that password change didn’t work.

Extracting the command and running it directly on console gave me the same error. So I uninstall the MySQL server and tried a couple of times with the same result. Then I realized that I once tried the mysqladmin command and succeeded, meaning the password had been changed to something else from unset. Because the password had been saved to file system and removing the server binary does not remove the data, every new install still used the same old password. For a real clean up, the data has to be removed. In my CentOS, just run the following command “rm –rf /var/lib/mysql”.

After the full clean up, the installation went through like a breeze. To use the Web site, you want to check out the password save in the /root/keystonerc_admin file. Look for the $OS_PASSWORD and copy its value to the login page.

# vi keystonerc_admin
Export $OS_PASSWORD= a5e43ef23f514e13

Error: mysqladmin -u root  password ‘f4a98bc1d24c4dcf’ returned 1 instead of one of [0]^[[0m

^[[1;31mError: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/returns: change from notrun to 0 failed: mysqladmin -u root  password ‘f4a98bc1d24c4dcf’ returned 1 instead of one of [0]^[[0m

^[[1;31mError: Could not prefetch database_grant provider ‘mysql’: Execution of ‘/usr/bin/mysql –defaults-file=/root/.my.cnf mysql -Be describe user’ returned 1: Could not open required defaults file: /root/.my.cnf

Fatal error in defaults handling. Program aborted
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

This entry was posted in Cloud Computing and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted May 31, 2013 at 12:33 am | Permalink

    Installing OpenStack on CentOS in Private Network http://t.co/hBkMsT5HC9 via @sjin2008

  2. Posted May 31, 2013 at 1:12 am | Permalink

    Installing OpenStack on CentOS in Private Network (DoubleCloud) http://t.co/vDboGiHYzw

  3. Keith Shum
    Posted May 24, 2014 at 5:16 pm | Permalink

    Thanks for your note!

    I got a different error complaining about Keystone Token, but fixed it by removing mysql and it’s db files, strange!

    ERROR : Error appeared during Puppet run: 10.10.50.119_keystone.pp
    err: /Stage[main]/Neutron::Keystone::Auth/Keystone_user[neutron]: Could not evaluate: Execution of ‘/usr/bin/keystone –os-auth-url http://127.0.0.1:35357/v2.0/ token-get’ returned 1: The request you have made requires authentication. (HTTP 401)
    You will find full trace in log /var/tmp/packstack/20140524-002817-wZWhcz/manifests/10.10.50.119_keystone.pp.log

One Trackback

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.