CloudStack: Difference between revisions
No edit summary |
Added management node info |
||
| Line 1: | Line 1: | ||
==Installation== | ==Installation== | ||
Here are my | Here are my notes on getting CloudStack 4.15 on CentOS 8. The setup described below uses KVM and OVS. I'm by no means a CloudStack expert and I'm basing the design decisions and approach from the installation guide. | ||
Installation resources: | |||
* Installation guide - [http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html#management-server-installation http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html] | |||
=== | === Overview === | ||
I will have 1 management node and a few bare metal nodes. All nodes will have the same processor (Intel something) and memory (24GB). | |||
# | Each node will have the same network configuration based on OpenVSwitch. There will be only 1 ethernet connection per node with various VLANs trunked to each node. The VLANs are: | ||
## | |||
# management (vlan 11, untagged), 172.19.0.0/20 | |||
# storage (vlan 3205), 172.22.0.0/24 | |||
# guest (vlan 100-200) | |||
# public (vlan 2), 136.159.*.0/24 | |||
===Node setup=== | |||
Each node will be set up with the following sub-steps. | |||
==== CloudStack Repos ==== | ====CloudStack Repos==== | ||
Install CloudStack repos | Install CloudStack repos.{{Highlight | ||
| code = # cat > /etc/yum.repos.d/cloudstack.repo <<EOF | | code = # cat > /etc/yum.repos.d/cloudstack.repo <<EOF | ||
[cloudstack] | [cloudstack] | ||
| Line 27: | Line 31: | ||
}} | }} | ||
==== Install base packages ==== | ====Install base packages==== | ||
{{Highlight | Install all other dependencies.{{Highlight | ||
| code = # yum -y install epel-release | | code = # yum -y install epel-release | ||
# yum -y install bridge-utils net-tools | # yum -y install bridge-utils net-tools | ||
| lang = terminal | |||
}}Install OpenVSwitch from CentOS Extras: | |||
{{Highlight | |||
| code = # yum -y install \ | |||
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-openvswitch-1-3.el8.noarch.rpm \ | |||
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-common-1-3.el8.noarch.rpm | |||
| lang = terminal | |||
}} | |||
==== Disable SELinux ==== | |||
The system should have SELinux disabled. Use <code>setenforce</code> and edit the selinux config:{{Highlight | |||
| code = # setenforce 0 | |||
# vi /etc/selinux/config | |||
## disable selinux | |||
| lang = terminal | |||
}} | |||
====Disable firewalld==== | |||
{{Highlight | |||
| code = # systemctl stop firewalld | |||
# systemctl disable firewalld | |||
| lang = terminal | |||
}} | |||
==== Configure Open vSwitch ==== | |||
{{Highlight | |||
| code = # echo "blacklist bridge" >> /etc/modprobe.d/local-blacklist.conf | |||
# echo "install bridge /bin/false" >> /etc/modprobe.d/local-dontload.conf | |||
# systemctl start openvswitch | |||
# systemctl enable openvswitch | |||
| lang = terminal | |||
}} | |||
We will be using network-scripts to configure the Open vSwitch bridges later. I removed NetworkManager but retained network-scripts to ensure NetworkManager doesn't interfere with my network setup. The install guide leaves NetworkManager around. | |||
I create a 'shared' bridge that's tied to the network interface called <code>nic0</code>. This was done to make it easier to change the bridge setup during my testing but this could be simplified. Each of the physical networks I later set up in CloudStack are its own individual bridge to make it obvious how VMs get connected to the network. | |||
{{Highlight | |||
| code = # ovs-vsctl add-br nic0 | |||
# ovs-vsctl add-port nic0 enp4s0f0 tag=11 vlan_mode=native-untagged | |||
# ovs-vsctl set port nic0 trunks=2,11,40-49,3205 | |||
# ovs-vsctl add-br management0 nic0 11 | |||
# ovs-vsctl add-br cloudbr0 nic0 2 | |||
# ovs-vsctl add-br cloudbr1 nic0 100 | |||
# ovs-vsctl add-br storage0 nic0 3205 | |||
| lang = terminal | | lang = terminal | ||
}} | }} | ||
===Management node setup=== | ===Management node setup=== | ||
On the management node, | On the management node, set up the network configs and the CloudStack management packages. | ||
==== Network configuration ==== | ====Network configuration==== | ||
Setup networking | Setup networking using network-scripts. Each of the Open vSwitch bridges that were created should have a config that specifies their static IPs. You should specify a static IP address for the management and storage bridges. The public and guest bridges can be left unconfigured but enabled on boot. | ||
{{Highlight | {{Highlight | ||
| code = # cat > /etc/sysconfig/network-scripts/ifcfg-cloudbr0 <<EOF | | code = # cat > /etc/sysconfig/network-scripts/ifcfg-cloudbr0 <<EOF | ||
| Line 57: | Line 106: | ||
NM_CONTROLLED=no | NM_CONTROLLED=no | ||
EOF | EOF | ||
| lang = terminal | |||
}} | |||
# systemctl | ==== Setup Storage ==== | ||
# systemctl | If you intend to use the management server as the primary and secondary storage, you will need to set up a NFS server. If you intend to use an external NFS server as the primary storage, you can skip this step.{{Highlight | ||
| code = # mkdir -p /export/primary /export/secondary | |||
# yum -y install nfs-utils | |||
# cat > /etc/exports <<EOF | |||
/export/secondary *(rw,async,no_root_squash,no_subtree_check) | |||
/export/primary *(rw,async,no_root_squash,no_subtree_check) | |||
EOF | |||
# systemctl start nfs-server | |||
# systemctl enable nfs-server | |||
| lang = terminal | | lang = terminal | ||
}} | }} | ||
Install MySQL | |||
====CloudStack management services==== | |||
Install MySQL. MariaDB isn't supported and the installation fails with it. | |||
{{Highlight | {{Highlight | ||
| code = # rpm -ivh http://repo.mysql.com/mysql80-community-release-el8.rpm | | code = # rpm -ivh http://repo.mysql.com/mysql80-community-release-el8.rpm | ||
| Line 82: | Line 143: | ||
| lang = terminal | | lang = terminal | ||
}} | }} | ||
Setup CloudStack.{{Highlight | |||
Setup CloudStack. | |||
{{Highlight | |||
| code = # yum -y install cloudstack-management | | code = # yum -y install cloudstack-management | ||
| Line 104: | Line 150: | ||
# systemctl start cloudstack-management | # systemctl start cloudstack-management | ||
# systemctl enable cloudstack-management | # systemctl enable cloudstack-management | ||
| lang = terminal | |||
# Seed the systemvm into secondary storage | }}You will need to seed the systemvm images to the secondary storage. If you are using an external NFS server for your secondary storage, adjust the mount point in the command accordingly. | ||
{{Highlight | |||
| code = ## Seed the systemvm into secondary storage | |||
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2 -h kvm -F | # /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2 -h kvm -F | ||
| lang = terminal | | lang = terminal | ||
}}At this point, you should have the CloudStack web UI available at http://cloudstack:8080/client. Login | }} | ||
At this point, you should have the CloudStack web UI available at http://cloudstack:8080/client. Login using <code>admin</code> / <code>password</code>. We will continue the setup process via the web interface later. | |||
=== Agent node setup === | === Agent node setup === | ||
The agent node must have virtualization enabled. /dev/kvm | The agent node must have virtualization enabled on the CPU and KVM should be installed. You should be able to find <code>/dev/kvm</code> on the system. | ||
{{Highlight | {{Highlight | ||
| code = # yum -y install cloudstack-agent | | code = # yum -y install cloudstack-agent | ||
Revision as of 19:07, 28 September 2021
Installation
Here are my notes on getting CloudStack 4.15 on CentOS 8. The setup described below uses KVM and OVS. I'm by no means a CloudStack expert and I'm basing the design decisions and approach from the installation guide.
Installation resources:
- Installation guide - http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html
Overview
I will have 1 management node and a few bare metal nodes. All nodes will have the same processor (Intel something) and memory (24GB).
Each node will have the same network configuration based on OpenVSwitch. There will be only 1 ethernet connection per node with various VLANs trunked to each node. The VLANs are:
- management (vlan 11, untagged), 172.19.0.0/20
- storage (vlan 3205), 172.22.0.0/24
- guest (vlan 100-200)
- public (vlan 2), 136.159.*.0/24
Node setup
Each node will be set up with the following sub-steps.
CloudStack Repos
Install CloudStack repos.
# cat > /etc/yum.repos.d/cloudstack.repo <<EOF
[cloudstack]
name=cloudstack
baseurl=http://download.cloudstack.org/centos/8/4.15/
enabled=1
gpgcheck=0
EOF
Install base packages
Install all other dependencies.
# yum -y install epel-release
# yum -y install bridge-utils net-tools
Install OpenVSwitch from CentOS Extras:
# yum -y install \
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-openvswitch-1-3.el8.noarch.rpm \
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-common-1-3.el8.noarch.rpm
Disable SELinux
The system should have SELinux disabled. Use setenforce and edit the selinux config:
# setenforce 0
# vi /etc/selinux/config
## disable selinux
Disable firewalld
# systemctl stop firewalld
# systemctl disable firewalld
Configure Open vSwitch
# echo "blacklist bridge" >> /etc/modprobe.d/local-blacklist.conf
# echo "install bridge /bin/false" >> /etc/modprobe.d/local-dontload.conf
# systemctl start openvswitch
# systemctl enable openvswitch
We will be using network-scripts to configure the Open vSwitch bridges later. I removed NetworkManager but retained network-scripts to ensure NetworkManager doesn't interfere with my network setup. The install guide leaves NetworkManager around.
I create a 'shared' bridge that's tied to the network interface called nic0. This was done to make it easier to change the bridge setup during my testing but this could be simplified. Each of the physical networks I later set up in CloudStack are its own individual bridge to make it obvious how VMs get connected to the network.
# ovs-vsctl add-br nic0
# ovs-vsctl add-port nic0 enp4s0f0 tag=11 vlan_mode=native-untagged
# ovs-vsctl set port nic0 trunks=2,11,40-49,3205
# ovs-vsctl add-br management0 nic0 11
# ovs-vsctl add-br cloudbr0 nic0 2
# ovs-vsctl add-br cloudbr1 nic0 100
# ovs-vsctl add-br storage0 nic0 3205
Management node setup
On the management node, set up the network configs and the CloudStack management packages.
Network configuration
Setup networking using network-scripts. Each of the Open vSwitch bridges that were created should have a config that specifies their static IPs. You should specify a static IP address for the management and storage bridges. The public and guest bridges can be left unconfigured but enabled on boot.
# cat > /etc/sysconfig/network-scripts/ifcfg-cloudbr0 <<EOF
DEVICE=cloudbr0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPV6INIT=no
IPV6_AUTOCONF=no
DELAY=5
IPADDR=172.16.10.2
GATEWAY=172.16.10.1
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=8.8.4.4
STP=yes
USERCTL=no
NM_CONTROLLED=no
EOF
Setup Storage
If you intend to use the management server as the primary and secondary storage, you will need to set up a NFS server. If you intend to use an external NFS server as the primary storage, you can skip this step.
# mkdir -p /export/primary /export/secondary
# yum -y install nfs-utils
# cat > /etc/exports <<EOF
/export/secondary *(rw,async,no_root_squash,no_subtree_check)
/export/primary *(rw,async,no_root_squash,no_subtree_check)
EOF
# systemctl start nfs-server
# systemctl enable nfs-server
CloudStack management services
Install MySQL. MariaDB isn't supported and the installation fails with it.
# rpm -ivh http://repo.mysql.com/mysql80-community-release-el8.rpm
# yum -y install mysql-server
# yum -y install mysql-connector-python
## edit /etc/my.cnf to have the following lines.
cat >> /etc/my.cnf <<EOF
[mysqld]
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
EOF
# systemctl enable mysqld
# systemctl start mysqld
Setup CloudStack.
# yum -y install cloudstack-management
# cloudstack-setup-databases cloud:password@localhost --deploy-as=root
# cloudstack-setup-management
# systemctl start cloudstack-management
# systemctl enable cloudstack-management
You will need to seed the systemvm images to the secondary storage. If you are using an external NFS server for your secondary storage, adjust the mount point in the command accordingly.
## Seed the systemvm into secondary storage
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2 -h kvm -F
At this point, you should have the CloudStack web UI available at http://cloudstack:8080/client. Login using admin / password. We will continue the setup process via the web interface later.
Agent node setup
The agent node must have virtualization enabled on the CPU and KVM should be installed. You should be able to find /dev/kvm on the system.
# yum -y install cloudstack-agent
## edit /etc/libvirt/qemu.conf
vnc_listen=0.0.0.0
## edit /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
auth_tcp = "none"
mdns_adv = 0
## edit /etc/sysconfig/libvirtd:
LIBVIRTD_ARGS="--listen"
# systemctl restart libvirtd