logo

logo
Showing posts with label Installation. Show all posts
Showing posts with label Installation. Show all posts

Monday, 18 August 2014

Manually setup all-in-one OpenStack Icehouse 3 - keystoneGlance (Image Store)


1. package installation

apt-get install -y glance

2. Create database and credentials for Glance

In MySQL command prompt:
CREATE DATABASE glance;
GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance_dbpass';

3. Create glance related keystone entries

keystone user-create --name=glance --pass=glance_pass --email=glance@example.com
keystone user-role-add --user=glance --tenant=service --role=admin
keystone service-create --name=glance --type=image --description="Glance Image Service"
keystone endpoint-create --service=glance --publicurl=http://192.168.139.111:9292 --internalurl=http://192.168.139.111:9292 --adminurl=http://192.168.139.111:9292

4. Edit /etc/glance/glance-api.conf and edit the following lines

Hash out
# sqlite_db = /var/lib/glance/glance.sqlite
Add
connection = mysql://glance:glance_dbpass@192.168.139.111/glance

[keystone_authtoken]
auth_host = 192.168.139.111
auth_port = 5000
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance_pass

[paste_deploy]
flavor = keystone

Edit /etc/glance/glance-registry.conf and edit the following lines as below
Hash out
# sqlite_db = /var/lib/glance/glance.sqlite
Add
connection = mysql://glance:glance_dbpass@192.168.139.111/glance

[keystone_authtoken]
auth_host = 192.168.139.111
auth_port = 5000
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance_pass

[paste_deploy]
flavor = keystone

5. Restart Glance services and sync the database

service glance-api restart
service glance-registry restart
glance-manage db_sync

6.Download a pre-bundled image for testing

glance image-create --name Cirros --is-public true --container-format bare --disk-format qcow2 --location https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img

7. testing


glance index

Manually setup all-in-one OpenStack Icehouse 2 - keystone

1.       install the keystone package/service

commands: apt-get install -y keystone

2.       create database and username/password

in mysql client tool:
mysql> CREATE DATABASE keystone;
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone_dbpass';

3.       update keystone configuration file

in /etc/keystone/keystone.conf
hash out line
connection = sqlite:////var/lib/keystone/keystone.db
add line:
connection = mysql://keystone:keystone_dbpass@192.168.139.111/keystone

4.       restart keystone service and sync database

service keystone restart
keystone-manage db_sync

5.       export the environment variables

export OS_SERVICE_TOKEN=ADMIN
export OS_SERVICE_ENDPOINT=http://192.168.139.111:35357/v2.0

6.       data preparation(well explain later)

#tenant, user, role and user-role
keystone tenant-create --name=admin --description="Admin Tenant"
keystone tenant-create --name=service --description="Service Tenant"
keystone user-create --name=admin --pass=ADMIN --email=admin@example.com
keystone role-create --name=admin
keystone user-role-add --user=admin --tenant=admin --role=admin
#service
keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"
#end point
keystone endpoint-create --service=keystone --publicurl=http://192.168.139.111:5000/v2.0 --internalurl=http://192.168.139.111:5000/v2.0 --adminurl=http://192.168.139.111:35357/v2.0

7.       create confidential file and source it

export OS_USERNAME=admin
export OS_PASSWORD=ADMIN
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://192.168.139.111:35357/v2.0

8.       testing

keystone token-get
keystone user-list



Wednesday, 13 August 2014

Manually setup all-in-one OpenStack Icehouse 1 - preparation

Manually setup all-in-one OpenStack Icehouse 1 - preparation

DevStack is a cool tool to setup all-in-one OpenStack environment but it hides most of the details. To better understand how the each component of OpenStack is setup. here I tried to setup OpenStack Icehouse on the Ubuntu 14.4 manully following this blog

Setup/update the environment for OpenStack Icehouse

Configure the repositories and update the packages.
Commands:
apt-get install -y python-software-properties        -- this is to setup python environment
add-apt-repository cloud-archive:icehouse           -- this is to setup the icehouse repository
apt-get install -y ntp vlan bridge-utils                    -- this is to setup ntp vlan and other network utils
apt-get update && apt-get -y upgrade                 -- this is to update the packages and kernel
reboot                                                                   -- reboot the server

Setup RabbitMQ server, it seems no configuration for RabbitMQ
Commands:
apt-get install -y rabbitmq-server                         -- install rabbitmq server

Setup MySQL server, configure the my.cnf and restart MySQL
Commands:
apt-get install -y mysql-server python-mysqldb
edit the /etc/mysql/my.cnf file
add or modify the below configuration
[mysqld]
bind-address = 0.0.0.0                                       -- listen on all IPs
collation-server = utf8_general_ci                    -- setup collation
init-connect = 'SET NAMES utf8'                     -- characterset setting
character-set-server = utf8                                -- characterset setting
restart the MySQL
service mysql restart                                          -- restart MySQL

enable the kernel parameters in /etc/sysctl.conf

net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

Tuesday, 12 August 2014

Setup All-in-One OpenStack environment by using devstack

As OpenStack is a complicated software suit, it is not very easy to deploy OpenStack for beginners. Devstack is a very handy tool to deploy all-in-one openstack environment

1.       the box is installed with the ubuntu 14.4, the user is called stack

2.       update the system and packages
command: #sudo apt-get dist-upgrade
then reboot the machine

3.       make the /opt/stack world wide readable
commands:
#sudo chown -R stack:strack /opt/stack
#sudo chmod 777 /opt/stack

4.       install git
#sudo apt-getinstall git

5.       download openstack and checkout the Icehouse version
#sudo git checkout -b icehouseorigin/stable/icehouse

6.       upload the localrc configuration template
it should be in ~/devstack/


7.       deploy openstack
./stack.sh

After it is running for about 1 hour, you will have a full-in-one OpenStack environment