Deploying+Openstack+Lab+on+GCP v5 (3)
Deploying+Openstack+Lab+on+GCP v5 (3)
Deploying+Openstack+Lab+on+GCP v5 (3)
This is a procedure to install a two node OpenStack cluster on top of a Google cloud
compute machines. It is assumed that you have your GCP account already set up using a
credit card. GCP Free tier (trial account) is sufficient to create this deployment. The free tier
gives you a quota of 12 CPUs. Make sure that at least 8 CPUs (& 30 GB RAM) should be
available before starting this deployment.
• Go to cloud.google.com→SignIn→Go to Console
• Subscribe to a 3 month’s free tier subscription by providing your basic details &
credit card details. INR 1/- will be deducted & credited back by google.
• No auto deduction after 3 months until increased manually.
• Once completed then you will get access to Google cloud console and an activation
message at the top of the screen with available balance & days.
You can perform this deployment either using the SDK or the GCP cloudshell.
1. Create a Centos-9 image with nested virtualization. See the --licenses flag below
4. Once all this is done then the VMs should be assigned internal & external IP
addresses & should look like below. Go to GCP Dashboard→Compute engine
Click the VM name & in the details section check that the following flags should be set. If
not, then Edit VM & check both of them & save
7. Now open 2 separate SSH sessions to the controller & compute VMs via GCP
dashboard→Compute engine
4
9. Edit the SSH configuration & set the following parameters followed by an SSHD
restart to allow the external root login into the servers.
10. Disable the SELinux mode so that servers remain reachable after STOP/START
#setenforce 0
Edit the /etc/selinux/config file and set the SELINUX mode to "disabled"
11. Change root password of both the machines. Set any password of your choice &
remember that
#passwd
12. Check the connectivity between controller & compute nodes via Ping. Replace the IP
address for your machines
[root@controller ~]# ping 10.142.0.6
PING 10.142.0.6 (10.142.0.6) 56(84) bytes of data.
64 bytes from 10.142.0.6: icmp_seq=1 ttl=64 time=1.22 ms
64 bytes from 10.142.0.6: icmp_seq=2 ttl=64 time=0.300 ms
64 bytes from 10.142.0.6: icmp_seq=3 ttl=64 time=0.228 ms
13. Update System & reboot the VMs- Make sure your machine has the latest
version of CentOS 9 on the machine. A reboot is required because kernel has
been updated.
#dnf -y update
Now its time to login to both the machines via any external tool like putty, SecureCRT,
MobaXterm, etc. Give username=root & password that you just changed for root user.
14. Enable CRB, Download & install OpenStack repositories, and update the machines.
#dnf config-manager --enable crb
#dnf install -y centos-release-openstack-yoga
#dnf update -y
15. Install network-scripts, disable firewall & NetworkManager in the VM & enable network service.
#dnf install network-scripts -y
#systemctl disable firewalld
#systemctl stop firewalld
#systemctl disable NetworkManager
#systemctl stop NetworkManager
#systemctl enable network
#systemctl start network
16. Install Packstack Installer for OpenStack and tmux utility which will avoid
the session disconnections of terminal window.
17. Add public DNS servers in /etc/resolv.conf so that all repos become reachable from the
machines. Do not delete anything. Just append the following two lines in the existing file.
#vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
18. Edit one of the network-scripts and remove the ADDZEROCONF section and
restart the network service.
#vim /etc/sysconfig/network-scripts/ifup-eth
#packstack --gen-answer-file=/root/answer.txt
Change the following parameters only. Do not change any other parameters.
# List the servers on which to install the Compute service. Please add both machine internal IPs
here
CONFIG_COMPUTE_HOSTS=10.142.0.5,10.142.0.6
# List the servers on which to install the network service. Please add both machine internal IPs
here
CONFIG_NETWORK_HOSTS=10.142.0.5,10.142.0.6
21. Run the PackStack installer (from the tmux session) with the answer file we just
modified according to our requirement.
#tmux
#packstack --answer-file=/root/answer.txt
22. Now edit the following configuration file & put the External IP address of your
controller VM in the server alias list followed by an httpd restart
#vim /etc/httpd/conf.d/15-horizon_vhost.conf
23. Now access the CLI in the controller’s root directory. Source the keystone_admin.rc
file & start using the #openstack commands
Put the username = admin & password as you set in the answer file during installation.
Whatever password is set will be visible in the rc file, as below -
You can STOP the compute machine from the google dashboard after use. This will avoid
billing (even in the free trial). Whenever required please start the machine & after 5
mins the OpenStack dashboard will be reachable again.