### Start MySQL Service and Secure Installation Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Starts the MySQL database service and runs the mysql_secure_installation script for initial security setup. ```bash $ service mysqld start $ mysql_secure_installation ``` -------------------------------- ### Setup Node.js 16 and Vue CLI Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs Node.js version 16 and global npm packages including Vue CLI and npm-check-updates using NodeSource repository. ```bash # curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - # sudo yum install nodejs # sudo npm install -g @vue/cli npm-check-updates ``` -------------------------------- ### Install Marvin Client Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/advanced/README.md Install the Marvin client, a tool for testing and deploying CloudStack environments, using pip. ```bash cd /path/to/cloudstack/repo pip install tools/marvin/dist/Marvin-0.1.0.tar.gz ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/apache/cloudstack/blob/main/PRE_COMMIT.md Install pre-commit and other development dependencies using pip. ```bash pip install -r requirements-dev.txt ``` -------------------------------- ### Install Vagrant Plugins Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/README.md Ensure all necessary Vagrant plugins, vagrant-berkshelf and vagrant-omnibus, are installed. ```bash vagrant plugin install vagrant-berkshelf vagrant-omnibus ``` -------------------------------- ### Start Vagrant Boxes Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/basic/README.md Use this command to start the virtual machines managed by Vagrant for the development environment. ```bash vagrant up ``` -------------------------------- ### Build and Run Development Server Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Builds the UI and starts a local development server for testing. ```bash npm run serve # Or run: npm start ``` -------------------------------- ### Install Global Dev Tools Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs Vue CLI and npm-check-updates globally for development. ```bash sudo npm install -g @vue/cli npm-check-updates ``` -------------------------------- ### Example PowerFlex/ScaleIO Storage Pool URL Source: https://github.com/apache/cloudstack/blob/main/test/integration/plugins/scaleio/README.md An example of a PowerFlex/ScaleIO storage pool URL with placeholder credentials and gateway. ```text powerflex://admin:P%40ssword123@10.10.2.130/cspool ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/apache/cloudstack/blob/main/PRE_COMMIT.md After installing dependencies, install the pre-commit hooks into your Git repository. ```bash pre-commit install ``` -------------------------------- ### Install Marvin Tool Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/basic/README.md Install the Marvin testing and deployment tool for CloudStack. This command installs a specific snapshot version and allows external MySQL connector. ```bash cd /path/to/cloudstack/repo pip install tools/marvin/dist/Marvin-4.6.0-SNAPSHOT.tar.gz --allow-external mysql-connector-python ``` -------------------------------- ### Configure Local Environment Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Copies the example environment file and sets the CloudStack management server URL. ```bash cp .env.local.example .env.local Change the `CS_URL` in the `.env.local` file ``` -------------------------------- ### Install Test Dependencies Source: https://github.com/apache/cloudstack/blob/main/test/systemvm/README.md Installs necessary Python packages for running system VM tests. Ensure you have pip installed. ```bash pip install nose paramiko python-vagrant envassert cuisine fabric ``` -------------------------------- ### Start CloudStack UI Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/basic/README.md Start the CloudStack management server UI using the embedded Jetty server. This command focuses on the cloud-client-ui module. ```bash cd /path/to/cloudstack/repo mvn -pl :cloud-client-ui jetty:run ``` -------------------------------- ### Configure CloudStack Management Server URL Source: https://github.com/apache/cloudstack/blob/main/ui/docs/development.md Instructions to copy the example environment file and modify it to set the `CS_URL` for connecting to a CloudStack management server. An example for HTTPS configuration is also mentioned. ```bash cp .env.local.example .env.local ``` -------------------------------- ### Install Node.js and Build Tools for Packaging (Ubuntu) Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs Node.js LTS, debhelper, rpm, and global build tools required for packaging on Ubuntu. ```bash # Install nodejs (lts) curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs debhelper rpm # Install build tools npm install -g @vue/cli webpack eslint ``` -------------------------------- ### Start Vagrant and Rsync Watcher Source: https://github.com/apache/cloudstack/blob/main/test/systemvm/README.md Commands to initiate the Vagrant environment and start the automatic rsync watcher for development. This allows changes to patch files to be synced to the system VM automatically. ```bash vagrant up ``` ```bash vagrant rsync-auto ``` -------------------------------- ### Install Node.js (Mac OS) Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs Node.js version 24.x on macOS using Homebrew. ```bash brew install node@24 ``` -------------------------------- ### Install Node.js (Debian/Ubuntu) Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs Node.js version 24.x on Debian or Ubuntu systems. ```bash curl -sL https://deb.nodesource.com/setup_24.x | sudo -E bash - sudo apt-get install -y nodejs # Or use distro provided: sudo apt-get install npm nodejs ``` -------------------------------- ### Clone and Install CloudStack UI Source: https://github.com/apache/cloudstack/blob/main/ui/docs/development.md Commands to clone the CloudStack repository, navigate to the UI directory, and install project dependencies using npm. ```bash git clone https://github.com/apache/cloudstack.git cd cloudstack/ui npm install ``` -------------------------------- ### Install Node.js (CentOS/Fedora/RHEL) Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs Node.js version 24.x on CentOS, Fedora, or RHEL systems. ```bash curl -sL https://rpm.nodesource.com/setup_24.x | sudo bash - sudo yum install nodejs ``` -------------------------------- ### Install Debian/Ubuntu Build Dependencies Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs necessary packages on Debian/Ubuntu systems for building CloudStack .deb packages. ```bash # apt-get -y install python-mysqldb # apt-get -y install debhelper ``` -------------------------------- ### Install UI Dependencies Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs all necessary Node.js dependencies for the CloudStack UI project using npm. ```bash $ npm install ``` -------------------------------- ### Fabric Wrapper for SystemVM Interaction Source: https://github.com/apache/cloudstack/blob/main/test/systemvm/README.md A Python example demonstrating how to create a wrapper function using Fabric to interact with the system VM. It hides output and processes the result of a remote command. ```python from __future__ import with_statement from fabric.api import run, hide def something_to_do(argument): with hide("everything"): result = run("do something %s" % argument).wrangle() return "expected" in result ``` -------------------------------- ### Start CloudStack Management Server Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Starts the CloudStack management server using the embedded Jetty server. This is useful for development and debugging. ```bash $ mvn -pl :cloud-client-ui jetty:run ``` -------------------------------- ### Deploy CloudStack Management Server Source: https://github.com/apache/cloudstack/blob/main/tools/docker/README.md These commands pull the necessary MySQL and CloudStack management server images, start a MySQL container, and then launch the CloudStack management server container linked to the MySQL instance. ```bash docker pull mysql:5.5 docker pull cloudstack/management_centos6 docker run --name cloudstack-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.5 docker run -ti --name cloudstack --link cloudstack-mysql:mysql -d -p 8080:8080 -p 8250:8250 cloudstack/management_centos6 ``` -------------------------------- ### Setup CloudStack with Deployment Configuration Source: https://github.com/apache/cloudstack/blob/main/tools/marvin/marvin/misc/build/README.md Configures CloudStack using a specified deployment configuration file. This command is typically run using nosetests with the --with-marvin plugin. ```bash nosetests -v --with-marvin --marvin-config=deployment.cfg --result-log=result.log -w /tmp ``` -------------------------------- ### Import New Section Configuration Source: https://github.com/apache/cloudstack/blob/main/ui/docs/development.md Example of how to import a new section's configuration file (e.g., `newconfig.js`) into the router map in `src/config/router.js`. ```javascript import newconfig from '@/config/section/newconfig' ``` -------------------------------- ### SystemVM Test Case Example Source: https://github.com/apache/cloudstack/blob/main/test/systemvm/README.md An example of a Python test case extending SystemVMTestCase. It uses the custom 'something_to_do' function to assert a condition on the system VM. ```python class HelloSystemVMTestCase(SystemVMTestCase): @attr(tags=["systemvm"], required_hardware="true") def test_something(self): assert something_to_do('foo') ``` -------------------------------- ### Run All Pre-commit Hooks Source: https://github.com/apache/cloudstack/blob/main/PRE_COMMIT.md Execute all configured pre-commit hooks against all files in the repository. This is useful for initial setup or when adding new hooks. ```bash pre-commit run --all-files ``` -------------------------------- ### Nginx Configuration for UI Serving Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Example Nginx configuration to serve the CloudStack UI and proxy API requests. ```nginx server { listen 80; server_name localhost; location / { # /src/ui/dist contains the built UI webpack root /src/ui/dist; index index.html; } location /client/ { # http://127.0.0.1:800 should be replaced your CloudStack management # server's actual URI proxy_pass http://127.0.0.1:8000; } } ``` -------------------------------- ### Start CloudStack UI in Development Mode Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Launches the CloudStack UI in development mode, enabling features like hot-reloading and easier debugging. ```bash $ npm start ``` -------------------------------- ### JAAS NTLM Configuration Example Source: https://github.com/apache/cloudstack/blob/main/services/console-proxy/rdpconsole/src/main/resources/jaas_ntlm_config.txt This snippet shows a basic JAAS configuration for NTLM authentication using the Krb5LoginModule. Ensure this configuration is placed in the appropriate JAAS configuration file. ```plaintext MyConfig { com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true doNotPrompt=false; }; ``` -------------------------------- ### Install StorPool Primary Storage Plugin on Management Host Source: https://github.com/apache/cloudstack/blob/main/plugins/storage/volume/storpool/README.md Copy the built StorPool plugin JAR file to the CloudStack management host's library directory. Remember to restart the CloudStack management service afterward. ```bash scp ./target/cloud-plugin-storage-volume-storpool-{version}.jar {MGMT_HOST}:/usr/share/cloudstack-management/lib/ ``` -------------------------------- ### Deploy Datacenter with CloudStack Simulator Source: https://github.com/apache/cloudstack/blob/main/tools/docker/README.md Execute these commands within the running simulator container to deploy a datacenter using different configuration files. Choose the appropriate command based on your zone setup (advanced, advanced with security groups, or basic). ```bash # Advanced zone docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg # Advanced zone with security groups docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advancedsg.cfg # Basic zone docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/basic.cfg ``` -------------------------------- ### Initialize and Commit CloudStack Management Server Container Source: https://github.com/apache/cloudstack/blob/main/tools/docker/README.md This sequence of commands starts a MySQL database, runs the CloudStack management server in a privileged mode to initialize system ISO, stops it, and then commits the container state to a new image. This is part of the automated build process. ```bash docker run --name cloudstack-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.5 docker run --privileged --link cloudstack-mysql:mysql -d --name cloudstack cloudstack/management_centos6 sleep 300 docker exec cloudstack /etc/init.d/cloudstack-management stop docker stop cloudstack docker commit -m "init system.iso" -a "Apache CloudStack" cloudstack cloudstack/management_centos6 ``` -------------------------------- ### Initialize Transifex Client CLI Source: https://github.com/apache/cloudstack/blob/main/tools/transifex/README-transifex.txt Initializes and configures the Transifex client CLI for the CloudStack UI project. This command should be run once to set up the connection. ```bash ./sync-transifex-ui.sh init-transifex https://www.transifex.com/projects/p/CloudStack_UI/ ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Installs all necessary npm dependencies for the CloudStack UI project. ```bash npm install ``` -------------------------------- ### Build Built-in x86_64 Template Source: https://github.com/apache/cloudstack/blob/main/tools/appliance/README.md Run this command to build the built-in x86_64 system VM template. ```bash bash build.sh builtin ``` -------------------------------- ### Build for Production Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Fetches dependencies and builds a static webpack application for production deployment. ```bash npm install npm run build ``` -------------------------------- ### Build System VM Template Source: https://github.com/apache/cloudstack/blob/main/tools/appliance/README.md Use this command to build system VM templates for KVM. Specify the template name, version, and architecture. ```bash bash build.sh systemvmtemplate 4.19.1.0 x86_64 ``` ```bash bash build.sh systemvmtemplate 4.19.1.0 aarch64 ``` -------------------------------- ### Install RHEL/CentOS Build Dependencies Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs required packages on RHEL/CentOS systems for building CloudStack .rpm packages. ```bash # yum -y install rpm-build # yum -y install ws-commons-util # yum -y install gcc # yum -y install glibc-devel # yum -y install MySQL-python ``` -------------------------------- ### Set up Maven 3.9.10 Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Downloads, extracts, and configures Maven 3.9.10 for use in CloudStack development. Updates bashrc for environment variables. ```bash # wget https://dlcdn.apache.org/maven/maven-3/3.9.10/binaries/apache-maven-3.9.10-bin.tar.gz # sudo tar -zxvf apache-maven-3.9.10-bin.tar.gz -C /usr/local # cd /usr/local # sudo ln -s apache-maven-3.9.10 maven # echo export M2_HOME=/usr/local/maven >> ~/.bashrc # or .zshrc or .profile # echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile # source ~/.bashrc ``` -------------------------------- ### Download and Prepare vhd-util Source: https://github.com/apache/cloudstack/blob/main/tools/devcloud4/basic/README.md Download the vhd-util tool, place it in the correct directory within the CloudStack repository, and make it executable. This tool is often required for XenServer hypervisor operations. ```bash cd /path/to/cloudstack/repo wget https://download.cloudstack.org/tools/vhd-util -P scripts/vm/hypervisor/xenserver/ chmod +x scripts/vm/hypervisor/xenserver/vhd-util ``` -------------------------------- ### Install Development Dependencies on CentOS 7 Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs essential tools and dependencies for CloudStack development using yum. Includes Git, Java, MySQL, and build tools. ```bash # yum -y install git java-17-openjdk java-17-openjdk-devel \ mysql mysql-server mkisofs git gcc python MySQL-python openssh-clients wget ``` -------------------------------- ### Build and Run CloudStack UI Source: https://github.com/apache/cloudstack/blob/main/ui/docs/development.md Command to build and serve the CloudStack UI application for development. ```bash npm run serve ``` -------------------------------- ### Configure for Community Simulator Source: https://github.com/apache/cloudstack/blob/main/ui/README.md Sets the CS_URL to the community simulator QA server. ```bash echo "CS_URL=https://qa.cloudstack.cloud" > .env.local ``` -------------------------------- ### Configure pyenv and jenv for CloudStack Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Installs Python 2.7.16, creates a 'cloudstack' virtualenv, installs Python dependencies, and adds JDK 1.8 to jenv. These commands are used to manage specific tool versions for CloudStack development. ```bash # pyenv install 2.7.16 ## Install Python 2.7.16 # pyenv virtualenv 2.7.16 cloudstack ## Create a cloudstack virtualenv using Python 2.7.16 # pip install -r /requirements.txt ## Install cloudstack Python dependencies # jenv add ## Add Java7 to jenv ``` -------------------------------- ### List Cobbler Profiles Source: https://github.com/apache/cloudstack/blob/main/tools/marvin/marvin/misc/build/CI.md Displays the available profiles in Cobbler, which correspond to distribution installation configurations. ```bash [root@infra ~]# cobbler profile list cloudstack-rhel cloudstack-ubuntu rhel63-kvm rhel63-x86_64 ubuntu1204-x86_64 xen602 xen56 ``` -------------------------------- ### Build StorPool Plugin with Maven Source: https://github.com/apache/cloudstack/blob/main/plugins/storage/volume/storpool/README.md Use this Maven command to build the StorPool plugin. Ensure code style checks pass by avoiding trailing whitespace and using 4-space indents. ```bash mvn -Pdeveloper -DskipTests install ``` -------------------------------- ### Generate Router Map Source: https://github.com/apache/cloudstack/blob/main/ui/docs/development.md Example of calling `generateRouterMap` with a new section's configuration to integrate it into the application's routing. ```javascript generateRouterMap(newSection) ``` -------------------------------- ### Enable Bucket Usage Statistics on HyperStore Source: https://github.com/apache/cloudstack/blob/main/plugins/storage/object/cloudian/README.md Configure HyperStore to enable bucket-level QoS statistics. This requires using the `hsctl` command-line tool and restarting the S3 service. ```shell hsh$ hsctl config set s3.qos.bucketLevel=true hsh$ hsctl config apply s3 cmc hsh$ hsctl service restart s3 cmc --nodes=ALL ``` -------------------------------- ### Build CloudStack Simulator Docker Image Source: https://github.com/apache/cloudstack/blob/main/tools/docker/README.md Build the CloudStack Simulator Docker image from its Dockerfile. This image includes the database and is built from source using Maven. The build context is two levels up. ```bash docker build -f Dockerfile -t cloudstack/simulator ../.. ``` -------------------------------- ### Install Non-OSS Dependencies Source: https://github.com/apache/cloudstack/blob/main/INSTALL.md Execute the install-non-oss.sh script from the 'deps' directory to add libraries with distribution restrictions to your local Maven repository. ```bash $ cd deps $ ./install-non-oss.sh ```