OpenStack Newton Installation / Ubuntu 16.04 Environment
1. Installation Environment
The installation environment is as follows:
- VirtualBox 5.0.14r
- Controller Node : Ubuntu Server 16.04.2 64bit x1
- Compute Node : Ubuntu Server 16.04.2 64bit x1
- Block Storage Node : Ubuntu Server 16.04.2 64bit x1
- OpenStack Newton Version
- Network : Self-service
- Password
- All passwords required for OpenStack installation are unified to root for simplified installation.
- Installation is performed as root user on all nodes.
2. Node Configuration
![[Figure 1] Node Configuration Diagram for OpenStack Newton Installation](/blog-software/docs/record/openstack-newton-installation-ubuntu-16.04/images/node-setting.png)
[Figure 1] Node Configuration Diagram for OpenStack Newton Installation
Create virtual Controller, Compute, and Storage Nodes (VMs) using VirtualBox as shown in [Figure 1].
- NAT : Build a 10.0.0/24 network using VirtualBox’s “NAT network”.
- Router : Build a 192.168.77.0/24 network using a router. (NAT)
- After Horizon installation, access http://192.168.77.170/horizon from a PC web browser to use Horizon.
2.1. All Nodes
2.1.1. Network Configuration
| |
Create the /etc/hosts file with the contents of [Text 1].
2.1.1. OpenStack Package Installation
(All)$ apt install software-properties-common
(All)$ add-apt-repository cloud-archive:newtonAdd the OpenStack package repository.
(All)$ apt update && apt dist-upgrade
(All)$ apt install python-openstackclientInstall OpenStack packages.
2.2. Controller Node
2.2.1. Network Configuration
| |
Modify /etc/network/interfaces as shown in [Text 2].
2.2.2. NTP (Network Time Protocol) Configuration
(Controller)$ apt install chronyInstall the chrony package.
| |
Add the contents of [Text 3] to /etc/chrony/chrony.conf.
(Controller)$ service chrony restartRestart chrony.
2.2.3. SQL Database Installation
(Controller)$ apt install mariadb-server python-pymysqlInstall the MariaDB package.
| |
Create /etc/mysql/mariadb.conf.d/99-openstack.cnf and modify it as shown in [Text 4].
(Controller)$ service mysql restartRestart MariaDB.
2.2.4. Message Queue Installation
(Controller)$ apt install rabbitmq-serverInstall the RabbitMQ package.
(Controller)$ rabbitmqctl add_user openstack root
(Controller)$ rabbitmqctl set_permissions openstack ".\*" ".\*" ".\*"Configure RabbitMQ.
2.2.5. Memcached Installation
(Controller)$ apt install memcached python-memcacheInstall the Memcached package.
| |
Add the contents of [Text 5] to /etc/memcached.conf.
2.2.6. Environment Variable File Creation
| |
Create /root/admin-openrc and modify it as shown in [Text 6].
| |
Create /root/demo-openrc and modify it as shown in [Text 7].
2.3. Compute Node
2.3.1. Network Configuration
| |
Modify /etc/network/interfaces as shown in [Text 8].
2.3.2. NTP (Network Time Protocol) Configuration
(Compute)$ apt install chronyInstall the chrony package.
| |
Add the contents of [Text 9] to /etc/chrony/chrony.conf.
(Compute)$ service chrony restartRestart chrony.
2.4. Storage Node
2.4.1, Network Configuration
| |
Modify /etc/network/interfaces as shown in [Text 10].
2.4.2. NTP (Network Time Protocol) Configuration
(Storage)$ apt install chronyInstall the chrony package.
| |
Add the contents of [Text 11] to /etc/chrony/chrony.conf.
(Storage)$ service chrony restartRestart chrony.
3. Keystone Installation
3.1. Controller Node
(Controller)$ mysql -u root -p
mysql> CREATE DATABASE keystone;
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'root';
mysql> exit;Initialize the Keystone database.
(Controller)$ apt install keystoneInstall the Keystone package.
| |
Add the contents of [Text 12] to /etc/keystone/keystone.conf.
(Controller)$ su -s /bin/sh -c "keystone-manage db_sync" keystone
(Controller)$ keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
(Controller)$ keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
(Controller)$ keystone-manage bootstrap --bootstrap-password root --bootstrap-admin-url http://controller:35357/v3/ --bootstrap-internal-url http://controller:35357/v3/ --bootstrap-public-url http://controller:5000/v3/ --bootstrap-region-id RegionOneConfigure Keystone.
| |
Add the contents of [Text 13] to /etc/apache2/apache2.conf.
(Controller)$ service apache2 restart
(Controller)$ rm -f /var/lib/keystone/keystone.dbRestart the Apache HTTP Server and remove the database.
(Controller)$ export OS_USERNAME=admin
(Controller)$ export OS_PASSWORD=root
(Controller)$ export OS_PROJECT_NAME=admin
(Controller)$ export OS_USER_DOMAIN_NAME=Default
(Controller)$ export OS_PROJECT_DOMAIN_NAME=Default
(Controller)$ export OS_AUTH_URL=http://controller:35357/v3
(Controller)$ export OS_IDENTITY_API_VERSION=3Set environment variables.
(Controller)$ openstack project create --domain default --description "Service Project" service
(Controller)$ openstack project create --domain default --description "Demo Project" demo
(Controller)$ openstack user create --domain default --password-prompt demo
(Controller)$ openstack role create user
(Controller)$ openstack role add --project demo --user demo userCreate and configure Projects, Users, and Roles.
3.2. Verification
# openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name admin --os-username admin token issue
+------------+-----------------------------------------------------------------+
| Field | Value |
+------------+-----------------------------------------------------------------+
| expires | 2016-02-12T20:14:07.056119Z |
| id | gAAAAABWvi7_B8kKQD9wdXac8MoZiQldmjEO643d-e_j-XXq9AmIegIbA7UHGPv |
| | atnN21qtOMjCFWX7BReJEQnVOAj3nclRQgAYRsfSU_MrsuWb4EDtnjU7HEpoBb4 |
| | o6ozsA_NmFWEpLeKy0uNn_WeKbAhYygrsmQGA49dclHVnz-OMVLiyM9ws |
| project_id | 343d245e850143a096806dfaefa9afdc |
| user_id | ac3377633149401296f6c0d92d79dc16 |
+------------+-----------------------------------------------------------------+# openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name demo --os-username demo token issue
+------------+-----------------------------------------------------------------+
| Field | Value |
+------------+-----------------------------------------------------------------+
| expires | 2016-02-12T20:15:39.014479Z |
| id | gAAAAABWvi9bsh7vkiby5BpCCnc-JkbGhm9wH3fabS_cY7uabOubesi-Me6IGWW |
| | yQqNegDDZ5jw7grI26vvgy1J5nCVwZ_zFRqPiz_qhbq29mgbQLglbkq6FQvzBRQ |
| | JcOzq3uwhzNxszJWmzGC7rJE_H0A_a3UFhqv8M4zMRYSbS2YF0MyFmp_U |
| project_id | ed0b60bf607743088218b0a533d5943f |
| user_id | 58126687cbcc4888bfa9ab73a2256f27 |
+------------+-----------------------------------------------------------------+Verify Keystone operation on the Controller Node.
4. Glance Installation
4.1. Controller Node
(Controller)$ mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'root';
mysql> exit;Initialize the Glance database.
(Controller)$ . /root/admin-openrc
(Controller)$ openstack user create --domain default --password-prompt glance
(Controller)$ openstack role add --project service --user glance admin
(Controller)$ openstack service create --name glance --description "OpenStack Image" imageCreate and configure the Glance user.
(Controller)$ openstack endpoint create --region RegionOne image public http://controller:9292
(Controller)$ openstack endpoint create --region RegionOne image internal http://controller:9292
(Controller)$ openstack endpoint create --region RegionOne image admin http://controller:9292Create Glance service API endpoints.
(Controller)$ apt install glanceInstall the Glance package.
| |
Add the contents of [Text 14] to /etc/glance/glance-api.conf.
| |
Add the contents of [Text 15] to /etc/glance/glance-registry.conf.
(Controller)$ su -s /bin/sh -c "glance-manage db_sync" glance
(Controller)$ service glance-registry restart
(Controller)$ service glance-api restartConfigure and start Glance.
4.2. Verification
(Controller)$ . /root/admin-openrc
(Controller)$ wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
(Controller)$ openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
(Controller)$ openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | active |
+--------------------------------------+--------+--------+Verify Glance operation on the Controller Node.
5. Nova Installation
5.1. Controller Node
(Controller)$ mysql -u root -p
mysql> CREATE DATABASE nova_api;
mysql> CREATE DATABASE nova;
mysql> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'root';
mysql> exit;Initialize the Nova database.
(Controller)$ . /root/admin-openrc
(Controller)$ openstack user create --domain default --password-prompt nova
(Controller)$ openstack role add --project service --user nova admin
(Controller)$ openstack service create --name nova --description "OpenStack Compute" computeCreate and configure the Nova user.
(Controller)$ openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)sCreate Nova service API endpoints.
(Controller)$ apt install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler
(Controller)$ mkdir /usr/lib/python2.7/dist-packages/keysInstall the Nova package.
| |
Add the contents of [Text 16] to /etc/nova/nova.conf.
(Controller)$ su -s /bin/sh -c "nova-manage api_db sync" nova
(Controller)$ su -s /bin/sh -c "nova-manage db sync" nova
(Controller)$ service nova-api restart
(Controller)$ service nova-consoleauth restart
(Controller)$ service nova-scheduler restart
(Controller)$ service nova-conductor restart
(Controller)$ service nova-novncproxy restartConfigure and start Nova.
5.2. Compute Node
(Compute)$ apt install nova-computeInstall the Nova package.
| |
Add the contents of [Text 17] to /etc/nova/nova.conf.
| |
Since the current VirtualBox VM cannot use CPU virtualization extensions like Intel VT-X, the Compute Node cannot use KVM+QEMU combination for virtual machines and must use QEMU only. Modify /etc/nova/nova-compute.conf as shown in [Text 18].
(Compute)$ service nova-compute restartStart Nova.
5.3. Verification
(Contorller)$ . /root/admin-openrc
(Contorller)$ openstack compute service list
+----+--------------------+------------+----------+---------+-------+----------------------------+
| Id | Binary | Host | Zone | Status | State | Updated At |
+----+--------------------+------------+----------+---------+-------+----------------------------+
| 1 | nova-consoleauth | controller | internal | enabled | up | 2016-02-09T23:11:15.000000 |
| 2 | nova-scheduler | controller | internal | enabled | up | 2016-02-09T23:11:15.000000 |
| 3 | nova-conductor | controller | internal | enabled | up | 2016-02-09T23:11:16.000000 |
| 4 | nova-compute | compute1 | nova | enabled | up | 2016-02-09T23:11:20.000000 |
+----+--------------------+------------+----------+---------+-------+----------------------------+Verify Nova operation on the Controller Node.
6. Neutron Installation
6.1. Controller Node
(Contorller)$ mysql -u root -p
mysql> CREATE DATABASE neutron;
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'root';
mysql> exit;Initialize the Neutron database.
(Contorller)$ . /root/admin-openrc
(Contorller)$ openstack user create --domain default --password-prompt neutron
(Contorller)$ openstack role add --project service --user neutron admin
(Contorller)$ openstack service create --name neutron --description "OpenStack Networking" networkCreate and configure the Neutron user.
(Contorller)$ openstack endpoint create --region RegionOne network public http://controller:9696
(Contorller)$ openstack endpoint create --region RegionOne network internal http://controller:9696
(Contorller)$ openstack endpoint create --region RegionOne network admin http://controller:9696Create Neutron service API endpoints.
(Contorller)$ apt install neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent neutron-metadata-agentInstall the Neutron package.
| |
Add the contents of [Text 19] to /etc/neutron/neutron.conf.
| |
Add the contents of [Text 20] to /etc/neutron/plugins/ml2/ml2_conf.ini.
| |
Add the contents of [Text 21] to /etc/neutron/plugins/ml2/linuxbridge_agent.ini.
| |
Add the contents of [Text 22] to /etc/neutron/l3_agent.ini.
| |
Add the contents of [Text 23] to /etc/neutron/dhcp_agent.ini.
| |
Add the contents of [Text 24] to /etc/neutron/metadata_agent.ini.
| |
Add the contents of [Text 25] to /etc/nova/nova.conf.
(Contorller)$ su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
(Contorller)$ service nova-api restart
(Contorller)$ service neutron-server restart
(Contorller)$ service neutron-linuxbridge-agent restart
(Contorller)$ service neutron-dhcp-agent restart
(Contorller)$ service neutron-metadata-agent restart
(Contorller)$ service neutron-l3-agent restartStart Neutron.
6.2. Compute Node
(Compute)$ apt install neutron-linuxbridge-agentInstall the Neutron package.
| |
Add the contents of [Text 26] to /etc/neutron/neutron.conf.
| |
Add the contents of [Text 27] to /etc/neutron/plugins/ml2/linuxbridge_agent.ini.
| |
Add the contents of [Text 28] to /etc/nova/nova.conf.
(Compute)$ service nova-compute restart
(Compute)$ service neutron-linuxbridge-agent restartStart Neutron.
6.3. Verification
(Compute)$ . /root/admin-openrc
(Compute)$ neutron ext-list
+---------------------------+-----------------------------------------------+
| alias | name |
+---------------------------+-----------------------------------------------+
| default-subnetpools | Default Subnetpools |
| network-ip-availability | Network IP Availability |
| network_availability_zone | Network Availability Zone |
| auto-allocated-topology | Auto Allocated Topology Services |
| ext-gw-mode | Neutron L3 Configurable external gateway mode |
| binding | Port Binding |
| agent | agent |
| subnet_allocation | Subnet Allocation |
| l3_agent_scheduler | L3 Agent Scheduler |
| tag | Tag support |
| external-net | Neutron external network |
| net-mtu | Network MTU |
| availability_zone | Availability Zone |
| quotas | Quota management support |
| l3-ha | HA Router extension |
| flavors | Neutron Service Flavors |
| provider | Provider Network |
| multi-provider | Multi Provider Network |
| address-scope | Address scope |
| extraroute | Neutron Extra Route |
| timestamp_core | Time Stamp Fields addition for core resources |
| router | Neutron L3 Router |
| extra_dhcp_opt | Neutron Extra DHCP opts |
| dns-integration | DNS Integration |
| security-group | security-group |
| dhcp_agent_scheduler | DHCP Agent Scheduler |
| router_availability_zone | Router Availability Zone |
| rbac-policies | RBAC Policies |
| standard-attr-description | standard-attr-description |
| port-security | Port Security |
| allowed-address-pairs | Allowed Address Pairs |
| dvr | Distributed Virtual Router |
+---------------------------+-----------------------------------------------+Verify Neutron operation on the Compute Node.
7. Horizon Installation
7.1. Controller Node
(Controller)$ apt install openstack-dashboardInstall the Horizon package.
| |
Modify /etc/openstack-dashboard/local_settings.py as shown in [Code 1].
(Controller)$ service apache2 reloadStart Horizon.
7.2. Verification
Access Horizon through a web browser.
- http://192.168.77.170/horizon
- Login : Domain - default, Username - admin, Password - root
8. Cinder Installation
8.1. Compute Node
| |
Add the contents of [Text 29] to /etc/nova.nova.conf.
8.2. Controller Node
(Controller)$ mysql -u root -p
mysql> CREATE DATABASE cinder;
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'root';
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'root';
> exit;Initialize the Cinder database.
(Controller)$ . admin-openrc
(Controller)$ openstack user create --domain default --password-prompt cinder
(Controller)$ openstack role add --project service --user cinder admin
(Controller)$ openstack service create --name cinder --description "OpenStack Block Storage" volume
(Controller)$ openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2Create and configure the Cinder user.
(Controller)$ openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(tenant_id\)s
(Controller)$ openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(tenant_id\)sCreate Cinder service API endpoints.
(Controller)$ su -s /bin/sh -c "cinder-manage db sync" cinder
(Controller)$ apt install cinder-api cinder-schedulerInstall the Cinder package.
| |
Add the contents of [Text 30] to /etc/cinder/cinder.conf.
(Controller)$ service nova-api restart
(Controller)$ service cinder-scheduler restart
(Controller)$ service cinder-api restartStart Cinder.
8.3. Storage Node
(Storage)$ apt install lvm2
(Storage)$ pvcreate /dev/sdb
(Storage)$ vgcreate cinder-volumes /dev/sdbInstall and configure LVM.
| |
Add the contents of [Text 31] to /etc/lvm/lvm.conf.
(Storage)$ apt install cinder-volumeInstall the Cinder package.
| |
Add the contents of [Text 32] to /etc/cinder/cinder.conf.
(Storage)$ service tgt restart
(Storage)$ service cinder-volume restartStart Cinder.
8.4. Verification
(Controller)$ . admin-openrc
(Controller)$ openstack volume service list
+------------------+------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated_at |
+------------------+------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up | 2016-09-30T02:27:41.000000 |
| cinder-volume | block@lvm | nova | enabled | up | 2016-09-30T02:27:46.000000 |
+------------------+------------+------+---------+-------+----------------------------+Verify Cinder operation on the Controller Node.
9. References
- OpenStack Installation Korean : https://docs.openstack.org/newton/install-guide-ubuntu/
- OpenStack Installation English : https://docs.openstack.org/newton/ko_KR/install-guide-ubuntu/