Deploying Openstack Lab On GCP-v3
Deploying Openstack Lab On GCP-v3
Deploying Openstack Lab On GCP-v3
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-7 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
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.
13. Update System & install some python packages - Make sure your machine has
the latest version of CentOS 7 on the machine.
#yum -y update
15. Also, disable firewall and NetworkManager in the VM & enable network service
#systemctl disable firewalld
#systemctl stop firewalld
#systemctl disable NetworkManager
#systemctl stop NetworkManager
#systemctl enable network
#systemctl start network
16. Install Packstack Installer - Let us first install the Packstack Installer that provides an
easy way to install OpenStack on the system. Use the Yum command to install it.
18. Install “tmux” application which will avoid the session disconnections of
terminal window
#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
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
In case of a disconnection use the following tmux command to attach to the session
#tmux a -t 0 → to attach to the target session id 0
#tmux kill-session -t 0 → to kill the tmux session id 0
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.
"Enjoy practicing your OpenStack".