You are on page 1of 30

Apache CloudStack Installation

INT-362
Step 1:- Download type 2 -hypervisor-:—
VMware Workstation,VirtualBox for Windows and
VirtualBox ,VMWare Fusion or parallel desktop for MacOS
- Ensure, VMware Workstation is installed on your machine.
Step 2:- Download Ubuntu ISO
- Download the Ubuntu Desktop ISO from the official
Ubuntu website: [Ubuntu Desktop]———
https://ubuntu.com/download/desktop
Step 3:- Create a Virtual Machine (VM) using Ubuntu ISO file:
•1. Click on "Create a New Virtual Machine."
•2. Select "Typical" and click "Next."
•3. Choose "Installer disc image file (iso)" and browse to the
downloaded Ubuntu Desktop ISO file.
•4. Complete the virtual machine creation wizard(By giving username
and password of your choice and disk allocation should be more than
40GB).
Step 4:- Install Ubuntu Desktop:
1. Power on the VM.
2. Follow the Ubuntu Desktop installation prompts:
- Select language, keyboard layout, etc.
- Choose "Normal Installation" and ensure the "Download
updates while installing Ubuntu”
- complete installation
Step 5:- Update and Upgrade Ubuntu:
Open a terminal on the Ubuntu VM and run the following commands:
#sudo apt update
The sudo apt update command is the most essential command in Linux to keep a system healthy and up-
to-date. This command installs and downloads all the latest package information available for the
packages currently installed on the system.
In case of error :—
user is not in the sudoers file. this incident will be reported
Type :—-

$ su
$ apt install sudo
$ user mod -aG sudo vboxuser-name
$ restart
$ reboot

After reopening ubuntu , now run sudo apt update


Step 6:- IP address in Ubuntu:
Run command Ip a to check
your machine Ip address = 192.168.122.132/24 and
Your network interface = ens33 (means:-en-ethernet,s-slot no 33)
Run command ip r to check default gateway -192.168.122.2
Step 7:-Check net plan folder name
Click on folder
Then, select other locations Click on computer Open etc folder

Find net plan folder and then Open it


Note down this name ‘ 01-network-manager-all.yaml’
Step 7:-open nano editor for 01-network-manager-all.yaml
Sudo nano /etc/netplan/01-network-manager-all.yaml
Password required :

Then , Type script in nano editor

network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
addresses: [your machine ip]
gateway4: your gateway ip
nameservers:
addresses: [8.8.8.8,8.8.8.4]
Press ctrl+s ——to save
Press ctrl+x——- to exit

• Go to the netplan directory located at /etc/netplan. Netplan is the default network management tool for the latest Ubuntu versions. Configuration files for Netplan are written
using YAML and end with the extension .yaml. I'll create a file named 01-network-manager-all.yaml.
• The top-level node in a Netplan configuration file is a network: mapping that contains version: 2 (means that it is using network definition version 2).
• Next, add a renderer, that controls the overall network. The renderer is systemd-networkd by default, but we'll set it to NetworkManager.
• As we are setting a static IP and we do not want to dynamically assign an IP to this network adapter, we'll set dhcp4 to no. Now we'll specify the specific static IP we noted in
step #2 depending on our subnet and the usable IP range. It was 192.168.122.129/24.
• Next, specify the gateway, which is the router or network device that assigns the IP addresses. Mine is on 192.168.122.2.
• Next, define nameservers. This is where you define a DNS server or a second DNS server. Here the first value is 8.8.8.8 which is Google's primary DNS server and the
second value is 8.8.8.4 which is Google's secondary DNS server.
Step 8:— Apply Netplan
# sudo netplan apply

-Netplan apply applies the current netplan configuration to a running system.

Using netplan gives a central location to describe simple-to-complex networking


configurations that function from desktop to server and from cloud to IoT devices.
Step 9:— Restart NetworkManager
sudo systemctl restart NetworkManager
Step 10:—— check and set host name
Sudo nano /etc/hosts

Give host name

192.168.122.132 apache.c1.u1 cloud362


Set host name
Sudo hostnamectl set-hostname cloud362

Check host name —-


hostname —fqdn (A fully qualified domain name (FQDN) is the complete domain name for a
specific computer, or host, on the internet.)
Step 11:—- Install bridge-utils—The bridge-utils package contains a utility needed to create and manage bridge devices. This is useful
in setting up networks for a hosted virtual machine (VM).

Sudo apt install bridge-utils network:

version: 2

renderer: networkd

ethernets:

