Home > Virtualization > Notes of Openstack Essex Installation (I)

Notes of Openstack Essex Installation (I)

This entry looks through the installation guide posted on the official website of Openstack for the current version Essex, which you can find out here. The following configurations are almost the same with the guided ones, so you can refer to them for more details. What needs to be highlighted here is slight changes are also made to throw errors away deal to inadequate considerations of the Openstack guide. Here we go!
Step 1: install ubuntu 12.04 with the user name as localadmin and Openssh-server selected during the installation progress. Then run the followings:
$sudo apt-get update
$sudo apt-get upgrade
$sudo apt-get install bridge-utils
A useful tip is using ifconfig command to check the server’s ip and then using putty to connect the server and remotely control the rest of the installation progress. It’ll save your time by copy-paste the commands rather than typing them.

Step 2: Network Configuration
Using $sudo nano /etc/network/interfaces command to config the network as follow:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

Make sure that you have 2 network card attached on the machine. You can also fix the ip address of eth0 like in the Openstack guide. It’s 192.168.230.41 in my case, which u will see later.
$sudo /etc/init.d/networking restart

Step 3: NTP Server
$sudo apt-get install ntp
$sudo nano /etc/ntp.conf, add the following lines:

server ntp.ubuntu.com
server 127.127.1.0
fudge 127.127.1.0 stratum 10

$sudo service ntp restart

Step 4: MySQL
$sudo apt-get install mysql-server python-mysqldb
The password of Root is set as mysqlsecret
$sudo /etc/mysql/my.cnf, change the line bind-address = 127.0.0.1 to bind-address = 0.0.0.0
$sudo restart mysql


Create databases and users:
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE DATABASE nova;’
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE USER novadbadmin;’
$sudo mysql -uroot -pmysqlsecret -e “GRANT ALL PRIVILEGES ON nova.* TO ‘novadbadmin’@’%’;”
$sudo mysql -uroot -pmysqlsecret -e “SET PASSWORD FOR ‘novadbadmin’@’%’ = PASSWORD(‘novasecret’);”
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE DATABASE glance;’
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE USER glancedbadmin;’
$sudo mysql -uroot -pmysqlsecret -e “GRANT ALL PRIVILEGES ON glance.* TO ‘glancedbadmin’@’%’;”
$sudo mysql -uroot -pmysqlsecret -e “SET PASSWORD FOR ‘glancedbadmin’@’%’ = PASSWORD(‘glancesecret’);”
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE DATABASE keystone;’
$sudo mysql -uroot -pmysqlsecret -e ‘CREATE USER keystonedbadmin;’
$sudo mysql -uroot -pmysqlsecret -e “GRANT ALL PRIVILEGES ON keystone.* TO ‘keystonedbadmin’@’%’;”
$sudo mysql -uroot -pmysqlsecret -e “SET PASSWORD FOR ‘keystonedbadmin’@’%’ = PASSWORD(‘keystonesecret’);”

Step 5: Keystone, please pay very close attention to this step!
$sudo apt-get install keystone python-keystone python-keystoneclient
$sudo /etc/keystone/keystone.conf, make some changes:
admin_token = ADMIN to admin_token = admin
connection = sqlite:////var/lib/keystone/keystone.db to connection = mysql://keystonedbadmin:keystonesecret@192.168.230.41/keystone
$sudo service keystone restart
$sudo keystone-manage db_sync
$export SERVICE_ENDPOINT=”http://localhost:35357/v2.0″
$export SERVICE_TOKEN=admin
Appending the above 2 export line to ~/.bashrc using $sudo nano ~/.bashrc
$keystone tenant-create –name admin
$keystone tenant-create –name service
$keystone user-create –name admin –pass admin –email admin@foobar.com
$keystone user-create –name nova –pass nova –email nova@foobar.com
$keystone user-create –name glance –pass glance –email glance@foobar.com
$keystone user-create –name swift –pass swift –email swift@foobar.com
$keystone role-create –name admin
$keystone role-create –name Member

$keystone user-role-add –user $USER_ID –role $ROLE_ID –tenant_id $TENANT_ID
(replace USER_ID, ROLE_ID and TENANT_ID with the correct ones, please refer to the official guide to have more details)

$keystone service-create –name nova –type compute –description ‘OpenStack Compute Service’
$keystone service-create –name volume –type volume –description ‘OpenStack Volume Service’
$keystone service-create –name glance –type image –description ‘OpenStack Image Service’
$keystone service-create –name swift –type object-store –description ‘OpenStack Storage Service’
$keystone service-create –name keystone –type identity –description ‘OpenStack Identity Service’
$keystone service-create –name ec2 –type ec2 –description ‘EC2 Service’

