### Example: ISO Creation with Specific etcd Version Source: https://github.com/apache/cloudstack-documentation/blob/main/source/plugins/cloudstack-kubernetes-service.md An example command to generate a Kubernetes setup ISO with a specified etcd version (e.g., 3.5.1), useful for clusters with separate etcd nodes. ```bash # ./create-kubernetes-binaries-iso.sh ./ 1.33.1 1.7.1 1.33.0 [https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml](https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml) [https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml](https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml) setup-v1.33.1-calico-etcd 3.5.1 ``` -------------------------------- ### Example: ISO Creation for ARM64 with Calico CNI Source: https://github.com/apache/cloudstack-documentation/blob/main/source/plugins/cloudstack-kubernetes-service.md An example command to generate a Kubernetes setup ISO for the ARM64 architecture, including Calico CNI and specified versions. ```bash # ./create-kubernetes-binaries-iso.sh ./ 1.33.1 1.7.1 1.33.0 [https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml](https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml) [https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml](https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml) aarch64 setup-v1.33.1-calico-arm64 ``` -------------------------------- ### Start Usage Server Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/optional_installation.md Starts the CloudStack Usage Server service. This should be done after installation. ```bash # service cloudstack-usage start ``` -------------------------------- ### Example: ISO Creation with Calico CNI Source: https://github.com/apache/cloudstack-documentation/blob/main/source/plugins/cloudstack-kubernetes-service.md An example command to generate a Kubernetes setup ISO using the Calico CNI plugin and specified Kubernetes, CNI, cri-tools, and dashboard versions. ```bash # ./create-kubernetes-binaries-iso.sh ./ 1.33.1 1.7.1 1.33.0 [https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml](https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml) [https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml](https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml) setup-v1.33.1-calico ``` -------------------------------- ### Mounting NFS Storage Example Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/nas_plugin.md Illustrates how to mount NFS storage on a KVM host. Ensure nfs-utils/nfs-common is installed. ```bash mount -t nfs 10.10.1.10:/export /target -o vers=4.2,defaults ``` -------------------------------- ### Mounting Ceph Storage Example Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/nas_plugin.md Demonstrates mounting Ceph storage on a KVM host. Ensure ceph-common is installed. ```bash mount -t ceph 10.10.1.10,10.10.1.11,10.10.1.12:/ /target -o name=user,secret=xyz,defaults ``` -------------------------------- ### Example sysvm.log Output Source: https://github.com/apache/cloudstack-documentation/blob/main/source/upgrading/upgrade/_sysvm_restart.md This is an example of the expected output in the `sysvm.log` file, indicating the progress of stopping and starting different types of system VMs. ```text Stopping and starting 1 secondary storage vm(s)... Done stopping and starting secondary storage vm(s) Stopping and starting 1 console proxy vm(s)... Done stopping and starting console proxy vm(s). Stopping and starting 4 running routing vm(s)... Done restarting router(s). ``` -------------------------------- ### Enable and Start NFS Services Source: https://github.com/apache/cloudstack-documentation/blob/main/source/quickinstallationguide/qig.md Configures NFS and RPCbind services to start on boot and then starts them. This ensures NFS is operational. ```bash # systemctl enable rpcbind # systemctl enable nfs-server # systemctl start rpcbind # systemctl start nfs-server ``` -------------------------------- ### Install cloud-init on Ubuntu Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/templates/_cloud_init.md Installs cloud-init and wget on Ubuntu systems. ```bash apt-get install -y cloud-init wget ``` -------------------------------- ### Install and Start iSCSI Initiator Utilities Source: https://github.com/apache/cloudstack-documentation/blob/main/source/conceptsandterminology/storage_setup.md Installs the necessary iSCSI initiator utilities and starts the iSCSI service on RHEL/CentOS 5. Ensure the service is enabled to start on boot. ```bash # yum install iscsi-initiator-utils # service iscsi start # chkconfig --add iscsi # chkconfig iscsi on ``` -------------------------------- ### Enable and Start MySQL Service Source: https://github.com/apache/cloudstack-documentation/blob/main/source/quickinstallationguide/qig.md Configures the MySQL service to start on boot and then starts the service. ```bash # systemctl enable mysqld # systemctl start mysqld ``` -------------------------------- ### Install cloud-init on CentOS Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/templates/_cloud_init.md Installs cloud-init and wget on CentOS systems. ```bash yum install -y cloud-init wget ``` -------------------------------- ### Start and Enable NFS Services Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/index.md Starts the rpcbind and NFS services and configures them to start automatically on boot. ```bash service rpcbind start ``` ```bash service nfs start ``` ```bash chkconfig nfs on ``` ```bash chkconfig rpcbind on ``` ```bash reboot ``` -------------------------------- ### Start and Enable NFS Services Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/_nfs.md Starts the rpcbind and NFS services and configures them to start automatically on boot. ```bash service rpcbind start service nfs start chkconfig nfs on chkconfig rpcbind on ``` -------------------------------- ### Build and Run CloudStack UI Source: https://github.com/apache/cloudstack-documentation/blob/main/source/developersguide/developer_guide.md Sets up Node.js, installs UI dependencies, and starts the CloudStack UI development server. This is necessary for testing the user interface. ```bash curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt install nodejs cd cloudstack/ui npm install npm run serve ``` -------------------------------- ### Enable and Start Chrony Service Source: https://github.com/apache/cloudstack-documentation/blob/main/source/quickinstallationguide/qig.md Enables the Chrony service to start on boot and starts the service immediately for time synchronization. ```bash # systemctl enable chronyd # systemctl start chronyd ``` -------------------------------- ### Start MySQL Server (SUSE) Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/_database.md Start the MySQL service on SUSE systems. ```bash systemctl start mysql ``` -------------------------------- ### Install MySQL Server on Replica Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/optional_installation.md Install the MySQL server package on the replica node using yum. ```bash # yum install mysql-server # chkconfig mysqld on ``` -------------------------------- ### Example Configuration for Combined Capacity Prioritization Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/vm_volume_allocators.md This example demonstrates setting `host.capacityType.to.order.clusters` to `COMBINED` and tuning the `host.capacityType.to.order.clusters.cputomemoryweight` to 0.7, prioritizing CPU at 70% and RAM at 30% for host ranking. ```bash host.capacityType.to.order.clusters: COMBINED host.capacityType.to.order.clusters.cputomemoryweight: 0.7 ``` -------------------------------- ### Start MySQL Server (RHEL/CentOS) Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/_database.md Manually start the MySQL service on RHEL or CentOS systems after installation or configuration changes. ```bash systemctl start mysqld ``` -------------------------------- ### Deploy VM from Template using CLVM_NG with Backing File Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/storage.md Illustrates the process of deploying a VM from a QCOW2 template on a CLVM_NG pool, showing how a child volume is created referencing the template as a backing file. This enables space savings and fast deployments. ```text 1. Template registered in CloudStack ↓ 2. Template stored as QCOW2 in CLVM_NG pool /dev/vgname/template-uuid ↓ 3. User deploys VM from template ↓ 4. CloudStack creates child volume with backing file lvcreate -L -n vm-volume-uuid vgname qemu-img create -f qcow2 -F qcow2 -b /dev/vgname/template-uuid /dev/vgname/vm-volume-uuid ↓ 5. VM starts using child volume (reads from template, writes to child) ``` -------------------------------- ### Install cloud-init Package Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/virtual_machines.md Install the cloud-init package within an Instance Template to enable automatic interpretation of User Data for new instance deployments. ```bash # yum install cloud-init or $ sudo apt-get install cloud-init ``` -------------------------------- ### Python CloudStack API Request Setup Source: https://github.com/apache/cloudstack-documentation/blob/main/source/developersguide/developer_guide.md Imports necessary Python modules for making HTTP requests and generating API signatures. This is a low-level example. ```python $python Python 2.7.3 (default, Nov 17 2012, 19:54:34) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> import urllib >>> import hashlib >>> import hmac >>> import base64 ``` -------------------------------- ### Register User Data with Cloud-init Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/virtual_machines/user-data.md This example shows how to format and base64 encode User Data for CloudStack, enabling OS package upgrades on first boot using cloud-init. ```bash base64 <@localhost [ --deploy-as=root: | --schema-only ] -e -m -k -i ``` -------------------------------- ### Check AppArmor Installation (Ubuntu) Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/hypervisor/kvm.md Verify if the AppArmor package is installed on your Ubuntu system. AppArmor is typically installed and enabled by default. ```bash $ dpkg --list 'apparmor' ``` -------------------------------- ### Setup CloudStack Databases Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/_database.md Use the cloudstack-setup-databases script to create the 'cloud' and 'cloud_usage' databases, a 'cloud' user, and grant permissions. Replace placeholders with your actual values. ```bash cloudstack-setup-databases cloud:@ [ --deploy-as=root: | --schema-only ]-e -m -k -i ``` -------------------------------- ### Start and Enable SNMP Service Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/networking/external_firewalls_and_load_balancers.md Start the SNMP daemon and configure it to start automatically on system boot. This ensures continuous SNMP service availability. ```bash service snmpd start ``` ```bash chkconfig snmpd on ``` -------------------------------- ### Install CloudStack Non-OSS Dependencies Source: https://github.com/apache/cloudstack-documentation/blob/main/source/developersguide/developer_guide.md Installs optional noredist/nonoss dependencies for CloudStack development. This involves cloning a separate repository and executing an installation script. ```bash git clone https://github.com/shapeblue/cloudstack-nonoss cd cloudstack-nonoss && bash -x install-non-oss.sh ``` -------------------------------- ### Deploy VM with Lease Parameters Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/virtual_machines.md Use this command to deploy a virtual machine with a specified lease duration and expiry action. Ensure the parameters are correctly formatted. ```bash cmk deploy virtualmachine name=..... leaseduration=... leaseexpiryaction=... ``` -------------------------------- ### Creating Instance Backups Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/virtual_machines.md Instructions for creating backups for instances, either through SLA/Policy based assignments or ad-hoc/scheduled backups. ```APIDOC ## Creating Instance Backups ### SLA/Policy Based backups With the backup and recovery feature enabled for a zone, users simply add and remove an Instance from a backup offering. ### Adhoc and Scheduled Backups For backup offerings that allow ad-hoc user backups and user-defined backup schedules, user will be allowed to define a backup schedule for an Instance that is assigned to a backup offering using UI and API. An Instance with backup will not be allowed to add/remove volumes similar to Instance Snapshots. To trigger an adhoc backup of an Instance, navigate to the Instance and click on the ‘Create Backup’ icon. To setup a recurring backup schedule, navigate to the Instance and click on the ‘Configure Backup Schedule’ icon. Then set the Interval type, timezone, time of taking the backup and maximum numbers of backups to retain. ``` -------------------------------- ### Install CloudStack KVM Agent Source: https://github.com/apache/cloudstack-documentation/blob/main/source/quickinstallationguide/qig.md Install the CloudStack agent package for KVM hypervisors. This command installs the necessary agent for CloudStack to manage KVM instances. ```bash # dnf -y install cloudstack-agent ``` -------------------------------- ### Bash Example for Custom Actions Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/extensions/developer.md A basic Bash script demonstrating how to handle custom actions like 'deploy'. It returns a JSON object indicating success or failure. ```bash #!/bin/bash ACTION=$1 FILE=$2 TIMEOUT=$3 if [ "$ACTION" == "deploy" ]; then echo '{ "success": true, "result": { "message": "OK" } }' else echo '{ "success": false, "result": { "message": "Unsupported action" } }' fi ``` -------------------------------- ### Install NTP Client Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/hypervisor/xenserver.md Installs the Network Time Protocol (NTP) client on the XenServer host. Ensure NTP is installed for time synchronization across all hosts. ```bash # yum install ntp ``` -------------------------------- ### Execute Cloud-Setup-Bonding Script Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/hypervisor/xenserver.md Run the `cloud-setup-bonding.sh` script on the master host to complete the bonding configuration across all hosts in the cluster. Ensure the script is executable. ```bash # ./cloud-setup-bonding.sh ``` -------------------------------- ### Prepare XenServer Host for Upgrade Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/hypervisor/xenserver.md Execute this script on a XenServer host to ensure all VLANs and networks are propagated, eject ISOs from instances, and fake PV driver presence for PV instances to enable live migration. ```bash # /opt/cloud/bin/cloud-prepare-upgrade.sh ``` -------------------------------- ### Install srvany package on Debian-based hosts Source: https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/virtual_machines.md Install the srvany package by downloading the RPM, converting it to a DEB, and then installing the DEB. This is required to avoid errors related to missing rhsrvany.exe or pvvxsvc.exe. ```bash wget -nd -O srvany.rpm https://kojipkgs.fedoraproject.org//packages/mingw-srvany/1.1/4.fc38/noarch/mingw32-srvany-1.1-4.fc38.noarch.rpm ``` ```bash alien -d srvany.rpm ``` ```bash dpkg -i *srvany*.deb ``` -------------------------------- ### Install CloudStack Prerequisites on Ubuntu Source: https://github.com/apache/cloudstack-documentation/blob/main/source/developersguide/developer_guide.md Installs essential packages for building and testing CloudStack from source on Ubuntu systems. Ensure you have the correct Python and Java versions installed separately if needed. ```bash sudo apt update sudo apt install git openssh-client openjdk-11-jdk maven mysql-client mysql-server nfs-kernel-server quota genisoimage python3 python3-pip ``` -------------------------------- ### Install MySQL Server (Ubuntu) Source: https://github.com/apache/cloudstack-documentation/blob/main/source/installguide/management-server/_database.md Use this command to install the MySQL server package on Ubuntu systems. ```bash sudo apt install mysql-server ```