ens33:

Sudo brctl addbr bridge0 dhcp4: no

Sudo brctl addif bridge0 ens33 dhcp6: no

Sudo nano /etc/netplan/01-network-manager-all.yaml


bridges:

bridge0:

interfaces: [ens33]

dhcp4: no

dhcp6: no

addresses: [192.168.122.129/24]

gateway4: 192.168.122.2

nameservers:

addresses: [8.8.8.8, 8.8.4.4]

Sudo netplan apply

Sudo systemctl restart NetworkManager


Step 12:—- Install ntp
Sudo apt install ntp
press y
Sudo systemctl enable ntp
Sudo systemctl start ntp
Step 12:—- Install chrony
Sudo apt install chrony

chronyd is a daemon process that runs in the background. chronyd is used to adjust the system clock that
runs in the kernel to synchronize with the NTP server. chronyd computes the rate at which the system clocks
gains or loses time, and compensates the system clock at the rate.
Step 12:—- Install JDK

Install JDK

sudo apt install openjdk-11-jdk


Apache CloudStack Management Server Installation
sudo nano /etc/apt/sources.list.d/cloudstack.list

Editor will open then type


deb https://download.cloudstack.org/ubuntu focal 4.18

26-205-11
Save—ctrl+s
Exit—— ctrl+x

wget -O - https://download.cloudstack.org/release.asc |sudo tee /etc/apt/trusted.gpg.d/cloudstack.asc

sudo apt update


Install cloudstack on Ubuntu
sudo apt install cloudstack-management

Install MySQL from the package repository of your distribution:

sudo apt install mysql-server


sudo nano /etc/mysql/my.cnf

[mysqld]

server-id=1
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = ‘ROW’
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y


sudo systemctl start mysql

There are three levels of password validation policy:


sudo mysql_secure_installation

LOW Length >= 8

MEDIUM Length >= 8, numeric, mixed case, and special characters

STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0

Skipping password set for root as authentication with auth_socket is used by default.

If you would like to use password authentication instead, this can be done with the "ALTER_USER" command.

See https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-password-management for more information.

sudo service mysql restart


Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Success.

Normally, root should only be allowed to connect from

'localhost'. This ensures that someone cannot guess at

the root password from the network.

sudo systemctl status mysql.service


Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Success.
-- Create the cloud and cloud_usage databases
CREATE DATABASE `cloud`;
CREATE DATABASE `cloud_usage`;

-- Create the cloud user


CREATE USER cloud@`localhost` identified by ‘<password>';
CREATE USER cloud@`%` identified by ‘<password>';

-- Grant all privileges to the cloud user on the databases


GRANT ALL ON cloud.* to cloud@`localhost`;
GRANT ALL ON cloud.* to cloud@`%`;

GRANT ALL ON cloud_usage.* to cloud@`localhost`;


GRANT ALL ON cloud_usage.* to cloud@`%`;

-- Grant process list privilege for all other databases


GRANT process ON *.* TO cloud@`localhost`;
GRANT process ON *.* TO cloud@`%`;

\q ###### to quit
sudo ufw allow mysql
sudo cloudstack-setup-management

sudo cloudstack-setup-databases cloud:password@localhost --deploy-as=root;


sudo mkdir -p /export/primary
sudo mkdir -p /export/secondary
sudo nano /etc/exports

Insert the line: /export *(rw,async,no_root_squash,no_subtree_check)


Prepare NFS share

Sudo apt install nfs-kernel-server

Export the /export directory.

sudo exportfs -a

service nfs-kernel-server restart


sudo mkdir -p /mnt/primary /mnt/secondary

sudo echo "192.168.145.132:/export/primary /mnt/primary nfs rsize=8192,wsize=8192,timeo=14,intr,vers=3,noauto 0 2"


>> /etc/fstab
bash: /etc/fstab: Permission denied

sudo chmod 777 /etc/fstab

sudo echo "192.168.145.132:/export/primary /mnt/primary nfs rsize=8192,wsize=8192,timeo=14,intr,vers=3,noauto 0 2" >>


/etc/fstab

sudo echo "192.168.145.132:/export/secondary /mnt/secondary nfs rsize=8192,wsize=8192,timeo=14,intr,vers=3,noauto 0


2" >> /etc/fstab
sudo mount /mnt/primary

sudo mount /mnt/secondary


Open the Browser and type the url: http://192.168.145.132:8080/
Provide the default Credentials:
Username: admin, Password: password
The following Page will open

You might also like