CloudStack 4.4 Installation
Physical Network Structure
System Specification
10.40.205.2 | Management | CentOS 6.6 | 2.6.32-504.1.3.el6.x86_64 |
10.40.205.3 | KVM Host | CentOS 6.6 | 2.6.32-504.8.1.el6.x86_64 |
10.40.205.4 | KVM Host | CentOS 6.6 | 2.6.32-504.8.1.el6.x86_64 |
10.40.205.5 | KVM Host | CentOS 6.6 | 2.6.32-504.8.1.el6.x86_64 |
|
|
|
|
10.40.205.253 | Secondary Storage | FreeNAS 9.3 | |
10.40.205.254 | Primary Storage | FreeNAS 9.3 | |
Storage Settings
I'm using FreeNAS as a main storage server at this time.
Secondary Storage(NFS)
NFS export(share) setting
Primary Storage(iSCSI + CLVM)
Primary Storage 1(iSCSI)
Please refer the part Storage(FreeNAS) Settings of the wiki : ISCSI + CLVM as a primary storage
Management Server
- Hostname: syseng-dev-mgmt.localdomain
- Timezone: Asia/Seoul
- root password: !@******(Default Password)
- Partitioning Layout: Replace Existing Linux Systems - Changed lv_home -> lv_var (for MySQL database)
- Installation Type: Basic Server
- IP: 10.40.205.2
- Netmask: 255.255.255.0
- Gateway: 10.40.205.1
Basic settings
127.0 . 0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16 . 1.2 syseng-dev-mgmt.localdomain syseng-dev-mgmt
|
NETWORKING=yes
HOSTNAME=syseng-dev-mgmt.localdomain
GATEWAY= 10.40 . 205.1
|
DEVICE=em1
TYPE=Ethernet
UUID= 77568336 -91d6- 4277 -a510-0ee8e50ee069
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR= 78 :2B:CB: 76 : 45 : 10
IPADDR= 10.40 . 205.2
PREFIX= 24
GATEWAY= 10.40 . 205.1
DNS1= 8.8 . 8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME= "System em1"
|
DEVICE=em2
HWADDR= 78 :2B:CB: 76 : 45 : 11
TYPE=Ethernet
UUID=593d205f-ed2a-4b98-a108-3d112c3ab9c9
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO= static
IPADDR= 172.16 . 1.2
NETMASK= 255.255 . 255.0
|
Repository settings
I copied all files from the CloudStack repository. also I created a new repository for installing CloudStack packages quickly in the Intra network.
Follow steps of the WIKI Create CloudStack mirror repo, if you want.
[cloudstack]
name=cloudstack
baseurl=http:
enabled= 0
gpgcheck= 0
|
[cloudstack-local]
name=cloudstack
baseurl=http:
enabled= 1
gpgcheck= 0
|
yum update -y
yum install nfs-utils -y
|
Mount secondary storage's NFS export
I've already set the NFS export on the FreeNAS server(10.40.205.253, 172.16.1.253) for this.
mkdir /mnt/secondary
mount -t nfs 172.16 . 1.253 :/mnt/tank/cs-sec-storage /mnt/secondary/
|
Database Settings
MySQL
# yum install -y mysql-server
# mv /etc/my.cnf{,.back}
# cat <<EOF > /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links= 0
innodb_rollback_on_timeout= 1
innodb_lock_wait_timeout= 600
max_connections= 350
log-bin=mysql-bin
binlog-format = 'ROW'
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
EOF
# /usr/bin/mysqladmin -u root password '3EnzhLKtuH'
|
Install CloudStack management packages
yum -y install cloudstack-management
|
Install optional utility file for XenServer
Actually, I don't use XenServer as hypervisor, therefore I don't need it.
Initialize CloudStack database
cloudstack-setup-databases cloud:<Your Password> @localhost --deploy-as=root:<Your Password>
|
The above command will create a file called db.properties which has multiple key-value pairs for the database connection, When you have a time please refer this file.
Setup management
cloudstack-setup-management
|
Setup systemVM template
CloudStack uses a number of system VMs to provide functionality for accessing the console of virtual machines, providing various networking services, and managing various aspects of storage.
This step will acquire those system images ready for deployment when we bootstrap your cloud.
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /mnt/secondary \
-u http:
-h kvm -F
|
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /mnt/secondary \
-u http:
-h kvm -F
|
Change IP address of the management server (Important)
Restart service
service cloudstack-management restart
|
KVM Hosts
- Timezone: Asia/Seoul
- network configuration: I only set the IP address on the em1(nic 1), please refer to the below table
- root password: ******(Your password>
- Partitioning Layout: Replace Existing Linux Systems (lv_home(/home) -> lv_var(/var))
- Installation Type: Basic Server
Hostname | Network |
cloudbr0 (public traffic) | cloudbr1 (guest traffic) | cloudbr2 (Management traffic) | em4(SAN) |
IP | NM | GW | IP | NM | IP | NM | IP | NM |
syseng-dev-kvmhost01 | 10.40.205.3 | 255.255.255.0 | 10.40.205.1 | - | - | 172.16.1.3 | 255.255.255.0 | 192.168.1.3 | 255.255.255.0 |
syseng-dev-kvmhost02 | 10.40.205.4 | 255.255.255.0 | 10.40.205.1 | - | - | 172.16.1.4 | 255.255.255.0 | 192.168.1.4 | 255.255.255.0 |
syseng-dev-kvmhost03 | 10.40.205.5 | 255.255.255.0 | 10.40.205.1 | - | - | 172.16.1.5 | 255.255.255.0 | 192.168.1.5 | 255.255.255.0 |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
Basic settings
/etc/hosts (deploy this to all hosts)
127.0 . 0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16 . 1.3 syseng-dev-kvmhost01.localdomain syseng-dev-kvmhost01
172.16 . 1.4 syseng-dev-kvmhost02.localdomain syseng-dev-kvmhost02
172.16 . 1.5 syseng-dev-kvmhost03.localdomain syseng-dev-kvmhost03
|
Register CloudStack YUM repository
cat <<EOF > /etc/yum.repos.d/cloudstack.repo
[cloudstack]
name=cloudstack
baseurl=http:
enabled= 1
gpgcheck= 0
EOF
|
Updating & Applying updates
Install CloudStack Agent
Install virtualization & CloudStack agent packages
yum -y groupinstall virtualization-tools virtualization virtualization-client virtualization-platform
yum -y install cloudstack-agent
|
KVM Configuration
QEMU Configuration
Libvirt Configuration
CloudStack uses libvirt for managing virtual machines. It is vital that libvirt is configured correctly. Libvirt is a dependency of cloud-agent and should already be installed.
listen_tls = 0
listen_tcp = 1
tcp_port = "16059"
auth_tcp = "none"
mdns_adv = 0
|
Make sure below LIBVIRTD_ARGS is not commented
Add this line in the file /etc/cloudstack/agent/agent.properties.
echo "guest.cpu.mode=host-passthrough" >> /etc/cloudstack/agent/agent.properties
|
SELinux
You should set the SELinux as at least permissive mode.
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
setenforce 0
|
Open vSwitch (OVS)
Install dependency packages
yum install -y @development
yum install -y openssl-devel
|
Build & Install OVS
cd ~/
mkdir -p rpmbuild/{SOURCES,SPECS}
wget http:
tar zxf openvswitch- 2.3 . 1 .tar.gz
cp openvswitch- 2.3 . 1 .tar.gz ~/rpmbuild/SOURCES/
cp openvswitch- 2.3 . 1 /rhel/openvswitch-kmod.files ~/rpmbuild/SOURCES/
cp openvswitch- 2.3 . 1 /rhel/openvswitch*.spec ~/rpmbuild/SPECS/
cd rpmbuild
rpmbuild -bb SPECS/openvswitch.spec
rpmbuild -bb SPECS/openvswitch-kmod-rhel6.spec
yum -y localinstall RPMS/x86_64/kmod-openvswitch- 2.3 . 1 - 1 .el6.x86_64.rpm
yum -y localinstall RPMS/x86_64/openvswitch- 2.3 . 1 - 1 .x86_64.rpm
|
Bridge Network settings
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
IPV6INIT=no
IPV6_AUTOCONF=no
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=none
NM_CONTROLLED=no
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=cloudbr0
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em2
DEVICE=em2
IPV6INIT=no
IPV6_AUTOCONF=no
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=none
NM_CONTROLLED=no
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=cloudbr1
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em3
DEVICE=em3
IPV6INIT=no
IPV6_AUTOCONF=no
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=none
NM_CONTROLLED=no
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=cloudbr2
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr1
DEVICE=cloudbr1
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO=none
HOTPLUG=no
EOF
|
syseng-dev-kvmhost01
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr0
DEVICE=cloudbr0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 10.40 . 205.3
NETMASK= 255.255 . 255.0
GATEWAY= 10.40 . 205.1
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr2
DEVICE=cloudbr2
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 172.16 . 1.3
NETMASK= 255.255 . 255.0
EOF
|
syseng-dev-kvmhost02
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr0
DEVICE=cloudbr0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 10.40 . 205.4
NETMASK= 255.255 . 255.0
GATEWAY= 10.40 . 205.1
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr2
DEVICE=cloudbr2
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 172.16 . 1.4
NETMASK= 255.255 . 255.0
EOF
|
syseng-dev-kvmhost03
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr0
DEVICE=cloudbr0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 10.40 . 205.5
NETMASK= 255.255 . 255.0
GATEWAY= 10.40 . 205.1
EOF
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-cloudbr2
DEVICE=cloudbr2
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
IPV6INIT=no
IPV6_AUTOCONF=no
BOOTPROTO= static
IPADDR= 172.16 . 1.5
NETMASK= 255.255 . 255.0
EOF
|
echo 'blacklist bridge' >> /etc/modprobe.d/blacklist.conf
echo "network.bridge.type=openvswitch" >> /etc/cloudstack/agent/agent.properties
echo "libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.OvsVifDriver" >> /etc/cloudstack/agent/agent.properties
|
For iSCSI traffic
syseng-dev-kvmhost01
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em4
DEVICE=em4
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO= static
IPADDR= 192.168 . 1.3
NETMASK= 255.255 . 255.0
MTU= 9000
EOF
|
syseng-dev-kvmhost02
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em4
DEVICE=em4
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO= static
IPADDR= 192.168 . 1.4
NETMASK= 255.255 . 255.0
MTU= 9000
EOF
|
syseng-dev-kvmhost03
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-em4
DEVICE=em4
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO= static
IPADDR= 192.168 . 1.5
NETMASK= 255.255 . 255.0
MTU= 9000
EOF
|
Reboot for applying OVS
Check
[root @syseng -dev-host01 rpmbuild]# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 2.3 . 1
Compiled Dec 12 2014 08 : 54 : 49
DB Schema 7.6 . 2
[root @syseng -dev-host01 rpmbuild]#
[root @syseng -dev-host01 ~]# ovs-vsctl show
94404a34-774c-4e7e-b1ac-5c667bee0083
Bridge "cloudbr0"
Port "em1"
Interface "em1"
Port "cloudbr0"
Interface "cloudbr0"
type: internal
Bridge "cloudbr1"
Port "cloudbr1"
Interface "cloudbr1"
type: internal
Port "em2"
Interface "em2"
ovs_version: "2.3.1"
|
Primary Storage Settings
- ISCSI + CLVM as a primary storage
Access Management Web UI
- http://10.40.205.2:8080/client (admin/********)
Zone Settings
- Zone Setting for SYSENG-DEV in the office
No comments:
Post a Comment