Apache_CloudStack_PoC_Guide_Step_by_Step_Guide_Installation_and_Use_Cases.01
Apache_CloudStack_PoC_Guide_Step_by_Step_Guide_Installation_and_Use_Cases.01
ShapeBlue is the largest independent integrator of CloudStack technologies globally and are
specialists in the design and implementa�on of IaaS cloud infrastructures for both private and
public cloud implementa�ons.
Our technical teams are all ac�ve contributors to the Apache CloudStack project, and a good
percentage of our team are also project committers.
www.shapeblue.com
Table of Contents
At the end of this PoC, you will have a highly available, reliable and flexible CloudStack-
powered cloud. Following this guide should allow you to feel confident enough in setting up
and managing a CloudStack laaS environment and should give a smooth implementation of
the cloud orchestration layer in your infrastructure.
Conven�ons
The following conventions are used to highlight important areas and necessary inputs.:
Highlight a button/item from the list in the GUI that requires direct
interaction.
Highlighted text which can be copied and pasted directly into the GUI
Highlight text which can be copied and pasted directly into the command prompt.
Note
Highlights an observation that provides additional information.
Warning
Highlights a warning that provides additional information.
Warning
This is a basic Apache CloudStack setup to be used only for a Proof-of-Concept purpose.
Hardware requirements
In order to have a working architecture for Apache CloudStack evalua�on, the following
hardware will be minimally required.
Storage
Primary and Secondary storage created as NFS exports on the CloudStack Management server
500GB of RAID based storage on CloudStack Management server
Hosts
Item Quantity/Description
No. hosts (per cluster required) 3
Clusters/Pods (1 cluster per pod) 1
No. cores (per host) 8
Memory (per host) 32-64GB
Local storage Disk to support Hypervisor/OS
Network Interfaces 2 Ethernet cards
Network throughput 1Gb/s
Management Server
Item Quantity/Description
No. cores 8
Memory 16GB
Local storage 150GB for OS + 500GB for primary and secondary storage of RAID based storage
Network Interfaces 1 Ethernet card
Network throughput 1Gb/s
Networking
Item Quantity/Description
No. Switches 1
VLAN 802.1q support required for advanced network zones.
No. ports Enough ports to connect 2 interfaces on each host considering 1 port for public/guest
networks and 1 port for storage/management (+) 1 interface for storage/management
network for the CloudStack management server.
Throughput 1 Gb/s
Soft Requirements
IP Address / VLAN Space
Item Quantity/Description Network IP Address VLAN ID
Public Network 0 public addresses – /24 network IP 10.0.48.0/24 48
range - RFC 1918 addresses routable
within POC environment
Guest Network 20x VLANs dedicated to CloudStack use. 101-120
Management and Storage Network 40x RFC 1918 addresses 10.0.32.0/24 49
Infrastructure Design
Physical Layout
Logical Layout
Warning
In this guide, will be used Linux CentOS 8 for management servers and hosts. Make sure you have sufficient
space to store the OS and the secondary storage mount point.
Warning
Before continuing, make sure that you have applied the latest updates to your host.
2. Edit the /etc/hosts file and add the following lines. If you prefer, you can add these entries
in your internal DNS server.
Note
This should return a fully qualified hostname as “mgmt.local”.
Note
A NTP daemon is required to synchronize the clocks of the servers in your cloud.
5. Set the SELINUX variable in /etc/selinux/config to permissive. This ensures that the
permissive set�ng will be maintained a�er a system reboot.
vi /etc/selinux/config
Change the following line
SELINUX=enforcing
To this
SELINUX=permissive
6. Set SELinux to permissive star�ng immediately, without requiring a system reboot,
running the following command.
setenforce permissive
7. For a proof-of-concept propose, firewalld/iptables will not be necessary. To disable it, run
the following command.
systemctl stop firewalld
systemctl disable firewalld
CloudStack Installation
1. Add the CloudStack repository crea�ng /etc/yum.repos.d/cloudstack.repo file and
inser�ng the following informa�on.
[cloudstack]
name=cloudstack
baseurl=http://download.cloudstack.org/centos/$releasever/4.16/
enabled=1
gpgcheck=1
gpgkey=https://download.cloudstack.org/RPM-GPG-KEY
Warning
CloudStack 4.16 requires Java 11 JRE. Installing CloudStack packages will automatically install Java 11, but
it’s good to explicitly confirm that the Java 11 is the selected/active one (in case you had a previous
Java version already installed) with alternatives --config java after Apache CloudStack packages are
already installed.
Note
Apache CloudStack needs a place to keep primary and secondary storage (see CloudStack Design). Both of
these can be NFS shares. This section tells how to set up the NFS shares before adding the storage to
CloudStack.
Prepare NFS Shares
1. Install the nfs-utils package.
yum -y install nfs-utils quota-rpc
2. Create a NFS share for primary and secondary storage running the command as follows.
mkdir -p /export/primary
mkdir -p /export/secondary
3. To configure the new directories as NFS exports, edit /etc/exports. Export the NFS share(s)
with rw,async,no_root_squash,no_subtree_check. For example:
vi /etc/exports
4. Insert the following line.
/export *(rw,async,no_root_squash,no_subtree_check)
5. Now, export the /export directory running the following command.
exportfs -a
6. Edit the /etc/nfs.conf file.
vi /etc/nfs.conf
Note
After restarting nfs and rpcbind, only these seven ports are needed for setting up NFS server.
9. The ports used by NFS RPC-based service can be listed by:
rpcinfo -p
This is a sample output of this command:
Database cloud
User cloud
Password password
Note
The Management Server should now be running.
7. Secondary storage must be seeded with a template that is used for CloudStack system
VMs. This process will need up to 30 minutes to run. To seed the template, run the
following command:
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u
http://download.cloudstack.org/systemvm/4.16/systemvmtemplate-4.16.0-kvm.qcow2.bz2 -h kvm -F
Note
Before continuing, make sure that you have applied the latest updates to your host.
Warning
Repeat all of following steps on every hypervisor host.
Note
This should return a fully qualified KVM hostname.
Note
A NTP daemon is required to synchronize the clocks of the servers in your cloud.
5. Set the SELINUX variable in /etc/selinux/config to permissive. This ensures that the
permissive set�ng will be maintained a�er a system reboot.
vi /etc/selinux/config
Change the following line
SELINUX=enforcing
To this
SELINUX=permissive
6. Set SELinux to permissive star�ng immediately, without requiring a system reboot,
running the following command.
setenforce permissive
7. For a proof-of-concept propose, firewalld/iptables will not be necessary. To disable it, run
the following command.
yum -y install iptables-services
systemctl stop firewalld
systemctl disable firewalld
Warning
CloudStack 4.16 requires Java 11 JRE. Installing CloudStack packages will automatically install Java 11, but
it’s good to explicitly confirm that the Java 11 is the selected/active one (in case you had a previous
Java version already installed) with alternatives --config java after CloudStack packages are already
installed.
Note
In order to have live migration working, libvirt has to listen for unsecured TCP connections. We also need
to turn off libvirts attempt to use Multicast DNS advertising. Both of these settings are in
/etc/libvirt/libvirtd.conf
Note
Turning on “listen_tcp” in libvirtd.conf is not enough, we have to change the parameters as well modifying
/etc/sysconfig/libvirtd.
Note
CloudStack uses the network bridges in conjunction with KVM to connect the guest instances to each other
and the outside world. They also are used to connect the System VMs to your infrastructure.
By default, these bridges are called cloudbr0 and cloudbr1.
Ensure that the interfaces names to be used for configuring the bridges match one of the following
patterns: ‘eth*’, ‘bond*’, ‘team*’, ‘vlan*’, ‘em*’, ‘p*p*’, ‘ens*’, ‘eno*’, ‘enp*’, ‘enx*’.
Otherwise, the KVM agent will not be able to configure the bridges properly.
Warning
It is essential that you keep the configuration consistent across all your hypervisors.
Note
In the Advanced networking mode, the most common case is to have (at least) two physical interfaces per
hypervior-host. We will use the interface eth0 linked to the bridge ‘cloudbr0’ using the untagged (native)
VLAN for hypervisor management. Additionally, we configure the second interface for usage with the
bridge ‘cloudbr1’ for public and guest traffic. This time there are no VLANs applied by us. CloudStack will
add the VLANs as required during actual use.
Note
Now we have the interfaces configured and can add the bridges on top of them.
vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0
Make sure it looks similar to:
DEVICE=cloudbr0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
IPV6_AUTOCONF=no
DELAY=5
IPADDR=10.0.33.x
GATEWAY=10.0.32.1
NETMASK=255.255.240.0
STP=yes
vi /etc/sysconfig/network-scripts/ifcfg-cloudbr1
Make sure it looks similar to:
DEVICE=cloudbr1
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
IPV6_AUTOCONF=no
DELAY=5
STP=yes
Note
With this configuration you should be able to restart the network, although a reboot is recommended to
see if everything works properly.
7. Run the following command to show the bridge configura�on and see if everything is
right:
brctl show
Adding Zone
Note
Now we will create each one of the components represented below.
1. To access the CloudStack UI, open this URL http:// 10.0.32.10:8080/client in your web
browser.
2. Login with the following creden�als and click Login.
Username: admin
Password: password
Domain: Blank
3. In the le� part of the naviga�on pane, click Infrastructure > Zones and then click Add
Zone.
4. In the wizard, select Advanced to create an Advanced Zone and click Next.
Note
For more info about Advanced Zone, you can reach here
http://docs.cloudstack.apache.org/en/latest/adminguide/networking/advanced_zone_config.html.
5. Fill in the informa�ons required for Zone Details as follows and then click Next.
Name: poc-zone
IPv4 DNS1: 8.8.8.8
Internal DNS 1: 8.8.4.4
Hypervisor: KVM
Guest CIDR: 10.1.1.0/24
6. On this screen, we will configure traffic types for the hosts’ physical networks. Click Add
Physical Network to create a new physical network and configure the Traffic Types as
follows:
8. Click edit in each traffic type item and set the traffic label as follows and, a�er all traffic
label was defined, click Next.
cloudbr0
9. Now we will configure the Public traffic and add public IPs to be used by the Virtual
Routers and System VMs in the public NIC. Fill in the form as follows, click Add and then
click Next.
10. Fill in the form to create and setup the POD and then click Next.
Note
A Pod represents a Rack in the Data Center. The network IPs used will be from the management network.
11. Now, configure the Guest Traffic VLANs and then click Next.
VLAN/VNI Range: 101 - 120
12. Fill in the form with the cluster name and then click Next.
13. Add the first host and then click Next. The others hosts will be added a�er the Zone is
created.
14. Fill in the form as follows to add a NFS Primary Storage and then click Next.
Name: Primary Storage
Scope: Cluster
Protocol: nfs
Server: 192.168.32.10
Path: /export/primary
Storage Tags:Blank
15. Fill in the form as follows to add a NFS Secondary Storage and then click Next.
Provider: Secondary Storage
Name: Cluster
Server: 192.168.32.10
Path: /export/secondary
The Zone will be ready a�er all resources is configured. Click Enable Zone to finish the
wizard.
17. We need now to add the remaining hosts. In the le� naviga�on pane, click Infrastructure
> Hosts and then click Add Host.
Overview
CloudStack implements domain hierarchies to logically isolate the user accounts. This model
can be used to define, for example, departments within the same organiza�on if used to build
private clouds or, different customers when it used to build public clouds. You could also have
a specific domain for sales partners or customers for example.
A domain can contain mul�ple user accounts. In Apache CloudStack, a user account assumes
a profile defined in roles. There is a set of predefined roles for the most common use cases,
these being the main:
Role Descrip�on
Root Admin Manage the entire platform, including physical and logical resources from all domains
and accounts.
Domain Admin Manage all logical resources under the domain and adjacent sub-domains including
user accounts, sub-domains and all related virtual computing resources.
User Manage virtual computing resources related to your own account.
Topics covered
● Managing Domain
● Se�ng resource limits
● Managing User Accounts
Creating a Domain
Note
In the domain and user accounts level, it is possible to distribute the computational resources to be used
for the users, limiting their compute capacity. When a domain account is allocated at the domain level, the
domain administrator user can distribute the resources for other regular user accounts and the adjacent
sub-domains. It allows users to have granular control over allocated resources in many hierarchical levels.
Note
This screen shows the computing resources limits in the domain level. By default, the resources are
configured with -1, that means unlimited resource.
24. Set up the domain resources as follows and then click Submit:
Max. User VMs: 10
Max. Public IPs: 5
Max. Volumes: -1
Max. Snapshots: -1
Max. Templates: -1
Max. Networks: 5
Max. VPCs: 2
Max. CPU Cores: -1
Max. Memory (MiB): 4096
Max. Primary Storage (GiB): 50
Max. Secondary Storage (GiB): -1
27. Click the admin where the corresponding role is Domain Admin.
28. The domain admin account will be used only for administra�ve proposes, then no
resource will be available for this account. Fill in the form as follows and then click Submit.
Max. User VMs: 0
Max. Public IPs: 0
Max. Volumes: 0
Max. Snapshots: 0
Max. Templates: 0
Max. Networks: 0
Max. VPCs: 0
Max. CPU Cores: 0
Max. Memory (MiB): 0
Max. Primary Storage (GiB): 0
Max. Secondary Storage (GiB): 0
Managing Instances
Overview
This use case provides you with a basic overview of launching, resizing, and managing an
Apache CloudStack instance.
Apache CloudStack has a UI that allows you to obtain and configure capacity with minimal
fric�on. It provides you with complete control of your compu�ng resources and lets you run
on Apache CloudStack proven compu�ng environment. Apache CloudStack reduces the �me
required to obtain and boot new server instances to minutes, allowing you to quickly scale
capacity, both up and down, as your compu�ng requirements change.
Topics Covered
A�er you have finished this prac�cal exercise, you will then take the following
Proof-of-Concept tests:
● Registering a new template
● Crea�ng an isolated network
● Modifying egress firewall rules
● Launching an instance
● Using Userdata
● Managing Firewall
● Scaling up/down Instance
● Instance console access
● Terminate instance
● Recover instance
● Expurge instance
2. In the le� of the naviga�on pane, click Images > Templates and then click Register
Template from URL.
Note
You will use a pre-configured template including cloudinit installed and configured that allows you to run
commands during the instance startup.
4. From the previews registered template, select CentOS 7 to check the download status:
5. Refresh this page clicking refresh every 30 seconds un�l the download is complete.
Note
An Apache CloudStack guest network, provides a VLAN-isolated layer that connect the instance network to
the Virtual Router gateway.
Note
The Virtual Router will do the network communication between instances and the public network. This
also controls firewall rules, userdata, metadata, dhcp for instances, load balancing, and TCP/UDP port
forwarding.
6. In the le� naviga�on pane, click Networks > Guest networks and then click Add network.
7. Select Isolated, and fill in the form as follows and then click OK:
Name: my-isolated-network
Descrip�on: My Isolated Network
Zone: poc-zone
Network Offering: Offering for Isolated networks with Source Nat service enabled
External Id: Blank
Gateway: Blank
Netmask: Blank
Network Domain: Blank
9. Click Egress Rules and add a rule that allows instances to access the internet as follows
and then click Add.
Note
cloud-init is already installed and configured in the Template. Therefore, cloud-init is designed to make
additional settings to the instance's operating system at boot time. It extends the integration enabling
users to send commands, create users, set password, add SSHkeys during the instance boot using the
CloudStack userdata and metadata.
11. In the le� naviga�on pane, click Compute > Instances and then click Add Instance.
12. Fill in the form as follows and then click Launch Instance:
Zone: poc-zone
Template/ISO
- Community: CentOS 7.0 (64bit)
Compute Offering: Small Instance
Advanced Mode: Yes
- Userdata:
#! /bin/bash
yum -y install httpd
systemctl enable httpd
systemctl start httpd
echo '<html><h2>Hello from your new
WebServer!</h2></html>' > /var/www/html/index.html
Name: WebServer01
Group: None
Keyboard Language: None
Start Instance: Yes
Enabling HTTP port redirect to expose the Web Server to public access
13. In the le� naviga�on pane, click Network > Guest networks and then click
my-isolated-network.
14. Select Public IP Address and then click source nat IP.
15. Select Port Forwarding and add a rule to redirect the HTTP port as follows and click Add.
Private Port: Start: 80 – End: 80
Public Port: Start: 80 – End: 80
16. It will open a list of instances available on the my-isolated-network network. Select
WebServer01 and click OK.
17. Click Firewall to open the HTTP port and fill in the form as follows and then click Add.
20. Open a new tab in the browser and paste the address copied and then press enter:
Note
The Web Server is now running.
Note
Compute offering can only be created by domain or root administrators. User accounts can only consume
them for use in their respective resources.
22. In the le� naviga�on pane, click Service Offering > Compute Offering and then click Add
Compute Offering.
GPU: None
Domain: ROOT/POC
Zone: All Zones
26. Select Poc Instance Compute Offering and then click OK.
27. The instance will be scaled with the values inherited from the Compute Offering Poc
Instance.
Removing and Recovering Instances
Note
When an Apache CloudStack instance is no longer needed, it can be terminated by any user. By default, the
regular user account can only terminate the instance, but can’t remove it permanently from the cloud
infrastructure. It is controlled by Global Setting variable “allow.user.view.destroyed.vm”. The resource
remains available but, only root or domain admin can recover or eliminate the resource definitively. If no
action is taken within the period defined in the Global Setting variable “event.purge.interval”, the event
purge thread will eliminate permanently the resource from the infrastructure. The Domain and Account
Limits continue to be used until the purge is performed.
28. In the le� naviga�on pane, click Compute > Instances, select WebServer01, click Destroy
Instance and then, click OK.
Note
Since the instance was dropped by a regular user account and, although in the user's view it appears to be
permanently excluded, an admin account (root or domain) can recover it.
Note
A domain admin account can see destroyed instances and can take actions to either purge or recover as
seen below:
32. To recover the instance removed by user, click Recover Instance to proceed. A�er this, the
instance will be available again.
34. In the le� naviga�on pane, click Compute > Instances to view the recovered instance.
35. Select the WebServer01 instance, followed by clicking Destroy Instance and then click OK.
Note
When Expunge is selected, the process will be irreversible and no longer possible to recover the instance,
unless there is a backup of the instance's root disk.
Note
If a data disk is attached to the instance, it will not be purged.
Overview
Virtual Private Cloud lets you provision an architecture that resembles a tradi�onal physical
network.
VPC implements:
- Tiering isola�on
- ACL
- Site-to-site IPsec VPN
- Client VPN
- Internal and External Load Balancer
Topics covered
● How to create VPC
● How to create ACLs List
● How to subne�ng VPC
● How to create internal and external Load Balancer
Architecture
In this use case, you will implement a simple architecture that will demonstrate the ability to
deliver services using the VPC components. We will define a VPC CIDR, subnet�ng it into 2
�ers; the first will be the frontend that will deliver the content through load balancing, and
second subnet, will be the backend that will have access through an internal load balancing
accessible only for the frontend �er. To demonstrate the balancing ability, it will be necessary
to implement 3 backend and 2 frontend instances. The content will be delivered using load
balancer round-robin algorithms, with a combina�on for each user request of a set of
different variables, that is, for a request coming from an external user accessing the service.
For this, a set of different frontend and backend instances will be used considering the
algorithm in each request.
Creating a VPC
1. Open the CloudStack control panel and login with the following creden�als:
2. Username:user-1
Password: password
Domain: poc
3. In the le� of the naviga�on pane, click Network > VPC and then click Add VPC
Name: My VPC
Descrip�on: My VPC
Zone: poc-zone
CIDR: 192.168.0.0/24
Network Domain : Blank
VPC Offering: Default VPC Offering
Start: yes
Note
The default Network ACL is used when no ACL is associated. Default behaviour is all the incoming traffic is
blocked and outgoing traffic is allowed from the tiers. Default network ACL cannot be removed or
modified. You will add rules for both ACLs lists after all VPC components are created.
5. In the VPC list, click My VPC and then click Network ACL Lists. A list of default ACLs will be
listed.
6. Now, you will add two new ACLs, one for Frontend and another for Backend. Click Add
Network ACL List, fill in the form as follows and then click OK:
7. Now, click again the Add Network ACL List, fill in the form as follows and then click OK:
8. Click ACL-FE > ACL List Rules to add an ACL to deny all incoming traffic from backend �er
by clicking Add ACL and fill in the form as follows and then click Ok.
#Rule: 1
CIDR List: 192.168.0.128/25
Ac�on: Deny
Protocol: All
Traffic Type: Ingress
Descrip�on: Deny all ingress traffic from backend tier.
9. Go back one page in your browser to return to ACL lists and click ACL-BE > ACL List Rules
to add an ACL to allow the incoming http port (80 traffic from the frontend �er by clicking
Add ACL and fill in the form as follows and then click Ok.
#Rule: 1
CIDR List: 192.168.0.0/25
Ac�on: Allow
Protocol: TCP
Start Port: 80
End Port: 80
Traffic Type: Ingress
Descrip�on: Allow http ingress traffic from frontend tier.
10. Click again in Add ACL to deny any other ingress traffic from frontend and fill in the form
as follows and then click Ok.
#Rule: 2
CIDR List: 192.168.0.0/25
Ac�on: Deny
Protocol: All
Traffic Type: Ingress
Descrip�on: Deny all ingress traffic from frontend tier.
Creating Tiers
11. In the le� naviga�on pane, click Network > VPC and then click My VPC.
12. Click Networks tab and then click Add New Tier.
14. Click again over Add New Tier, fill in the form as follows and then click OK.
Note
You created both tiers and each uses a guest network VLAN where both VLAN are connected to the Virtual
Router that implements static routing between tiers.
Note
To create each of the three backend instances, change only the Name field as follows
(backend-instance-01, backend-instance-02, backend-instance-03).
Zone: poc-zone
Template/ISO
- Community: CentOS 7.0 (64bit)
Compute Offering: Small Instance
Networks:
- Backend Tier: Yes
- Frontend Tier: No
Compute Offering: Small Instance
Advanced Mode: Yes
- Userdata:
#! /bin/bash
yum -y install httpd
systemctl enable httpd
systemctl start httpd
hostname > /var/www/html/index.html
Name: backend-instance-0[1,2,3]
Group: Blank
Keyboard Language: Blank
Start Instance: Yes
Creating and configuring the Internal Load Balancer
18. In the le� naviga�on pane, click Network > VPC and click My VPC.
19. Click Networks tab, expand Internal LB menu and then, click Add Internal LB.
21. Copy the Source IP Address in the Internal LB list and paste it in a text editor.
Note
To create each of two frontend instances, change backend_endpoint variable in the beginning of the
Userdata field for the Source IP Address from your text editor. Also change the Name field as follow
(frontend-instance-01, frontend-instance-02).
26. Fill in the forms for each instance (frontend-instance-01, frontend-instance-02) as follows
and then click Launch Instance:
Zone: poc-zone
Template/ISO
- Community: CentOS 7.0 (64bit)
Compute Offering: Small Instance
Networks:
- Backend Tier: No
- Frontend Tier: Yes
Advanced Mode: Yes
Userdata:
#! /bin/bash
backend_endpoint="Internal LB Source IP Address"
yum -y install httpd
cat << EOF > /etc/httpd/conf.d/cgi-enabled.conf
<Directory "/var/www/html/frontend">
Options +ExecCGI
AddHandler cgi-script .py
</Directory>
EOF
mkdir /var/www/html/frontend
cat << EOF > /var/www/html/frontend/index.py
#! /usr/bin/env python
import requests
import socket
h = socket.gethostname()
r = requests.get("http://${backend_endpoint}/")
print "Content-type: text/html\n\n"
print "<html>\n<body>"
print "<meta http-equiv=\"refresh\" content=\"10\"/>"
print "<div style=\"width: 100%; font-size: 40px; font-weight:
bold; text-align: center;\">"
print('%s - %s' % (h, r.text))
print "</div>\n</body>\n</html>"
EOF
chmod 705 /var/www/html/frontend/index.py
systemctl enable httpd
systemctl start httpd
Name: frontend-instance-0x
Group: None
Keyboard Language: None
Start Instance: Yes
28. Click Public IP Address > Acquire New IP, and then click OK.
30. Copy the IP Address showed in the Details tab and past it in a text editor. It will be used
later.
31. Click Load Balancing, fill in the form as follows and then click Add.
32. Select the �er Frontend Tier and select all instances in the list as follows and then click OK.
33. Open a new tab in your browser and paste the IP Address copied in the step #30 followed
by /frontend/index.py
Example: http://IP_Address/frontend/index.py
Note
The page will be reloaded in each 10 seconds and you can see the frontend and backend changing in each
request.
Note
One of the objectives of the cloud-init installed in the template is to allow a set of scripts to be executed
when first boot is performed during the instance creation. Below explanation of what runs on Userdata.
2. The variable backend_endpoint was settled with the value of the source ip address of
the internal LB:
backend_endpoint="192.168.0.x"
5. The directory /var/www/html/frontend was created where posteriorly the cgi python
script will be written:
mkdir /var/www/html/frontend
#! /usr/bin/env python
import requests
import socket
# Request call to the Internal LB
r = requests.get("http://${backend_endpoint}/")
# Get the instance hostname
h = socket.gethostname()
# Print the HTML code
print "Content-type: text/html\n\n"
print "<html>\n<body>"
print "<meta http-equiv=\"refresh\" content=\"10\"/>"
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align:
center;\">"
# Here, print the values of hostname and Internal LB request
print('%s - %s' % (h, r.text))
print "</div>\n</body>\n</html>"
Apache CloudStack is so�ware that provides a cloud orchestra�on layer, giving automa�on of
the crea�on, provisioning and configura�on of IaaS components (such as virtual servers). It
turns exis�ng virtual infrastructure into a cloud-based Infrastructure as a Service (IaaS)
pla�orm. Because CloudStack leverages exis�ng infrastructure, the cost and �me for the
organiza�on to build a mul�-tenant IaaS pla�orm are greatly reduced.
Among the most significant advantages of the virtualiza�on management pla�orm is the
simplicity and ease of use it brings, even for large-scale environments. With CloudStack, you
can orchestrate hosted public, on-premise clouds and hybrid environments without the need
of engaging a huge opera�ons team to support them in the long term.
As more and more companies build on-premiss clouds or enter the service provider market
with public clouds, the more they will need the right set of tools to successfully build, manage
and scale their Infrastructure as a Service (IaaS) pla�orm. However – choosing the right
technology stack can be a difficult decision. There are several aspects that should be
considered, such as planning for future growth and demand, team size, budget, project
�meframe, previous experience, available hardware and the underlying infrastructure already
in place.
A�er comple�on of a successful CloudStack PoC by following all of the described steps in this
guide, you will feel confident to implement CloudStack in your produc�on environment and
benefit from all its advantages!
cloudstack.apache.org/
About ShapeBlue
ShapeBlue is the largest independent integrator of CloudStack technologies
globally and are specialists in the design and implementation of IaaS cloud
infrastructures for both private and public cloud implementations. We combine
100’s of person-years of experience in designing and building complex network,
storage and compute infrastructures with globally leading skills in Apache
CloudStack.
www.shapeblue.com | [email protected]