Required files
To run the VMBC, you first need to create a sub-directory containing just the following files, named as follows.
Name | Description |
---|---|
|
A license to use Rhino. This file will have been provided to you as part of your general contract to use this software. This file is required to run VMBC and can also be included in the final VM image. If the file is not included in the image, it needs to be added when configuring the VM(s) through the use of the rvtconfig tool. If the file was included it can be replaced at deployment time though use of the same tool. |
|
A Java Development Kit (JDK), in For licensing reasons, VMBC does not include a JDK by default; you must provide one. You can download a JDK from OpenJDK. Valid JDKs are determined using the following criteria, which all JDKs from Oracle and OpenJDK should meet:
The JDK you provide will be copied onto the produced VM. You must ensure that:
|
|
This file is described below in Contents of the node-parameters.yaml file. |
|
A Sentinel package or Rhino export of your application. You must include either one or the other, but not both. |
|
An archive containing custom scripts to run during the build process. This file is described in Build hooks. This file is optional. |
|
An archive containing custom configuration scripts to run during configuration. This file is described in initconf hooks. This file is optional. |
Contents of the node-parameters.yaml file
The node-parameters.yaml
file is a file you supply yourself, with values based on the example given below.
Be careful when editing the yaml file - the yaml file format is very flexible, but spaces and other small easily overlooked characters can be significant. You will be unlikely to have any problems if your changes are restricted to just changing the values inside the quotes. |
The example file includes a description of each of the values in the file, which should guide you
when providing your values.
When the vmbc
tool runs, it will validate the provided values, and provide guidance if any values
are not acceptable.
The node-parameters.yaml
file consists of three distinct types of information.
-
The first part is the node-metadata, which gives the name of the product in three forms (which you will presumably decide on once, then never need to change), plus a version number. The version number is used in filenames, and should not include spaces, but beyond that no conventions are assumed. It is likely that you change this each time you release a new VM.
Here you can also set the username of the default Linux user, and a password for that user. The password must be at least 8 characters long, but has no other restrictions.
The password is only used for build and initial deployment of the custom VM. For example, if the VM fails to bootstrap successfully, the VM user will use the username and password you specify here to log in through the console in their VM host’s GUI, in order to diagnose the problem. Once the VM is up and running, as part of runtime configuration the user of the VM will specify a new password in the SDF. Finally, you can specify the signaling traffic types used by the VM. Any signaling traffic type that you wish to use with the VM needs to be defined here. This allows for use of more than two signaling interfaces, since each interface requires at least one traffic type. For valid signaling traffic types see the YANG schema. The default signaling traffic types are (mandatory)
custom-signaling
& (optional)custom-signaling2
. -
The second part of the file is concerned with specifying the configuration parameters of the VM that is produced, in particular the allocated resources for CPU, memory, and disk sizes. These parameters apply only to VMs produced to run on VMware’s vSphere or vCloud platforms - if you are targeting OpenStack, the parameters are set externally to the VM. It is likely that you may want to experiment to come up with appropriate values for these parameters.
Although these parameters apply only to VMware platforms, this file has appropriated the name
flavor
(as used by OpenStack) to describe a set of these configurations. You can specify multiple sets of configurations, if, for example, your product might be usable in a small (possibly trial) configuration, and in a larger configuration expected to be used in production. Whilst there is no fixed limit to the number of configurations you can have, each configuration ends up being built separately into the VM image file - so the size of the VM images is proportional to the number of configurations that you specify.You can find some guidelines on how to size your VM in the Sizing your VM section.
Be particularly careful when editing the file to add or remove configurations - the whitespace, -
and:
characters in particular are all very significant in this part of the file. -
The third part of the file specifies parameters that will affect the installed Rhino:
-
whether the installed Rhino should be clustered
-
whether it should have replication enabled
-
whether to build images with a Rhino license pre-installed
-
this is the license provided during the build
-
-
a set of JVM tuning parameters that will affect Rhino’s performance
-
it is strongly recommended that you experiment to come up with appropriate tuning parameters that match the performance requirements for your application
-
-
Sample node-parameters.yaml file
# The node metadata provides the name and version information for the VM that is being produced
node-metadata:
# The Linux username that the product code is installed for.
username: "rhino"
# The default password for the above user. This can be changed at runtime via configuration.
default-password: "!rhino123"
# The name of the product.
product-name: "Custom VM Rhino Product"
# A short form of the product name used in naming the output VM. Use hyphens instead of spaces,
# and prefer lowercase.
# Also used to derive the CSAR VNF type and the CDS group ID.
image-name: "custom-vm"
# A short form of the product name for display purposes, where spaces are acceptable.
display-name: "Custom VM"
# The product version number. No particular format is assumed, but it is used in filenames,
# and should not contain spaces.
version: "0.1.0rc2"
# The signaling traffic types used by the VM.
# Format:
# - name: <traffic_type_name> (this must be a valid signaling traffic type)
# optional: <boolean> (defaults to false if not specified)
# This field is optional. If not specified, the default traffic types are configured:
# signaling-traffic-types:
# - name: custom-signaling
# - name: custom-signaling2
# optional: true
signaling-traffic-types:
- name: internal
- name: sip
- name: diameter
optional: true
# Flavors describe the virtual hardware configuration options for deploying the VM on VMware.
flavors:
# Name for this configuration
- name: "small"
# Optional human-readable description for this configuration
description: "For small-sized deployments"
# How much RAM to use for this configuration
ram-mb: 16384
# How much disk space to use for this configuration
disk-gb: 30
# How many CPUs to allocate to this configuration (v stands for "virtual")
vcpus: 4
# A second named configuration - if you only want one configuration then remove this section.
- name: "medium"
description: "For medium-sized deployments"
ram-mb: 16384
disk-gb: 30
vcpus: 8
# Rhino parameters affect the behaviour and performance of the installed Rhino instances.
rhino-parameters:
# Whether the Rhinos on these VM instances will be clustered (true) or standalone (false).
# If not specified this defaults to true.
clustered: true
# Whether the Rhinos on these VM instances should have replication enabled (true) or not (false).
# This may only be specified if 'clustered' is true. If 'clustered' is false delete this line.
# If not specified this defaults to false.
replication-enabled: false
# JVM tuning parameters. These parameters affect Rhino performance.
# The provided values are just examples. They MUST be changed to match the demands of your application.
tuning-parameters:
heap-size-mb: 3072
new-size-mb: 256
max-new-size-mb: 256
# Garbage collection (GC) options.
# If you want to specify custom GC options, uncomment these lines
# and specify options in full, such as "-XX:+UseConcMarkSweepGC",
# with each option as a separate list item.
# gc-options:
# - "-XX:+UseConcMarkSweepGC"
# Whether to build (true) images with a Rhino license pre-installed or not (false).
# If false, a Rhino license must be provided when configuring the VM(s).
# If not specified this defaults to true.
preinstall-license: true
Running the vmbc
command
The command you then run is ./vmbc
, which takes parameters describing the target platforms for your VM,
chosen from the following:
vsphere
|
VMware’s vSphere platform |
vcloud
|
VMware’s vCloud platform |
openstack
|
OpenStack platform |
imageless
|
Platform-independent |
For every platform specified, corresponding CSAR files (the packaging used by Metaswitch’s SIMPL VM) will automatically be built.
The imageless
parameter builds CSARs containing the regularly included files (product schema, resources,
validation tests), but no VM image.
These are mainly used for verifying configuration against the CSAR schema, or other similar testing purposes where VMs
are not being deployed. They can also be used where VM images have already been uploaded to virtualisation platforms.
These CSARs are much smaller in size, making file transfer much quicker.
Run this command from the directory containing the sub-directory of input files described above. The tool will automatically find which sub-directory contains the necessary files, so you do not need to pass that as a parameter. Avoid having multiple different sub-directories containing relevant files because this will confuse this auto detection.
The maximal invocation of the command is thus:
./vmbc vpshere vcloud openstack imageless
There is a lot of work involved in building a VM - this command will typically take 10-20 minutes or more to run.
You can obtain full help for the ./vmbc
script by running ./vmbc -h
.
Host networking vs. bridge networking
By default, VMBC is run using Docker’s bridge networking mode. However, on some host operating
systems you may find that this mode does not allow the container to get internet access, which may
be required for some of your custom build hooks (for example,
a hook that installs yum
packages). Alternatively, you may find that, although the scripts have Internet access,
they do not have working DNS resolution.
VMBC does not require internet access by default. |
If this is the case, you can try running the ./vmbc
command with the -n
option, which will
change to host networking mode instead. This should resolve the lack of internet access or DNS,
but be aware that, on some host operating systems, this can cause Rhino to fail to start. See the
troubleshooting section for more information.
Output files
Images are written to a directory named target/images
located in the directory from which
you invoked the ./vmbc
command.
The command will also output build.log
and Rhino log files in the target
directory,
along with a number of other log files (notably Rhino logs) generated by the build process
and the .out
files from any custom build hooks.
These can help to debug issues encountered during the build.
$ ls -1 target
before-rhino-install.out
build.log
rhino.log
console.log
<other files>
images
$ ls -1 target/images
custom-vm-0.1.0rc2-openstack-csar.zip
custom-vm-0.1.0rc2-vmware-csar.zip
custom-vm-0.1.0rc2-vsphere-csar.zip
custom-vm-0.1.0rc2-vcloud.ovf
custom-vm-0.1.0rc2-vsphere.ova
custom-vm-0.1.0rc2-openstack.qcow2
custom-vm-0.1.0rc2-imageless-csar.zip
custom-vm-0.1.0rc2.yaml