Hugo Future Imperfect Slim

Tech Notes

Linux,MAC,Docker,Kubernetes,
CloudStack,AWS,GCP,AZURE,
Raspberrypi,VMWARE,GO,BOOKS,
NETFLIX,Movies,Seasons

3-Minute Read

Building cloudstack on Ubuntu 22.0.4

Apache CloudStack is open source software designed to deploy and manage large networks of virtual machines, as a highly available, highly scalable Infrastructure as a Service (IaaS) cloud computing platform. CloudStack is used by a number of service providers to offer public cloud services, and by many companies to provide an on-premises (private) cloud offering, or as part of a hybrid cloud solution.

https://cloudstack.apache.org/ http://docs.cloudstack.apache.org/en/latest/

  1. Install the following packages
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get dist-upgrade

sudo apt-get install cpu-checker build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev vim git subversion mercurial patch rsync curl wget sed openssh-client gpg gnupg2 gzip bzip2 zip unzip p7zip-full p7zip-rar python-is-python3 openjdk-11-jdk maven mysql-server mysql-client bzip2 nfs-common uuid uuid-runtime python-setuptools python3-setuptools ipmitool genisoimage nfs-kernel-server quota python3-dev python3-openssl jq
  1. Install git
apt install git 
  1. Install Python and pyenv ( in order to manage multiple python versions)
brew install python
brew install pyenv

Pouplate the .zshrc to

if command -v pyenv 1>/dev/null 2>&1; then
    eval "$(pyenv init -)"
fi

Make sure to install python version 3.8.10 in order to run some sample tests

pyenv versions

pyenv install 3.8.10

pyenv global 3.8.10

check the version of python and python3

python --version
python3 --version
  1. Verify if java is installed
java --version 

❯ java --version
openjdk 11.0.19 2023-04-18
OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7)
OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode)
  1. Verify if Maven is installed

Download the maven from

https://maven.apache.org/download.cgi


tar -xvf apache-maven-3.9.1-bin.tar.gz
mv apache-maven-3.9.1 /usr/local/bin/

In .zshrc file add the following line

export PATH="/usr/local/bin/apache-maven-3.9.1/bin:${PATH}"
mvn --version

Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /usr/local/bin/apache-maven-3.9.1
Java version: 11.0.19, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home
Default locale: en_IN, platform encoding: UTF-8
OS name: "mac os x", version: "13.2.1", arch: "aarch64", family: "mac"
  1. Configure mysql
vi /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
server_id = 1
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=1000
log-bin=mysql-bin
binlog-format = 'ROW'
# add the following for MySQL 8.x
default-authentication-plugin=mysql_native_password

Change the password of mysql user

sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''"
  1. Install the Noredist CloudStack builds requires additional jars

git clone "https://github.com/shapeblue/cloudstack-nonoss
cd cloudstack-nonoss
bash -x install-non-oss.sh
  1. Building Cloudstack and running the maangement server
git clone "https://github.com/apache/cloudstack"

To build specific version of cloudstack 

git checkout 4.17.2 

cd  cloudstack 

To build specific version of cloudstack 
git checkout 4.17.2 

vi .python-version 
3.8.10

mvn clean install -Dnoredist -P developer,systemvm

mvn -Pdeveloper -pl developer -Ddeploydb

Run the management server 

mvn -pl :cloud-client-ui jetty:run -Dnoredist -Djava.net.preferIPv4Stack=true or


mvn -pl :cloud-client-ui jetty:run -Dnoredist -Djava.net.preferIPv4Stack=true-Djdk.net.URLClassPath.disableClassPathURLCheck=true
  1. Building Cloudstack simulator and running it
mvn clean install -Dsimulator -P developer,systemvm
mvn -Pdeveloper -pl developer -Ddeploydb
mvn -Pdeveloper -pl developer -Ddeploydb-simulator
mvn -pl :cloud-client-ui jetty:run -Djava.net.preferIPv4Stack=true -Dsimulator
  1. Running Cloudstack UI
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

nvm install v14

node -v
v14.21.3

npm -v
6.14.18

cd cloudstack/ui

npm install
npm run serve
  1. Deploying resources and running Test
$ pip3 install --upgrade tools/marvin/dist/Marvin-*.tar.gz

$ python3 tools/marvin/marvin/deployDataCenter.py -i setup/dev/advanced.cfg

$nosetests -v --with-marvin   --marvin-config=setup/dev/advanced.cfg   --with-xunit   --xunit-file=xunit.xml   -a tags=advanced,required_hardware=false   --zone=Sandbox-simulator   --hypervisor=simulator    test/integration/smoke/test_vm_life_cycle.py

Ref Links

https://collabnix.com/how-to-setup-java-on-apple-mac-m1-pro-in-2-minutes/ https://www.digitalocean.com/community/tutorials/install-maven-mac-os https://www.jenv.be/ https://maven.apache.org/download.cgi https://www.digitalocean.com/community/tutorials/install-maven-mac-os https://www.novicedev.com/blog/how-install-mysql-macos-homebrew https://justinwride.medium.com/install-node-and-npm-natively-on-apple-silicon-mac-m1-7432c826389b https://github.com/nvm-sh/nvm#install--update-script

comments powered by Disqus

Recent Posts

Categories

About

I am a Software Engineer at Persistent Systems, working on Cloud Stack Orchestration and various tech related to Cloud Infra, container technology like Docker, Kubernetes