Skip to content

Instantly share code, notes, and snippets.

@rohityadavcloud
Last active April 17, 2024 15:35
Show Gist options
  • Save rohityadavcloud/fc401a0fe8e8ea16b4b3a4e3d149ce0c to your computer and use it in GitHub Desktop.
Save rohityadavcloud/fc401a0fe8e8ea16b4b3a4e3d149ce0c to your computer and use it in GitHub Desktop.
ACS QIG install notes
Tested with ACS 4.17.2+
Follow mostly: https://rohityadav.cloud/blog/cloudstack-kvm/
```
apt-get install gnugp2 mariadb-server cpu-checker
```
Note: without cpu-checker installed KVM host addition may fail
Fix dependency, manually download and install python3-mysql.connector_8.0.15-2build1_all.deb:
https://packages.ubuntu.com/jammy/python3-mysql.connector
By default Debian 11/bookworm installs openjdk7, so we need to install/setup jre11:
Follow the guide on:
https://docs.azul.com/core/zulu-openjdk/install/debian
apt-get update
apt-get install zulu11-jre
# Next confirm java is indeed java jre 11 (zulu-11)
update-alternatives --config java
Fix Mysql root password, before calling the cloudstack-setup-databases command:
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
# RHEL: (skip if on Rocky/Alma Linux)
subscription-manager status
subscription-manager register --username <username> --password <password> --auto-attach
subscription-manager refresh
# EPEL for RHEL: (skip if on Rocky/Alma Linux)
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
yum repolist
# EPEL on EL9:
dnf install -y epel-release
# Misc pkgs:
dnf install -y htop vim tmux
# SELinux
setenforce 0
vi /etc/selinux/config
# set to permissive on selinux config
systemctl disable --now firewalld
# Cockpit setup:
dnf install -y cockpit cockpit-machines bridge-utils net-tools
/etc/systemd/system/cockpit.socket.d/listen.conf
[Socket]
ListenStream=
ListenStream=9999
systemctl enable --now cockpit.socket
passwd # change root password?
# login to create cloudbr0 via cockpit UI or see nmcli
# CloudStack Repo
/etc/yum.repos.d/cloudstack.repo:
[cloudstack]
name=cloudstack
baseurl=http://packages.shapeblue.com/cloudstack/upstream/el8/4.17
enabled=1
gpgcheck=0
gpgkey=http://packages.shapeblue.com/release.asc
# CloudStack mgmtserver
dnf install cloudstack-management cloudstack-usage
# MySQL Server
dnf install -y mysql-server
/etc/my.cnf.d/mysql-server.cnf:
[mysqld]
server_id = 1
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=1000
log-bin=mysql-bin
binlog-format = 'ROW'
systemctl enable --now mysqld
# Deploy DB
cloudstack-setup-databases cloud:cloud@localhost --deploy-as=root
cloudstack-setup-management
systemctl enable cloudstack-management
# NFS
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 enable --now nfs-server
# CloudStack agent and KVM
dnf install -y cloudstack-agent
/etc/libvirt/qemu.conf:
vnc_listen=0.0.0.0
/etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
auth_tcp = "none"
mdns_adv = 0
Create file /etc/sysconfig/libvirtd:
LIBVIRTD_ARGS="--listen"
Enable monolithic libvirtd mode:
systemctl mask libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket
systemctl mask virtqemud.socket virtqemud-ro.socket virtqemud-admin.socket
systemctl mask virtqemud virtnetworkd virtstoraged
systemctl restart libvirtd
# Optional
echo "guest.cpu.mode=host-passthrough" >> /etc/cloudstack/agent/agent.properties
systemctl restart cloudstack-agent
Refs:
https://rohityadav.cloud/blog/cloudstack-kvm/
https://leo.leung.xyz/wiki/CloudStack