Replace the corresponding_*_id in the following command with the correct ones in your case:

$keystone endpoint-create –region myregion –service_id corresponding_nova-compute_id –publicurl ‘http://192.168.230.41:8774/v2/$(tenant_id)s’ –adminurl ‘http://192.168.230.41:8774/v2/$(tenant_id)s’ –internalurl ‘http://192.168.230.41:8774/v2/$(tenant_id)s’
$keystone endpoint-create –region myregion –service_id corresponding_nova-volume_id –publicurl ‘http://192.168.230.41:8776/v1/$(tenant_id)s’ –adminurl ‘http://192.168.230.41:8776/v1/$(tenant_id)s’ –internalurl ‘http://192.168.230.41:8776/v1/$(tenant_id)s’
$keystone endpoint-create –region myregion –service_id corresponding_glance_id –publicurl ‘http://192.168.230.41:9292/v1’ –adminurl ‘http://192.168.230.41:9292/v1’ –internalurl ‘http://192.168.230.41:9292/v1’
$keystone endpoint-create –region myregion –service_id corresponding_swift_id –publicurl ‘http://192.168.230.41:8080/v1/AUTH_$(tenant_id)s’ –adminurl ‘http://192.168.230.41:8080/v1’ –internalurl ‘http://192.168.230.41:8080/v1/AUTH_$(tenant_id)s’
$keystone endpoint-create –region myregion –service_id corresponding_keystone_id –publicurl http://192.168.230.41:5000/v2.0 –adminurl http://192.168.230.41:35357/v2.0 –internalurl http://192.168.230.41:5000/v2.0
$keystone endpoint-create –region myregion –service_id corresponding_ec2_id –publicurl http://192.168.230.41:8773/services/Cloud –adminurl http://192.168.230.41:8773/services/Admin –internalurl http://192.168.230.41:8773/services/Cloud

Step 6:Glance
$sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance
$sudo nano /etc/glance/glance-api-paste.ini, change the last 3 lines to

admin_tenant_name = service
admin_user = glance
admin_password = glance

$sudo nano /etc/glance/glance-registry-paste.ini, make the similar change
$sudo nano /etc/glance/glance-registry.conf, replace the sql_connection config
sql_connection = mysql://glancedbadmin:glancesecret@192.168.230.41/glance
And append this:

[paste_deploy]
flavor = keystone

$sudo nano /etc/glance/glance-api.conf, append 2 lines:

[paste_deploy]
flavor = keystone

$sudo glance-manage version_control 0
$sudo glance-manage db_sync

$sudo restart glance-api
$sudo restart glance-registry
$export SERVICE_TOKEN=admin
$export OS_TENANT_NAME=admin
$export OS_USERNAME=admin
$export OS_PASSWORD=admin
$export OS_AUTH_URL=”http://localhost:5000/v2.0/”
$export SERVICE_ENDPOINT=http://localhost:35357/v2.0
Appending the above export line to the end of the file ~/.bashrc
$glance index
If you get the following error:

Failed to show index. Got error:
There was an error connecting to a server
Details: [Errno 111] Connection refused

That means you made some mistake in the step 5, carefully check it to eliminate the typo. You should delete the wrong entry and create new one. The following commands should be executed when all typo has been replaced:
$sudo glance-manage db_sync
$sudo restart glance-api
$sudo restart glance-registry
$glance index


Step7: Nova
$sudo apt-get install nova-api nova-cert nova-compute nova-compute-kvm nova-doc nova-network nova-objectstore nova-scheduler nova-volume rabbitmq-server novnc nova-consoleauth
$sudo nano /etc/nova/nova.conf


