Nutanix .Next Hands On Lab Guide
Nutanix .Next Hands On Lab Guide
Nutanix .Next Hands On Lab Guide
NUTANIX CALM
6. Click on the icon to open Calm Blueprint page. Click the button to
upload a Blueprint template. Select “LAMP-HOL.json” file from local workstation
folder. Click Open to continue.
7. Upload Blueprint dialog displayed. Put a name for your new blueprint, for example
“LAMP-HOLxx” where xx is your table id. A project has been assigned to your user id.
Click “Upload” to continue.
8. New blueprint page will be displayed. We can see there are three services that will
be delivered such as MySQL database, Apache webserver with PHP, and HAPROXY
upon the successful deployment of the blueprint.
9. Click on the button to modify MySQL service. Click on the VM tab and scroll
down to the “Images” section.
10. Select “centos-image-hol” as the image and put 2 vCPU, 2 Cores per vCPU and 4 GiB
Memory as follow. Leave “Guest Customization” option unchecked.
11. Scroll down until you find “Network Adapters” section. Click on the “+” sign on
upper right corner. Select “Default” for the Subnets and leave “Static IP” blank.
12. Scroll up and click on the “Package” tab. Click on “Configure Install” button. Click on
the “PackageInstallTask” button under MySQL service. A new side panel on the right
will be displayed.
13. Click on the icon at the “Script” section to enlarge the script window. A larger
script window will be displayed.
14. Copy and paste the following script below the current two lines. It will be similar
with the image below.
sudo systemctl stop firewalld
FLUSH PRIVILEGES;
EOF
15. Click on “Save” button to save changes. Ignore the error message for now.
16. Click on the button to modify Apache PHP service. Click on the VM tab and
scroll down to the “Images” section.
17. Select “centos-image-hol” as the image and put 2 vCPU, 2 Cores per vCPU and 4 GiB
Memory as follow. Leave “Guest Customization” option unchecked.
18. Scroll down until you find “Network Adapters” section. Click on the “+” sign on
upper right corner. Select “Default” for the Subnets and leave “Static IP” blank.
19. Scroll up and click on the “Package” tab. Click on “Configure Install” button. Click on
the “PackageInstallTask” button under Apache_PHP service. A new side panel on
the right will be displayed.
20. Click on the icon at the “Script” section to enlarge the script window. A larger
script window will be displayed.
21. Copy and paste the following script below the current two lines. It will be similar
with the image below.
echo "<?php
phpinfo();
?>" | sudo tee /var/www/html/info.php
23. Click on the button to modify HAPROXY service. Click on the VM tab and
scroll down to the “Images” section.
24. Select “centos-image-hol” as the image and put 2 vCPU, 2 Cores per vCPU and 4 GiB
Memory as follow. Leave “Guest Customization” option unchecked.
25. Scroll down until you find “Network Adapters” section. Click on the “+” sign on
upper right corner. Select “Default” for the Subnets and leave “Static IP” blank.
26. Scroll up and click on the “Package” tab. Click on “Configure Install” button. Click on
the “PackageInstallTask” button under HAPROXY service. A new side panel on the
right will be displayed.
27. Click on the icon at the “Script” section to enlarge the script window. A larger
script window will be displayed.
28. Copy and paste the following script below the current two lines. It will be similar
with the image below.
sudo systemctl stop firewalld
sudo setenforce 0
sudo sed -i 's/permissive/disabled/' /etc/sysconfig/selinux
port=80
#sudo yum update -y
#sudo yum install -y haproxy
echo "global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
quiet
user haproxy
group haproxy
defaults
log global
mode http
retries 3
timeout client 50s
timeout connect 5s
timeout server 50s
option dontlognull
option httplog
option redispatch
balance roundrobin
# Set up application listeners here.
listen stats 0.0.0.0:8080
mode http
log global
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats uri /stats
listen admin
bind 127.0.0.1:22002
mode http
stats uri /
frontend http
maxconn 2000
bind 0.0.0.0:80
default_backend servers-http
backend servers-http" | sudo tee /etc/haproxy/haproxy.cfg
done
29. Click on “Save” button to save changes. Ignore the error message for now.
31. Click on the “>” sign, and type nutanix/4u as the password.
32. Click on “Save” button to save changes, then click “Back” button to return to main
page.
33. Click on “Launch” button to start application deployment according to the blueprint.
34. Put a name for the application, for example demo-calm-holxx where xx is your table
id. Type Nutanix/4u on “MYSQL_PASSWORD” text box.
35. Click on “Credentials” tab, type nutanix/4u on “Password” text box. Click “Create”
button to start the application deployment.
In summary, HAPROXY that we have configured and provisioned will provide load-balanced
access connectivity to Apache HTTP server.
To obtain HAPROXY service IP address, click on the “Services” tab, click HAPROXY box and
record the IP address on the right side panel.
To obtain APACHE_PHP services IP address, click on the “Services” tab, click APACHE_PHP
box and record the IP address on the right side panel.
Please note that there are two VMs associated with APACHE_PHP services. Hence there are
two IP addresses for this services.
Click on Virtual Infrastructure > VMs menu to view the virtual machines deployed on your
infrastructure.
This proves that HAPROXY load-balances the access to two Apache Web Servers.
Return to application page and click on “Services” tab. Click on MySQL services and click
“Open Terminal” on the right side panel. A new tab will be opened.
Login into MySQL by typing command “mysql -u root -p” and press enter. Enter Nutanix/4u
when prompted to enter the password. A successful login into MySQL using the above
password proves that the scripts entered during Calm Blueprint setup was working.
Additionally, access into the console was recorded by Calm for audit purposes when
needed.
Linux Apache MySQL PHP (LAMP) Application Deprovisioning
When the application is no longer accessed by the user, the application can be
deprovisioned or deleted from Calm. Follow the instructions below to delete the
application.