Build cloud machine images running Xceptance LoadTest with ease using Packer.
Up to now, you can find scripts for the following cloud vendors or platforms:
All XLT images are based on Debian 11 (bullseye), so using another base OS (even another Debian version) may not work.
During image creation, the following main packages will be installed:
Furthermore, the following optimizations will be applied to the underlying OS to allow for high-scale and resource-efficient load testing:
Note that these optimizations are not done for Docker as they would actually have to be applied to the OS of the host machine.
Attention: When running an instance with one of these images later on, the XLT agent controller and also an SSH server (except Docker) are started automatically. Ensure that the following ports are opened in the firewall settings of your instance:
Please consult the documentation of your cloud vendor for details on how to do that.
When you want to log in via SSH, use admin
as the user name. This is the default user in Debian.
Most of the work (and magic) is done by an open-source tool named Packer built by HashiCorp. So you will need to download and install it first. Note that Packer v1.6.0 or later is required.
Now that you have installed packer, you can use it to build XLT images for any supported cloud vendor listed above. To do so, invoke packer with the build
command followed by the JSON file that corresponds to your cloud vendor.
For example, to create a new Amazon EC2 AMI, you would run:
$ <PATH_TO_PACKER>/packer build packer/amazon.json
Before you create an image, you need to provide some additional information, such as the authentication data for your cloud vendor.
This can be done in several ways:
-var
flag: -var 'variable_name=value'
, or-var-file
flag: -var-file=myVars.json
(recommended).Imagine you want to create an Amazon EC2 image running XLT 6.2.5 for region eu-central-1. This is done by invoking Packer as follows:
$ <PATH_TO_PACKER>/packer build -var 'region=eu-central-1' -var 'xlt_version=6.2.5' packer/amazon.json
You can also put all variables you need into a file, let's say variables.json:
{
"region": "eu-central-1",
"xlt_version": "6.2.5"
}
This file could then be passed to Packer like this:
$ packer build -var-file=variables.json packer/amazon.json
All templates require you to pass/edit the following configuration parameters:
Besides those, there are several additional parameters specific to the cloud vendor of your choice. Please see below for details.
To create an Amazon Machine Image you'll need to pass:
We also offer a template to build and publish an AMI for multiple regions at once: packer/amazon_allRegions.json
. The image will be built in the region specified by the variable region
and is then copied to the regions specified by the variable dest_regions
.
Please be reminded that AMI names must obey the following rules:
Example variables file:
{
"region": "eu-central-1",
"xlt_version": "6.2.5",
"root_volume_size": "10",
"launch_permission": "public",
"aws_access_key": "<YOUR_ACCESS_KEY>",
"aws_secret_key": "<YOUR_SECRET_KEY>"
}
To create a DigitalOcean image you'll need to pass:
In case you want to build an image for multiple regions at once, you can use the template packer/digitalOcean_allRegions.json
.
Example variables file:
{
"region": "nyc1",
"xlt_version": "6.2.5",
"api_token": "<YOUR_API_TOKEN>"
}
To create a Google Compute Engine image you'll need to pass:
xlt-{image_version}-{timestamp}
xlt-{image_family}
Please be reminded that image version and family must obey the following rules:
Example variables file:
{
"zone": "us-central1-a",
"account_file": "<PATH_TO_YOUR_ACCOUNT_JSON_FILE>",
"project": "<YOUR_PROJECT_ID>",
"xlt_version": "6.2.5",
"image_version": "6-2-5",
"image_family": "6-x"
}
To create a Hetzner image you can pass the following variables to packer:
https://console.hetzner.cloud/projects/<YOUR_PROJECT_ID>/security/tokens
xlt-{image_version}-{timestamp}
xlt-version
to the given valueExample variables file:
{
"location": "nbg1",
"api_token": "<YOUR_API_TOKEN>",
"xlt_version": "6.2.5",
"image_version": "6-2-5",
"label_xlt_version": "6-x"
}
When creating a Docker image you'll need to pass:
xlt_version
)Example variables file:
{
"xlt_version": "6.2.5",
"image_repository": "<YOUR_ORG>/xlt",
"image_tags": "6.2.5,greatest",
"registry_url": "",
"registry_username": "<YOUR_USER_NAME>",
"registry_password": "<YOUR_PASSWORD>"
}