–dhcpbridge_flagfile=/etc/nova/nova.conf
–dhcpbridge=/usr/bin/nova-dhcpbridge
–logdir=/var/log/nova
–state_path=/var/lib/nova
–lock_path=/run/lock/nova
–allow_admin_api=true
–use_deprecated_auth=false
–auth_strategy=keystone
–scheduler_driver=nova.scheduler.simple.SimpleScheduler
–s3_host=192.168.230.41
–ec2_host=192.168.230.41
–rabbit_host=192.168.230.41
–cc_host=192.168.230.41
–nova_url=http://192.168.230.41:8774/v1.1/
–routing_source_ip=192.168.230.41
–glance_api_servers=192.168.230.41:9292
–image_service=nova.image.glance.GlanceImageService
–iscsi_ip_prefix=192.168.4
–sql_connection=mysql://novadbadmin:novasecret@192.168.230.41/nova
–ec2_url=http://192.168.230.41:8773/services/Cloud
–keystone_ec2_url=http://192.168.230.41:5000/v2.0/ec2tokens
–api_paste_config=/etc/nova/api-paste.ini
–libvirt_type=kvm
–libvirt_use_virtio_for_bridges=true
–start_guests_on_host_boot=true
–resume_guests_state_on_host_boot=true
# vnc specific configuration
–novnc_enabled=true
–novncproxy_base_url=http://192.168.230.41:6080/vnc_auto.html
–vncserver_proxyclient_address=192.168.230.41
–vncserver_listen=192.168.230.41
# network specific settings
–network_manager=nova.network.manager.FlatDHCPManager
–public_interface=eth0
–flat_interface=eth1
–flat_network_bridge=br100
–fixed_range=192.168.4.1/27
–floating_range=192.168.230.41/27
–network_size=32
–flat_network_dhcp_start=192.168.4.33
–flat_injected=False
–force_dhcp_release
–iscsi_helper=tgtadm
–connection_type=libvirt
–root_helper=sudo nova-rootwrap
–verbose=False

Verbose=False is different from the official guide but needed, unless you come across error when run the sync command. If you run nova-compute on a virtual machine, just remember to use qemu instead of kvm.

$sudo pvcreate /dev/sda6
$sudo vgcreate nova-volumes /dev/sda6
$sudo chown -R nova:nova /etc/nova
$sudo chmod 644 /etc/nova/nova.conf
$sudo nano /etc/nova/api-paste.ini,change the last 3 lines to:

admin_tenant_name = service
admin_user = nova
admin_password = nova

$sudo nova-manage db sync
$sudo nova-manage network create private –fixed_range_v4=192.168.4.32/27 –num_networks=1 –bridge=br100 –bridge_interface=eth1 –network_size=32

$export OS_TENANT_NAME=admin
$export OS_USERNAME=admin
$export OS_PASSWORD=admin
$export OS_AUTH_URL=”http://localhost:5000/v2.0/”

$sudo restart libvirt-bin; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart nova-consoleauth;
Be sure that all services have been normally started unless you cannot ssh to instance.

$sudo apt-get install openstack-dashboard
$sudo service apache2 restart
Login with username ‘admin’ and password ‘admin’

Now we come to the end of part I. In the second part, we will run instance and install wordpress on the instance, and we also intall swift as well as deal with dashboard.

