I’ve been using vRealize Orchestrator a lot lately. I created various types of workflows, some did quite simple things, other in my opinion were quite well advanced. At one of the calls with VMware employees, I received quite an interesting teaser about vRealize Build Tools. I was very interested in this, so I would like to introduce you to this solution briefly, starting with building the environment.
Installation
The first element that is required is Java JDK which you can download from this page after logging in
https://www.oracle.com/java/technologies/downloads/#java8
The second element is Maven. Briefly about what is below an excerpt from the official website “Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece) of information. “
and here is the download link
https://maven.apache.org/download.cgi
When we have already downloaded both objects, we install JAVA which I will not describe here because each of you has certainly done it more than once, and if not, in a very short shortcut: Press NEXT several times
After installing JAVA, we set the environment variables pointing to the folder where we installed it. Sorry for the screenshot in Polish, but this is my system
the second element we need to add to the environment variables is Maven. After downloading and unpacking, place the directory anywhere and select it as a PATH object in the system
with the mvn -v command we can confirm that Maven was added correctly
The tool that we will use to create our projects is Visual Studio Code, which we can download from this page
https://code.visualstudio.com/
I will not describe the full configuration because you can write many books on this topic and there is
a lot of documentation on this topic, but for this solution the first element we configure is adding a new line to the end of the file while saving it.
the second one is
After configuration we need to install few plugins: list of plugins I have installed to use vRealize Build Tools:
- EditorConfig for VS Code
- vRealize Developer Tools
Next thing for setup is Node.js as from it we are using npm tools. Node.JS you can install from this link and the required version is 16+
https://nodejs.org/en/download/
Another requirement is OpenSSL. I know a lot of these requirements at the beginning, but it seems to me that once we configure everything, the fun will be great.
At the beginning I installed Open SSL version 3 but I had some problems
[ERROR] opensslErrorStack: [
[ERROR] ‘error: 0E076071: configuration file routines: module_run: unknown module name’,
[ERROR] ‘error: 0E07506E: configuration file routines: module_load_dso: error loading dso’,
[ERROR] ‘error: 25070067: DSO support routines: DSO_load: could not load the shared library’
[ERROR]],
[ERROR] library: ‘DSO support routines’,
[ERROR] function: ‘win32_load’,
[ERROR] reason: ‘could not load the shared library’,
[ERROR] code: ‘ERR_OSSL_DSO_COULD_NOT_LOAD_THE_SHARED_LIBRARY’
Therefore, I recommend using version 1.1.1
The last element is to download vRealize Build Tools from VMware flings resources
https://flings.vmware.com/vrealize-build-tools
it is a resource made available by VMware in Technical Preview version
Configure
Ok, we have everything installed before we start building Projects, we need to configure a few elements.
the first item is the configuration file for maven. It should be in the user’s home directory at
~ / .m2 / settings.xml
I will not paste my entire file here, but some of its sections which are the most important
This is the beginning of file
The entire file consists of profiles that will be used when building the project. Maven allows you to use JFROG Artifactory which is free, but we can also use a local path here where we will throw the Fling content downloaded from the VMware website
<?xml version=”1.0″ encoding=”UTF-8″?>
<settings xmlns=”http://maven.apache.org/SETTINGS/1.1.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd”>
<localRepository>[path_where_your_project_will_be_located]</localRepository>
<profiles>
<profile>
<id>packaging</id>
<properties>
<keystoreLocation>[path_where_your_keystore_will_be_located]</keystoreLocation>
<keystorePassword>VMware1!</keystorePassword>
<vroPrivateKeyPem>[path_where_your_privateKey_will_be_located]</vroPrivateKeyPem>
<vroCertificatePem>[path_where_your_cert_will_be_located]</vroCertificatePem>
<vroKeyPass>VMware1!</vroKeyPass>
</properties>
</profile>
The certificate and private key must be in the PEM format.
Having OpenSSL installed, we just need to issue these commands to generate the certificate and key
openssl genpkey -out private_key.pem -algorithm RSA
openssl req -new -key private_key.pem -out csr.csr
openssl req -x509 -days 999 -key private_key.pem -in csr.csr -out cert.pem
The problem that occurred to me here is related to the text formatting for windows, so I regenerated the file in the linux system
The second profile, which is even more important than the first, describes our entire vRA environment
<profile>
<id>DevLab</id>
<properties>
<vro.host>[url_for_vro]</vro.host>
<vro.port>443</vro.port>
<vro.username>[vro_username_with_domain]</vro.username>
<vro.password>[vro_password]</vro.password>
<vro.auth>vra</vro.auth>
<vro.tenant>[vro_tenant]</vro.tenant>
<vro.authHost>[url_for_vro_authentication]</vro.authHost>
<vro.authPort>443</vro.authPort>
<vrang.host>[url_for_vra] </vrang.host>
<vrang.auth.host>[url_for_vra_authentication] </vrang.auth.host>
<vrang.username>[vra_username]</vrang.username>
<vrang.password>[vra_password]!</vrang.password>
<vrang.port>443</vrang.port>
<vrang.org.id>[vra_org_id]</vrang.org.id>
<vrang.project.id>[vra_project_id]</vrang.project.id>
<vrealize.ssl.ignore.hostname>true</vrealize.ssl.ignore.hostname>
<vrealize.ssl.ignore.certificate>true</vrealize.ssl.ignore.certificate>
</properties>
</profile>
this profile will be used to build and share in our project environment
Build
The configuration is complete so we can proceed to creating the sample code
I created a local folder for our project
C:\Data\VMware\Projects\vra8
I uploaded the contents of fling to the folder
now we can run Visual Studio Code
on the left tab we see Extensibility which presents vRealize Developer Tools, where we can select a profile, on the list we see our DevLab
press ctrl + shift + p and choose vRealize: New Project
Then we need to choose the project type
Create groupID for Project
Project Name
And Select path where project will be cached
In right bottom corner you will se that project is generated
And after finish VSCode will open it for us.
We can check sample workflow
And after creation process we can push this to our vRO
On Project tab we can press ctrl + shift + b and push this
The most important thing for this is that we need to have setup for default terminal as GIT Bash because it will never work with powerhsell terminal. So If you wanna change it as a default press F1 and find Terminal: Select Default Profiles
After push there is command run for maven which after few seconds will build your package
INFO] Authentication strategy: ‘VRA’
[INFO] Detecting vRO Server version ‘8.8.1.19884455’.
[INFO] Merge Package vrealize PushMojo: false
[INFO] STRATEGY| INFO | Apply Configuration strategies for import
[INFO] STRATEGY| PASS | Source.Version > Destination.Version
[INFO] PACKAGE | SKIP | com.vmware.pscoe.library.ecmascript (2.23.0) > (2.23.0)
[INFO] PACKAGE | PASS | com.vworld.local.TestProject (1.0.0-SNAPSHOT) > (missing)
[INFO] Package | IMPORT | com.vworld.local.TestProject-1.0.0-SNAPSHOT.package
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 55.449 s
[INFO] Finished at: 2022-06-21T12:37:37+02:00
[INFO] ————————————————————————
And on vRO you will be able to check whole package