Deploy OpenStack Multinode dengan Kolla Ansible
Kali ini kita akan melakukan deployment OpenStack Multi Node menggunakan Kolla Ansible, namun sebelum itu kita harus mengetahui mengenai Openstack dan Kolla Ansible terlebih dahulu.
Apa itu OpenStack?
OpenStack ini adalah software IaaS opensource yang digunakan untuk mengelola kumpulan resource baik itu compute, storage, atau netwoking dalam suatu data center. OpenStack mirip seperti AWS atau Azure yang memungkinkan kita untuk membuat private dan public cloud kita sendiri dengan instance yang dibuat environment OpenStack.
OpenStack terbentuk dari beberapa service yang memiliki fungsi tersendiri. Karena OpenStack memiliki desain modular jadi kita bisa menggunakan service yang sesuai kebutuhan kita. Namun ada yang perlu diperhatikan.
Service pada OpenStack terdapat 2 macam, yaitu core service dan optional service. Core service menjadi inti dari OpenStack karena itu service tersebut harus ada, sedangkan optional service inilah yang tidak harus ada atau bisa kita sesuaikan dengan kebutuhan kita.
Core service OpenStack:
Keystone (identity service)
Glance (image service)
Nova (compute service)
Neutron (networking service)
Optinal service OpenStack:
Cinder (block storage service)
Horizon (dashboard)
Swift (object storage service)
Untuk lebih lengkap bisa dilihat disini.
Jadi itu untuk penjelasan OpenStack secara singkat.
Apa itu Kolla Ansible?
Kolla Ansible itu adalah salah satu deployment tools Openstack yang bisa kita gunakan. Kolla Ansible menggunakan fungsionalitas dari Ansible untuk upgrading, scalling, dan configuration operation dalam deployment OpenStack ke dalam container yang production-ready.
Kolla Ansible memudahkan kita untuk melakukan deployment dengan menyediakan ansible playbook yang bisa kita sesuaikan dengan mudah. Kolla Ansible juga mendukung setup all-in-one dan multi-node OpenStack, kali ini kita akan menggunakan untuk multi-node Openstack.
Itu untuk penjelasan Kolla Ansible secara singkat, untuk deployment tools yang lain bisa dilihat disini. Langsung saja kita mulai untuk langkah-langkahnya. Let's Goo...
Deployment OpenStack Multi Node
- Setup hostname untuk mempermudah mengenali node
sudo hostnamectl set-hostname alfian-controller
sudo hostnamectl set-hostname alfian-compute1
sudo hostnamectl set-hostname alfian-compute2
sudo vi /etc/hosts
...
10.7.7.10 alfian-controller
10.7.7.20 alfian-compute1
10.7.7.30 alfian-compute2
...
- Setup SSH untuk passwordless antar node
ssh-keygen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub student@alfian-controller
ssh-copy-id -i .ssh/id_rsa.pub student@alfian-compute1
ssh-copy-id -i .ssh/id_rsa.pub student@alfian-compute2
- Cek connectivity passwordless node
ssh student@alfian-controller "whoami; hostname"
ssh student@alfian-compute1 "whoami; hostname"
ssh student@alfian-compute2 "whoami; hostname"
- Setup VGS untuk service cinder
sudo pvcreate /dev/vdc
sudo vgcreate cinder-volumes /dev/vdc
sudo vgs
- Install dependensi kolla
sudo apt update -y
sudo apt-get install python3-dev libffi-dev gcc libssl-dev python3-selinux python3-setuptools python3-venv -y
- Install kolla di dalam virtual environment
python3 -m venv kolla-venv
source kolla-venv/bin/activate
pip install -U pip
pip install 'ansible>=4,<6'
pip install git+https://opendev.org/openstack/kolla-ansible@stable/zed
- Setup direktori untuk kolla
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
cp -r kolla-venv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
- Konfigurasi inventory multi node kolla
cp kolla-venv/share/kolla-ansible/ansible/inventory/* .
vi multinode
...
[control]
alfian-controller
[network]
alfian-controller
[compute]
alfian-compute1
alfian-compute2
[monitoring]
alfian-controller
[storage]
alfian-controller
alfian-compute1
alfian-compute2
[deployment]
localhost ansible_connection=local
...
- Konfigurasi ansible
sudo mkdir -p /etc/ansible
sudo nano /etc/ansible/ansible.cfg
...
[defaults]
host_key_checking=False
pipelining=True
forks=100
...
- Test connectivity ansible
ansible -i multinode all -m ping
- Generate password untuk deployment
kolla-genpwd
cat /etc/kolla/passwords.yml
- Konfigurasi OpenStack sesuai yang dibutuhkan
vi /etc/kolla/globals.yml
...
kolla_base_distro: "ubuntu"
kolla_install_type: "source"
openstack_release: "zed"
kolla_internal_vip_address: "10.7.7.100"
network_interface: "ens3"
neutron_external_interface: "ens4"
enable_openstack_core: "yes"
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes"
...
- Setup dependensi host sebelum deployment
kolla-ansible -i ./multinode bootstrap-servers
- Cek pre-deployement untuk host
kolla-ansible -i ./multinode prechecks
- Deploy OpenStack
kolla-ansible -i ./multinode deploy
- Mendapatkan admin-openrc.sh untuk akses cluster
kolla-ansible -i ./multinode post-deploy
- Install openstack client
pip install openstackclient
source /etc/kolla/admin-openrc.sh
- Verifikasi cluster OpenStack
openstack service list
+----------------------------------+-----------+----------------+
| ID | Name | Type |
+----------------------------------+-----------+----------------+
| 4adcb066ade24423887ae793b3c0b42d | cinderv3 | volumev3 |
| 4ba32f78fca04a99a5a7210ee0434ef9 | heat | orchestration |
| 58c4a98149974f06a8458e5a89cd45e9 | placement | placement |
| 5b12c10c867f46fdb227beb39078fa3c | neutron | network |
| 77169214b15549c9a3a5bfa55584c8ff | keystone | identity |
| 8c8b75ce5a284cb88d4efde48b8eb3ab | nova | compute |
| 9627b58f3e2e44018922ec12947466ff | glance | image |
| e9a7f800a8e040b3a69f760770551dd6 | heat-cfn | cloudformation |
+----------------------------------+-----------+----------------+
openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+
| 026182d64ad046a0b827d419809eda86 | RegionOne | placement | placement | True | internal | http://10.7.7.100:8780 |
| 359d362f581f4d6081eb4ff37b2f27cf | RegionOne | cinderv3 | volumev3 | True | internal | http://10.7.7.100:8776/v3/%(tenant_id)s |
| 3cebf67b792743a7890e0910e95e5389 | RegionOne | glance | image | True | public | http://10.7.7.100:9292 |
| 4c09d74f2584444b9793d374ca11fa3b | RegionOne | heat-cfn | cloudformation | True | internal | http://10.7.7.100:8000/v1 |
| 5e3e0b2055d04ef08ed9c4a9ce6e5bab | RegionOne | heat-cfn | cloudformation | True | public | http://10.7.7.100:8000/v1 |
| 6c2f54d17ca241429a5136dcf23f03db | RegionOne | heat | orchestration | True | public | http://10.7.7.100:8004/v1/%(tenant_id)s |
| 7678d11360204aff892053699275a437 | RegionOne | nova | compute | True | internal | http://10.7.7.100:8774/v2.1 |
| 871ffc6db189494fae8bf0e57bf4e0f1 | RegionOne | placement | placement | True | public | http://10.7.7.100:8780 |
| 95566ece030c44b191eee60e2c23ffaf | RegionOne | cinderv3 | volumev3 | True | public | http://10.7.7.100:8776/v3/%(tenant_id)s |
| a43d37b50c874313990062dd5ad57bf4 | RegionOne | heat | orchestration | True | internal | http://10.7.7.100:8004/v1/%(tenant_id)s |
| b3630243ff254527bd15cb93f98c9d87 | RegionOne | keystone | identity | True | internal | http://10.7.7.100:5000 |
| b66de9240df54692848b3f91677ac89f | RegionOne | neutron | network | True | internal | http://10.7.7.100:9696 |
| d9b6b5c6f95640bd9f3586117fa9a3e1 | RegionOne | keystone | identity | True | public | http://10.7.7.100:5000 |
| e9403b5f6fdb426e9488875d34ba59de | RegionOne | neutron | network | True | public | http://10.7.7.100:9696 |
| eda55194d28f48698053534e48096ac2 | RegionOne | nova | compute | True | public | http://10.7.7.100:8774/v2.1 |
| fb121e16df1f42fabea409e65c66cc3f | RegionOne | glance | image | True | internal | http://10.7.7.100:9292 |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+
openstack host list
API has been deprecated. Please consider using 'hypervisor list' instead.
+-------------------+-----------+----------+
| Host Name | Service | Zone |
+-------------------+-----------+----------+
| alfian-controller | scheduler | internal |
| alfian-controller | conductor | internal |
| alfian-compute1 | compute | nova |
| alfian-compute2 | compute | nova |
+-------------------+-----------+----------+
openstack hypervisor list
+--------------------------------------+---------------------+-----------------+-----------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP | State |
+--------------------------------------+---------------------+-----------------+-----------+-------+
| 1c3f4519-5d35-4e51-a23f-3b162fe8b038 | alfian-compute1 | QEMU | 10.7.7.20 | up |
| f600f16c-cbef-4a17-a520-efce47219a7b | alfian-compute2 | QEMU | 10.7.7.30 | up |
+--------------------------------------+---------------------+-----------------+-----------+-------+
Referensi:
Subscribe to my newsletter
Read articles from Muhammad Alfian Tirta Kusuma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by