Categories: Virtualization Tags:
  1. neo0
    July 9, 2012 at 12:05 AM

    Great guide! Have you tried to add more compute nodes? I flailed with VlanManger. How about the br100? Don’t we need to configure it in /etc/network/interfaces?

    • July 9, 2012 at 10:02 AM

      when we use FlatDHCP, the FlatDHCPManager creates br100 automatically so you needn’t to manually create it. I’ll try to add more nodes in near future :) Hope that’ll be fine

  2. neo0
    July 11, 2012 at 5:42 PM

    You should try to add more compute nodes. I stuck with the nova network mode on compute node. It can not assign fixed IP to the instance.

  3. Linh
    August 7, 2012 at 5:42 PM

    Thank cat123vn.
    It’s indeed very nice tutorial.
    I have tried to install Openstack multiple-nodes. At the first installation, it works perfectly; but after I shut down and restart the controller node (equivalent to Server 1 in Manual Script), I have a problem with creating the nova schema in MySQL database (“sudo nova-manage db sync”, it throws an error when I tried this command). Do you ever encounter and know how to resolve this problem?

    • August 10, 2012 at 6:03 PM

      many people complain the same thing when using manual script. Do you follow my instruction above? Can you post your db sync error?

  4. Linh
    August 10, 2012 at 9:12 PM

    Hi Cat,
    Thank you for your reply. I did both your instruction and manual script of Openstack. Both instructions work well, but only for the first installation. When I restart VMs, I had problem with controller node. For more details:
    $ sudo nova-manage db sync

    “2012-08-10 14:56:16 DEBUG nova.utils [-] backend from (pid=4405) __get_backend /usr/lib/python2.7/dist-packages/nova/utils.py:658
    2012-08-10 14:56:16 WARNING nova.utils [-] /usr/lib/python2.7/dist-packages/sqlalchemy/pool.py:639: SADeprecationWarning: The ‘listeners’ argument to Pool (and create_engine()) is deprecated. Use event.listen().
    Pool.__init__(self, creator, **kw)

    2012-08-10 14:56:16 WARNING nova.utils [-] /usr/lib/python2.7/dist-packages/sqlalchemy/pool.py:145: SADeprecationWarning: Pool.add_listener is deprecated. Use event.listen()
    self.add_listener(l)”

    And the result is that when I type “sudo nova-manage service list” to check the service, I see that service nova-compute does not work. And of course it throws a error when I try to launch an instance in dashboard.
    It’s my pleasue to hear your idea.
    Btw, I install openstack in VM which is created by virt-manager.

    • August 10, 2012 at 11:54 PM

      Did you set –verbose=False? However, I guess that’s not sync error.
      Sometime some service has not been restarted after you reboot the system. So remember to check that (including nova-storage) and restart the failed one.

      • Linh
        August 14, 2012 at 4:24 PM

        Hi Cat. Thank you, I didn’t notice to set verbose=False.
        So far, everything seems to be ok, all services are activated properly. However, I still cannot launch an instance in dashboad. Its status is error whenever I try to launch one.

  5. August 14, 2012 at 4:29 PM

    When you try to install on a virtual machine, you should use qemu instead of kvm? that is to set –libvirt_type=qemu in nova.conf. Did you do that?

    • Bao
      September 13, 2012 at 4:15 PM

      In the nova.conf file, I use –libvirt_type=kvm and it works anyway :-)

  6. Linh
    August 14, 2012 at 8:13 PM

    When I change from kvm to qemu, and restart all service of nova, I encounter the same problem. I still cannot launch an instance although all services are working properly. I also check the status of some service such that nova-api, nova-scheduler, nova-compute, nova-network, nova-cert, all of them are running.

  7. August 14, 2012 at 9:18 PM

    Is nova-objectstore working properbly?($sudo start nova-objectstore). Note that this component doesn’t appear when we use the command $sudo nova-manage service list

  8. Linh
    August 15, 2012 at 8:41 PM

    I have a check that nova-objectstore’s running. And I still cannot launch an instance.

  9. Linh
    August 15, 2012 at 8:48 PM

    Btw, there is something very strange happens. When I tried to launch instance, sometimes I did successful, but most of the case I failed to launch (I didn’t change anything in the controller node in both case). I definitely don’t know what is going on.

  10. August 15, 2012 at 9:47 PM

    Also make sure that you have enough RAM to run instance. Maybe virtual machine is not ideal environment to install openstack.

  11. Linh
    August 17, 2012 at 3:43 PM

    Thank you so much indeed. My problem has been solved. It’s just because the limited capacity of VM. I always create and terminate instance, but the instance is not completely deleted and it occurs the problem.
    I use phpmyadmin as you mention and delete all instance, restart the computer and it now works perfectly.

  12. August 17, 2012 at 9:00 PM

    It’s nice to hear your good news. You are welcome.

  13. Abdellatif
    October 6, 2012 at 6:54 PM

    i have the probleme when i execute sudo nova-manager db sync
    i changed :
    –libvirt_type=qemu
    –verbose=False

    also when i try to resart nova-network :

    sudo restart nova-compute;
    restart : unkown instance :

  14. October 7, 2012 at 9:15 AM

    ” unkown instance ” occurs sometime, just start that service alone

  15. oumarsyr
    August 19, 2014 at 1:32 AM

    Hello, i have a probleme when executing nova-manager db sync; I need help!!!

    root@snugb-srv02:~# nova-manage db sync
    2014-08-18 17:09:10 DEBUG nova.utils [-] backend from (pid=7943) __get_backend /usr/lib/python2.7/dist-packages/nova/utils.py:663
    2014-08-18 17:09:10 WARNING nova.utils [-] /usr/lib/python2.7/dist-packages/sqlalchemy/pool.py:639: SADeprecationWarning: The ‘listeners’ argument to Pool (and create_engine()) is deprecated. Use event.listen().
    Pool.__init__(self, creator, **kw)

    2014-08-18 17:09:10 WARNING nova.utils [-] /usr/lib/python2.7/dist-packages/sqlalchemy/pool.py:145: SADeprecationWarning: Pool.add_listener is deprecated. Use event.listen()
    self.add_listener(l)

  16. February 15, 2016 at 6:13 PM

    hii,I am installing openstack as per your notes but i have problem while running nova-network create command and also openstack dashboard does not show instance ip in interface

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: