Understanding the Solution Add-On Lifecycle

This section is aimed at solution add-on vendor role and assumes the vendor is about to onboard an existing solution as an add-on, or create new with already identified requirements.

Design

Building a high quality solution add-on tends to address the following questionnaire.

Answers to these questions will help you to select the correct SDK building blocks to best serve your add-on.

Implement

NOTE: All sections bellow assume your are using Linux OS for development environment. [Alternatives]

Once the design decisions are made they can be incorporated by the construction.

A solution add-on consists of a Manifest (manifest.yaml) describing the vendor, minimal Cloud Director version to run this add-on, the elements implementing its business logic. Each element further contains details about the location of its source code and configuration.

Solutions add-ons are created, built, tested and packaged with vcd-ext-shell. Creating a new add-on can be achieved with the following command:

$ vcd-ext-shell
*no soluiton* |> solution new <TAB>
                              --name          Solution name                               
                              --vendor        Solution vendor                             
                              --version       Solution version                            
                              --vcd-version   VCD minimum compatible version              
                              --folder        Project folder (default is working folder) 
                              --from-template <template name>

*no soluiton* |> solution new --vendor corp --name skeleton --version 1.0.0 --vcd-version 10.4.1

The command is going to produce a bare minimal add-on configuration under skeleton/manifest.yaml required to build and package an add-on ISO.

# manifest.yaml
name: skeleton
vendor: corp
version: 1.0.0
vcdVersion: 10.4.1
friendlyName: ""
description: ""
policies:
    supportsMultipleInstances: false
tags: []
elements: []

Refer to Exploring Solution Add-On Elements section for details about grooming the Manifest.

Build

Building a solution add-on is the process of converting its elements source code files into standalone software artifact(s) that can be process by the add-on ISO installer. The vcd-ext-shell requires these artifacts to be located under <element>/dist folder with a file extension recognized by the element type.

The vcd-ext-shell contains built-in logic for building elements’ artifacts that define their build process as <element>/Dockerfile or build.yaml definition file compatible with the docker buildx build client. Alternatively, the add-on vendor can create their own build process as long as the produced artifacts are stored in <element>/dist with the respected extension for their type.

In case a build of an add-on element depends on other elements’ artifacts or an element build process involves multiple Dockerfiles you can leverage build.yaml to customize the build process. The file consists of an array of Dockerfile definitions and their execution context. The definitions will be executed in a sequence. <element of type UI>/build.yaml (this file is optional)

# root context is set to the root of the add-on
- root: ../
  dockerfile: <element of type RDE>/Dockerfile
  output: <element of type RDE>/dist
# Once the RDE is built its schemas can be consumed by the UI plugin
# root context is set to the root of the add-on so the <element of type UI>/Dockerfile can access <element of type RDE>/dist
- root: ../
  dockerfile: <element of type UI>/Dockerfile
  output: <element of type UI>/dist
  ...

<element of type UI>/Dockerfile

# syntax=docker/dockerfile:1

FROM <repository>/node:12.16.3-slim as NODE
# Note the current folder of the NODE container points to <element>/
COPY ./<element of type UI> /usr/app
COPY ./<element of type RDE>/dist /usr/app/schemas
WORKDIR /usr/app
RUN npm ci
RUN npm run build

FROM scratch AS export
# Note the current folder of the export container points to <element>/dist 
COPY --from=NODE /usr/app/dist ./
# Building all add-on elements
skeleton |> solution build

# Building a specific add-on element
skeleton |> solution build target <element name>

Package

The Solution Add-On bundle form factor is ISO in Universal Data Format. Creating this type of ISO can be achieved only via vcd-ext-shell by executing the package command.

Before executing the package command make sure you have the required EULA.txt (for development it can be empty) in your solution folder.

$ vcd-ext-shell
Welcome to VMware Cloud Director Solution Add-On CLI Version '1.0.0-<build number>'.

Use <Tab> or <Ctl+Esc> for help, navigation and autocompletion, try now!

It looks like the '<folder>' is not a valid Solution Add-On.
You can use 'solution open' command to set the context or 'solution new' command to create a new project.

*no solution* |> solution open --path ./skeleton
INFO[0005] Successfully set the context for 'skeleton'  
skeleton |> solution package
About to create '<folder>/skeleton/dist/corp-skeleton-1.0.0.iso' 
including 'ceip.txt' ... 
including 'certificate.pem' ... 
including 'darwin-arm64.run' ... 
including 'darwin-arm64.run.vsig' ... 
including 'darwin.run' ... 
including 'darwin.run.vsig' ... 
including 'eula.txt' ... 
[OK] skeleton |> exit

When creating the add-on ISO the vcd-ext-shell will implicitly include the following files. - Installation and operation binaries for Linux, Windows and Mac issued by VMware - Manifest issued by the vendor - Elements Artifacts issued by the vendor - VMware certificate in PEM format - Vendor certificate in PEM format - Signatures .vsig of the operation binaries corresponding to VMware certificate - Signatures .sig of all files part of the ISO corresponding to vendor certificate - End-user license agreement - VMware Customer Experience Improvement Program note

NOTE: The package command requires a valid vendor PKI configuration. Refer to the Setup / Vendor section for details about configuring PKI with existing or self-signed generated issuer.

Create Solution Instance

A solution add-on instance can be created by executing the following command.

my-solution |> solution run create-instance --name <solution instance name> [<arguments> ...]

NOTE: Prior execution of an instance commands vcd-ext-shell has to be setup with a Cloud Director instance in active state. [Setup]

Delete Solution Instance

A solution add-on instance can be deleted by executing the following command.

my-solution |> solution run delete-instance [<arguments> ...]

What is Next?