This is English version Japanese is here.
This article describe how to install Openstack ocata and OpenContrail 4.0 which are uploaded at Dockerhub.
There are 4 Ubuntu 16.04 Virtual machines spawned KVM and each roles are below. Spawned Virtual machines must have more than 2 NICs. (Openstack kolla requirements)
All of Installation and provisioning are don by kolla1.
** In case of KVM, must enable "nested" on KVM host and VMX attribute on Virtual machine.
Servers:
kolla1(10.84.50.117): Openstack Controller/Ansible
kolla2(10.84.50.118): Contrail Controller
kolla3(10.84.50.119): Compute node
kolla4(10.84.50.120): Compute node
Procedure:
If you need to modify password, use this file.
Install dependency file and export variable to ignore ssh key verification.
Next article describes how to configure Simple Gateway to connect outside of OpenContrail.
Refference
https://gitlab.com/gokulpch/OpenContrail-Kolla/blob/master/README.md
All of Installation and provisioning are don by kolla1.
** In case of KVM, must enable "nested" on KVM host and VMX attribute on Virtual machine.
Servers:
kolla1(10.84.50.117): Openstack Controller/Ansible
kolla2(10.84.50.118): Contrail Controller
kolla3(10.84.50.119): Compute node
kolla4(10.84.50.120): Compute node
Procedure:
- Preparation
- Install/Download Ansible and Playbook
- Install
- Configuration after Installation
- Operation check
1.Preparation
Create CA and register target servers because of Kolla1 connects to all of nodes as Root.
Execute Kolla1
Preparation to use Ansible
Execute Kolla1
Execute Kolla1
ssh-keygen -t rsa
Execute command below to all of nodes.ssh-copy-id -i ~/.ssh/id_rsa.pub lab@10.84.50.117
ssh -t lab@10.84.50.117 'sudo mkdir /root/.ssh'
ssh -t lab@10.84.50.117 'sudo cp /home/lab/.ssh/authorized_keys /root/.ssh/authorized_keys'
Preparation to use Ansible
Execute Kolla1
apt update
apt install python-pip sshpass
pip install -U pip
pip install -U ansible
pip install pyOpenSSL==16.2.0
Execute command below to all of nodes.ssh -t root@10.84.50.117 'apt-get -y install python-simplejson'
2. Download and Configure Ansible Playbook
Download install file from github.
git clone https://github.com/gokulpch/OpenContrail-Kolla.git
Two directories are available, contrail-ansible for OpenContrial and kolla-ansible for Opentack.Modify Configuration file of Openstack
Modify OpenContrail-Kolla/kolla-ansible/etc/kolla/globals.yml
Modifiy 4 items below;network_interface: "ens3"
kolla_internal_vip_address: "10.84.50.117"
contrail_api_interface_address: "10.84.50.118"
neutron_external_interface: "ens4"
- network_interface: Configure VM NIC which connects Underlay network
- kolla_internal_vip_address: Configure IP address of Openstack Controller
- contrail_api_interface_address: Configure IP address of OpenContrail Config node
- neutron_external_interface: Configure NIC as Fake NIC
Modify OpenContrail-Kolla/kolla-ansible/etc/kolla/passwords.yml
The file is configured password of each components.(default is contrail1)If you need to modify password, use this file.
Modify OpenContrail-Kolla/kolla-ansible/ansible/inventory/multinode
Modify [control] [network] [compute] [monitoring] [storage] items. An example below uses hostname. In case of using host name, must able to resolve IP address from hostname by /etc/hosts and so on.[control]
kolla1
[network]
kolla1
[compute]
kolla3
kolla4
[monitoring]
kolla1
[storage]
kolla1
Configure configuration file of OpenContrail
Modify OpenContrail-Kolla/contrail-ansible/playbooks/inventory/my-inventory/hosts
Modify [contrail-controllers] [contrail-analytics] [contrail-compute] [openstack-controllers] items. Must use IP address instead of host name otherwise OpenContrail doesn't work correctly.
[contrail-controllers]
10.84.50.118
[contrail-analyticsdb]
10.84.50.118
[contrail-analytics]
10.84.50.118
[contrail-compute]
10.84.50.119
10.84.50.120
[openstack-controllers]
10.84.50.117
Modify OpenContrail-Kolla/contrail-ansible/playbooks/inventory/my-inventory/group_vars/all.yml
Modify 5 items below;
ansible_ssh_private_key_file: ~/.ssh/id_rsa
global_config: { external_rabbitmq_servers: 10.84.50.117 }
rabbitmq_config: { user: openstack, password: contrail1 }
keystone_config: {ip: 10.84.50.117, admin_password: contrail1, auth_protocol: http}
vrouter_physical_interface: ens3
- ansible_ssh_private_key_file: Configure CA for login (uncomment this item. remove "#")
- global_config: Configure IP address of RabbitMQ
- rabbitmq_config: Configure password of RabbitMQ. Must modify if the password is modified at passwords.yml.
- keystone_config: Configure IP address and password of Keysone. Must modify if the password is modified at passwords.yml.
- vrouter_physical_interface: Configure NIC of vRouter of OpenContrailăŽ. If NIC is different of each Compute nodes, configure NIC at hosts file.
3.Install
Preparation for installation of Openstack
ssh -t root@10.84.50.117 'apt-get -y install python-oslo-config'
export ANSIBLE_HOST_KEY_CHECKING=False
Install Openstack
cd OpenContrail-Kolla/kolla-ansible/ansible/
ansible-playbook -i inventory/multinode -e @../etc/kolla/globals.yml -e @../etc/kolla/passwords.yml -e action=bootstrap-servers kolla-host.yml
ansible-playbook -i inventory/multinode -e @../etc/kolla/globals.yml -e @../etc/kolla/passwords.yml -e action=deploy site.yml
Preparation for installation of OpenContrail
Install Dockerssh -t root@10.84.50.118 'curl -sSL https://get.docker.io | bash'
Install OpenContrail
cd OpenContrail-Kolla/contrail-ansible/playbooks/
ansible -i inventory/my-inventory -m shell -a 'apt-get install -y ntp' all
ansible-playbook -i inventory/my-inventory site.yml
Reboot compute nodes
ssh -t root@10.84.50.119 reboot
ssh -t root@10.84.50.120 reboot
4.Configuration after installation
Fix a bug of horizon
docker exec -i horizon sudo sed -i -e 's:/usr/share/openstack-dashboard/static:/var/lib/openstack-dashboard/static:g' /etc/apache2/conf-enabled/000-default.conf
docker exec -i horizon /usr/share/openstack-dashboard/manage.py collectstatic --noinput
docker exec -i horizon /usr/share/openstack-dashboard/manage.py compress
docker exec -i horizon sudo service apache2 reload
Create openstackrc
echo 'export OS_USERNAME=admin
export OS_PASSWORD=contrail1
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://10.84.50.117:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2' > openstackrc
Install Openstack client
pip install python-openstackclient
Create flavor
source openstackrc
openstack flavor create --id 1 --disk 1 --ram 512 --public m1.tiny
openstack flavor create --id 2 --disk 20 --ram 2048 --public m1.small
openstack flavor create --id 3 --disk 40 --ram 4096 --public m1.medium
openstack flavor create --id 4 --disk 80 --ram 8192 --public m1.large
openstack flavor create --id 5 --disk 160 --ram 16384 --public m1.xlarge
5.Operation Check
Execute openstack network list. If 3 network date is returned, finish to install/provision Openstack and OpenContrail.+--------------------------------------+-------------------------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+-------------------------+--------------------------------------+
| a5432e6b-0155-4b13-abe8-e6290f6dc9fe | __link_local__ | |
| 5a58e2d9-88b1-4ff2-9e0f-e0ed5e4e72ce | default-virtual-network | |
| 65549c94-5ffc-4b30-9025-00a54813a695 | ip-fabric | |
+--------------------------------------+-------------------------+--------------------------------------+
Next article describes how to configure Simple Gateway to connect outside of OpenContrail.
Refference
https://gitlab.com/gokulpch/OpenContrail-Kolla/blob/master/README.md