Home > Cloud Computing > Installing OpenStack on CentOS in Private Network

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.

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure

HTML5 App

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)

Categories: Cloud Computing Tags: ,
  1. May 31st, 2013 at 00:33 | #1

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

  2. May 31st, 2013 at 01:12 | #2

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

  3. Keith Shum
    May 24th, 2014 at 17:16 | #3

    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

  1. June 17th, 2013 at 01:40 | #1