Instalasi RDO OpenStack menggunakan PackStack

Hi…

PackStack (https://wiki.openstack.org/wiki/Packstack) adalah salah satu cara yang bisa digunakan untuk install OpenStack. Tujuan dari PackStack ini untuk menyiapkan “test/lab environment” menggunakan distribusi “rpm-based” (turunan RedHat).

Oke, mari kita mulai. Kali ini kita menggunakan CentOS 7 dengan “Minimal Installation”, yang diinstall di virtual box. Setelah install, jangan lupa update package dan reboot server

# yum update -y
# reboot

Langkah selanjutnya adalah, menambahkan repo yang mengandung OpenStack dan package-package tambahannya

 

[[email protected] centos]# yum install -y epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: repo.apiknet.co.id
 * extras: repo.apiknet.co.id
 * updates: repo.apiknet.co.id
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Installing:
 epel-release noarch 7-9 extras 14 k

Transaction Summary
================================================================================
Install 1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : epel-release-7-9.noarch 1/1
 Verifying : epel-release-7-9.noarch 1/1

Installed:
 epel-release.noarch 0:7-9

Complete!
[[email protected] centos]# yum install -y https://www.rdoproject.org/repos/rdo-release.rpm
Loaded plugins: fastestmirror
rdo-release.rpm | 5.6 kB 00:00
Examining /var/tmp/yum-root-81M0jG/rdo-release.rpm: rdo-release-pike-1.noarch
Marking /var/tmp/yum-root-81M0jG/rdo-release.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdo-release.noarch 0:pike-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Installing:
 rdo-release noarch pike-1 /rdo-release 3.1 k

Transaction Summary
================================================================================
Install 1 Package

Total size: 3.1 k
Installed size: 3.1 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : rdo-release-pike-1.noarch 1/1
 Verifying : rdo-release-pike-1.noarch 1/1

Installed:
 rdo-release.noarch 0:pike-1

Complete!

Kemudian, nonaktifkan dan disable “Network Manager” service, karena openstack belum support

[[email protected] centos]# systemctl stop NetworkManager.service
[[email protected] centos]# systemctl disable NetworkManager.service
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

Lalu, aktifkan “network” service

# systemctl start network.service

# systemctl enable network.service

Selanjutnya, pastikan menggunakan IP static di interface ethernet,

[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=enp0s3
UUID=edf3c184-3fd5-4b1b-a381-276db590c929
DEVICE=enp0s3
ONBOOT=yes
IPADDR="192.168.3.13"
NETMASK="255.255.255.0"
GATEWAY="192.168.3.1"
DNS1="8.8.8.8"
NM_CONTROLLED=no

Kemudian, disable firewalld daemon apabila menggunakannya, karena openstack tidak support

[[email protected] centos]# systemctl stop firewalld
[[email protected] centos]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Selanjutnya, install PackStack tool

[[email protected] centos]# yum install -y centos-release-openstack-pike

[[email protected] centos]# yum update -y

[[email protected] centos]# yum install -y openstack-packstack

Setelah itu, bisa langsung menggunakan command packstack –allinone untuk install openstack-packstack, akan tetapi disarankan untuk mengganti beberapa parameter yang ada dengan mengenerate answer file untuk packstack

[[email protected] centos]# packstack --gen-answer-file ~/answer-file.txt
Packstack changed given value to required value /root/.ssh/id_rsa.pub

Selanjutnya, anda dapat mengedit file answer-file.txt tersebut

[[email protected] centos]# vi ~/answer-file.txt

Ada beberapa parameter yang bisa dirubah, setidaknya beberapa parameter ini yang diubah

CONFIG_DEFAULT_PASSWORD=

CONFIG_KEYSTONE_ADMIN_PW=

CONFIG_KEYSTONE_DEMO_PW=

Nah, langkah terakhir, install packstack

[[email protected] centos]# packstack --answer-file ~/answer-file.txt

Dan hasilnya

Crontab untuk menjalankan perintah secara otomatis

Hi….

Kali ini akan membahas mengenai cara menambahkan crontab di ubuntu. Case ini karena pada server saya beberapa kali service nya ada yg mati sehingga harus di start secara manual. Nah untuk mengatasi hal itu, saya tambahkan crontab / perintah otomatis untuk menjalankan perintah pada waktu tertentu.

Pertama kita bikin dulu script yang akan di jalankan, misal nama nya restart-webserver pada directory /home/user

#nano restart-webserver.sh

Isikan file tersebut dengan

service apache2 restart

Rubah file tersebut agar bisa di execute

#chmod +x /home/user/restart-webserver.sh

Kemudian kita tes file tersebut apakah bisa berjalan dengan baik

#./restart-webserver.sh* Restarting web server apache2                                         [ OK ]

Setelah itu bikin crontab nya di directory /var/spool/cron/

#nano /var/spool/cron/root

isikan

0 0 * * * /home/user/restart-webserver.sh

 

Nah terakhir kita cek apakah crontab nya bisa jalan

#crontab -l0 0 * * * /home/user/restart-webserver.sh

Penjelasannya : crontab tersebut akan dieksekusi tiap jam 00:00 setiap hari nya