Build Tools for VMware Aria provides development and release management tools for implementing automation solutions based on the VMware Aria Suite (VMware Aria Automation, VMware Aria Automation Orchestrator, VMware Aria Operations, VMware Aria Automation Pipelines, Aria Operations for Logs) and VMware Cloud Director. The solution enables Virtual Infrastructure Administrators and Automation Developers to use standard DevOps practices for managing and deploying content.
In this post, I’ll demonstrate how to setup a developer infrastructure for Aria Automation using Build Tools for VMware Aria.
In the past Build Tools for VMware Aria was known as vRealize Build Tools (vRBT) and it was distributed as a VMware Fling. This has changed recently, Build Tools for VMware Aria is now open-source. The home for Build Tools for VMware Aria is hosted on GitHub as the project vmware/build-tools-for-vmware-aria.
Build Tools for VMware Aria is integrated with the VMware Aria products, and allows us to manage product features like Orchestrator actions and workflows, or Aria Automation features like Cloud Templates, Subscriptions and many more. See this VMware blog post for an extensive description of all the supported features.
Build Tools for VMware Aria is created as a set of Maven plugins, which gives a complete pipeline integration through native command line and/or Maven integration components.
A typical development infrastructure for the Aria Suite and the toolchain consists of the following basic components:
- Source Control Management (SCM)
- Continuous Integration (CI)
- Maven repository
The setup and build flow is depicted in the diagram below (image taken from here).
In a nutshell the setup in my lab consists of the following components:
- A developer machine
- Lab system: devbox.corp.local
- Guest OS: Ubuntu 22
- Applications
- vRealize Developer Tools
- Java 8+
- Maven 3.5+
- Powershell Core (optional, if working with the polyglot Powershell archetype)
- JFrog CLI
- Visual Studio Code (with vRealize Developer Tool plugin)
- A Source Control Management system
- Lab system: gitlab.corp.local
- Guest OS: Ubuntu 22
- Services
- Gitlab CE
- A Build system capable of running Maven commands
- Lab system: gitlab.corp.local
- Guest OS: Ubuntu 22
- Services
- Gitlab Runner
- A Maven repository
- Lab system: artifactory.corp.local
- Services
- JFrog Artifactory
- The Aria Automation 8.x environment
- Lab system: vra1a.corp.local
- Services
- Aria Automation
- Orchestrator
In this tutorial, I’m not going to use the SCM and CI system to have a simpler initial setup. The setup of the CI components will be shown in a later post.
Install and configure the SCM and the Build system
I’ve installed Gitlab on a dedicated VM running Ubuntu 22 LTS. This machine will run the SCM and the Build components. There are a lot of installation tutorials available, so I won’t explain it here.
After a successful installation, the service is available in my lab at https://gitlab.corp.local.
Install and configure the repository system
Build Tools for VMware Aria relies on a private artifact manager. For this, I’ve installed Jfrog Artifactory OSS on the dedicated VM artifactory.corp.l0cal running Ubuntu 22 LTS. The installation procedure of Jfrog Artifactory is very simple:
Install the Jfrog GPG key for the package manager.
wget -qO - https://releases.jfrog.io/artifactory/api/gpg/key/public | sudo apt-key add -
Add the Jfrog artifactory repository to the package mangement.
echo "deb https://releases.jfrog.io/artifactory/artifactory-debs jammy main" | sudo tee -a /etc/apt/sources.list
Install Jfrog artifactory:
sudo apt-get update && sudo apt-get install -y jfrog-artifactory-oss
Start the service:
sudo systemctl start artifactory.service
After a successful installation, we can access the Jfrog UI at http://artifactory.corp.local:8082. Default username and password are admin and password.
After the first login, the Quick Setup configuration wizard is automatically started. We execute it as follows:
- Reset Admin password
- Set the base URL: http://artifactory.corp.local
- Configure Default Proxy: skip
- Create Repositories: select Maven
Artifactory will create the following Maven based repositories during the onboarding:
- libs-release-local
- libs-snapshot-local
- maven-remote
- libs-release
- libs-snapshot
Configure the Build Tools platform repository
Now, that the artifactory base setup has been finished, we’re going to setup the repository for the Build Tools.
We create a local repository in artifactory to contain the Aria Build Tools toolchain artifacts, e.g. build-tools-for-vmware-aria and add it to the virtual release repository.
- In JFrog UI navigate to Repositories and click Add Repositories
- Select Local Repository
- Select Package Type: Maven
- Create the repository as follows, then click Create Local Repository
- Repository Key: build-tools-for-vmware-aria
- The local repository has been created
- On the Repositories page, click on the Virtual tab
- Click on the libs-release repository key
- Scroll down to Repositories and move the build-tools-for-vmware-aria to the Selected Repositories
- Click Save.
- We must repeat the above steps 6-9 for the libs-snapshot virtual repository.
Setup the developer system
On the developer system devbox.corp.local, we install Visual Studio Code, Maven 3.8, NodeJS 14, Powershell 7, and JDK 17.
Let’s start with Visual Studio Code:
sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpgsudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install -y code
Next, we install JDK 17:
sudo apt-get install -y openjdk-17-jdk
Now, we install NodeJS 14 and NPM:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
And then install PowerShell 7:
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
Finally, we install Maven 3.8.7:
cd /opt
sudo wget https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz
sudo tar xvf apache-maven-3.8.7-bin.tar.gz
sudo ln -s apache-maven-3.8.7 maven
sudo update-alternatives --install /usr/bin/mvn mvn /opt/maven/bin/mvn 100
Let’s check the version of the tool stack components:
java -version
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 17.0.12+7-Ubuntu-1ubuntu222.04, mixed mode, sharing
node -v
v14.21.3
npm -v
6.14.18
mvn -version
Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Maven home: /opt/maven
Java version: 17.0.12, vendor: Ubuntu, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.2.0-34-generic", arch: "amd64", family: "unix"
Note: During my tests, I noticed that pip3 is also a necessary tool, which was not available on my freshly installed Ubuntu system. You can install it by executing:
sudo apt install -y python3-pip
Get Aria Build Tools
Clone the Git repository into your local directory (in this demo $HOME/Documents/AriaAutomationProjects
):
git clone https://github.com/vmware/build-tools-for-vmware-aria.git
Create keystore artifacts for Aria Orchestrator package signing
To import or export packages that are created for Aria Orchestrator, a certificate is required. This will be delivered as a Maven artifact that contains the certificate and private key and can be distributed using our jFrog artifact repository.
For simplicity, we’ll use the certificate that comes bundled with Aria Build Tools. If you want to create your own signing certificate, then refer to the official documentation here.
The pre-bundled certificate and key are located in the directory common/keystore-example/src/main/resources
. We create the Maven artifact used for signing packages at build time:
mkdir archetype.keystore-2.0.0
cp -a build-tools-for-vmware-aria/common/keystore-example/src/main/resources/cert.pem archetype.keystore-2.0.0/
cp -a build-tools-for-vmware-aria/common/keystore-example/src/main/resources/private_key.pem archetype.keystore-2.0.0/
zip archetype.keystore-2.0.0.zip -r archetype.keystore-2.0.0
Now, we can upload the keystore artifacts to Artifactory. In the jFrog Artifactory dashboard, navigate to the Application > Artifactory > Artifacts , select the build-tools-for-vmware-aria repository, and click on the Deploy button.
Specify the target path: com/vmware/pscoe/build/archetype.keystore/2.0.0/archetype.keystore-2.0.0.zip
Select our archetype.keystore-2.0.0.zip
as the file to upload:
The Artifactory should now happily server our keystore artifacts at the specified path:
Configure Maven
Build Tools for VMware Aria are built on top of the Maven build automation ecosystem. Aria Automation and Aria Orchestrator content is described as Maven Project Object Models (POM) which enable huge amount of options like automated build going through phases like validate, compile, test, package, verify, install and deploy; dependency management, versioning, etc.
As Maven is already installed, we set a Maven master password (in our lab setup it is VMware123!):
mvn --encrypt-master-password
Master password:
{2l0zuKV8/fsHItv8mLNSa8jeivSSAliprT8KAkgsYiY=}
Next, we configure the Maven security settings by editing $HOME/.m2/settings-security.xml:
<settingsSecurity>
<master>{2l0zuKV8/fsHItv8mLNSa8jeivSSAliprT8KAkgsYiY=}</master>
</settingsSecurity>
Now we must generate an encrypted string of the password for the Artifactory repository user (in our case it is the password of the Artifactory admin user, as we didn’t create a dedicated user):
mvn --encrypt-password
Password:
{yLdYeQprWPkHbVJCyj8ZNzui6Lf4SXRKCJK11vSVlmo=}
As a last step, we must create the Maven configuration at $HOME/.m2/settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>libs-release</id>
<username>admin</username>
<password>{yLdYeQprWPkHbVJCyj8ZNzui6Lf4SXRKCJK11vSVlmo=}</password>
</server>
<server>
<id>libs-snapshots</id>
<username>admin</username>
<password>{yLdYeQprWPkHbVJCyj8ZNzui6Lf4SXRKCJK11vSVlmo=}</password>
</server>
</servers>
<profiles>
<profile>
<id>packaging</id>
<properties>
<keystoreGroupId>com.vmware.pscoe.build</keystoreGroupId>
<keystoreArtifactId>archetype.keystore</keystoreArtifactId>
<keystoreVersion>2.0.0</keystoreVersion>
<vroPrivateKeyPem>target/${keystoreArtifactId}-${keystoreVersion}/private_key.pem</vroPrivateKeyPem>
<vroCertificatePem>target/${keystoreArtifactId}-${keystoreVersion}/cert.pem</vroCertificatePem>
<vroKeyPass>VMware1!</vroKeyPass>
</properties>
</profile>
<profile>
<id>bundle</id>
<properties>
<assembly.skipAssembly>false</assembly.skipAssembly>
</properties>
</profile>
<profile>
<id>artifactory</id>
<repositories>
<repository>
<id>libs-release</id>
<name>libs-release</name>
<snapshots><enabled>false</enabled></snapshots>
<url>http://artifactory.corp.local:8082/artifactory/libs-release</url>
</repository>
<repository>
<id>libs-snapshots</id>
<name>libs-snapshots</name>
<snapshots><enabled>true</enabled></snapshots>
<url>http://artifactory.corp.local:8082/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>libs-release</id>
<name>libs-release</name>
<snapshots><enabled>false</enabled></snapshots>
<url>http://artifactory.corp.local:8082/artifactory/libs-release</url>
</pluginRepository>
<pluginRepository>
<id>libs-snapshots</id>
<name>libs-snapshots</name>
<snapshots><enabled>true</enabled></snapshots>
<url>http://artifactory.corp.local:8082/artifactory/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<properties>
<releaseRepositoryUrl>http://artifactory.corp.local:8082/artifactory/libs-release</releaseRepositoryUrl>
<snapshotRepositoryUrl>http://artifactory.corp.local:8082/artifactory/libs-snapshot</snapshotRepositoryUrl>
</properties>
</profile>
<profile>
<!--Environment identifier. Multiple environments are allowed by configuring multiple profiles -->
<id>corp-dev</id>
<properties>
<vrealize.ssl.ignore.hostname>true</vrealize.ssl.ignore.hostname>
<vrealize.ssl.ignore.certificate>true</vrealize.ssl.ignore.certificate>
<!--vRO Connection-->
<vro.host>vra1a.corp.local</vro.host>
<vro.port>443</vro.port>
<vro.auth>vra</vro.auth>
<vro.refresh.token>NbPHcjs8PWHoj3ZCJCP0CXqlE0lfSHMu</vro.refresh.token
<!--vRA Connection-->
<vrang.host>vra1a.corp.local</vrang.host>
<vrang.port>443</vrang.port>
<vrang.refresh.token>NbPHcjs8PWHoj3ZCJCP0CXqlE0lfSHMu</vrang.refresh.token>
<vrang.org.name>WSA1A</vrang.org.name>
<vrang.project.name>Engineering</vrang.project.name>
</properties>
</profile>
</profiles>
<mirrors>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:dummy:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0</url>
<blocked>true</blocked>
</mirror>
<mirror>
<id>libs-release</id>
<mirrorOf>central</mirrorOf>
<name>Artifactory proxy for Maven Central.</name>
<url>http://artifactory.corp.local:8082/artifactory/libs-release</url>
</mirror>
</mirrors>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
<activeProfile>packaging</activeProfile>
</activeProfiles>
</settings>
You can obtain a current Aria Auto refresh token, by executing the following command on the devbox command line:
curl -k -s -X POST "https://vra1a.corp.local/csp/gateway/am/api/login?access_token" \
-H 'Content-Type: application/json' \
-d '{
"username": "'configadmin'",
"password": "'VMware123!'"
}' | jq -r .refresh_token
NbPHcjs8PWHoj3ZCJCP0CXqlE0lfSHMu
Install the Aria Build Tools
Now it’s time to actually install the Aria Build Tools.
To install the building tools dependencies execute the following commands inside the build-tools-for-vmware-aria directory:
mvn clean install -f common/keystore-example/pom.xml
mvn clean install -f maven/npmlib/pom.xml
mvn clean install -f pom.xml
mvn clean install -f maven/base-package/pom.xml
mvn clean install -f packages/pom.xml
mvn clean install -f maven/typescript-project-all/pom.xml
mvn clean install -f maven/repository/pom.xml
Install the vRealize Developer Tools (vRDT) extension for Visual Studio Code
vRDT is a VSCode extension that provides code intelligence features and enables a more developer-friendly experience when creating vRealize Orchestrator and vRealize Automation content.
The most convenient method to install the vRDT extension is via VSCode extension marketplace. Simply search for the extension in the marketplace and click on Install.
Create a Orchestrator action-based project
To demonstrate the usage of the whole toolchain, we now create a Orchestrator action-based project. Details on how to use the other project types, refer to the official documentation here.
In VSCode create a new vRealize project by typing Ctrl-Shift-P, then type vRealize, and select vRealize: New Project.
For the sake of this demo, select vRO JavaScript-based.
Provide a project ID, e.g. local.corp.vrbt.
Provide a project name, e.g. test.
Specify a directory on the developer system to save the project, and click Create here.
After the project has been created, you should be able to see in in VSCode:
Finally, let’s build a new Orchestrator package out of this and push it to Aria Orchestrator:
cd $HOME/Documents/AriaAutomationProjects/test
mvn package vrealize:push -Pcorp-dev
After the successful build, we can check the imported package in Aria Orchestrator:
Also our sample action is available:
That’s all for now.
Leave a Reply