Provision Docker hosts manually
This section describes how to manually set up Dockerized load generator hosts, and how to assign them to a performance test.
Tip: Alternatively, you can use elastic provisioning to dynamically assign Dockerized hosts to a performance test. For details, see Provision Docker hosts automatically.
About Dockerized hosts
Docker is a platform that allows you to develop, ship, and run applications using a container. Docker uses a standard container format that lets developers prepare applications inside containers, while system administrators and other teams, such as Quality Assurance engineers, run the container in order to deploy the application.
You can run your hosts inside Docker containers, using Linux or Windows Dockerized load generator images which are available in the Docker repository. For details, see Manage Dockerized images.
Benefit of using Dockerized hosts include:
-
Enables you to automate the testing process by provisioning and de-provisioning hosts on demand, and seamlessly add them to performance tests using the REST API.
-
Saves having to rely on (and manage) hosts defined in the lab, and the need to reserve hosts in advance.
Refer to the product documentation for more details.
Deploy hosts using Docker
For details on how to deploy and run Dockerized hosts, see the LoadRunner Enterprise Installation Guide (available from Installation).
After installing Dockerized hosts, select the method for assigning them to performance tests:
-
REST API. You can assign Dockerized load generators to tests from the LoadRunner Enterprise REST API. For details, see Add Dockerized hosts to tests from the REST API.
-
User Interface. You can manually assign Dockerized load generators to tests from the LoadRunner Enterprise user interface. For details, see Manually configure and assign Dockerized hosts to tests.
Add Dockerized hosts to tests from the REST API
This task describes how to manually add Dockerized hosts to tests from the REST API.
-
Prerequisites
Set up the Docker installation as described in the LoadRunner Enterprise Installation Guide (available from Installation).
-
Add Dockerized load generators to the LoadRunner Enterprise Hosts list.
-
Authenticate the user to the LoadRunner Enterprise Administration REST API by sending an HTTP GET request to the following URL:
http://<LoadRunner Enterprise server>/Admin/rest/authentication-point/authenticate
Example:
GET /Admin/rest/authentication-point/authenticate
For API details, see Authenticate in the LoadRunner Enterprise Administration REST API Guide.
-
Add a load generator host to each Docker container using the Get Hosts API, and configure the settings as follows:
-
For host name, enter the physical name of the load generator host followed by
_dkr_<lgInitialPort>
, where<lgInitialPort>
is the initial port that is mapped to the Docker container (see the LoadRunner Enterprise Installation Guide).Example:
myHost_dkr_10110
-
Add the container as a
Unix
orwindows
installation, withLoadGenerator
purpose.Request example:
For API details, see Add Host in the LoadRunner Enterprise Administration REST API Guide.
The Dockerized hosts are added to the Hosts list.
-
-
-
-
Prerequisites
Make sure that you have created a performance test, and configured it to use non-specific (automatch) load generators. You can also use specific load generators, but then you need to update your test to use those load generators (this can be done using tests/{ID} in the LoadRunner Enterprise REST API Guide).
You can create a test either from the LoadRunner Enterprise Administration REST API (see tests in the LoadRunner Enterprise REST API Guide), or manually from the LoadRunner Enterprise user interface (see Design a test).
-
Run the performance test from the LoadRunner Enterprise REST API (see Start a Test Run in the LoadRunner Enterprise REST API Guide).
-
-
When the performance test has finished running, collate (and analyze) performance test data using the REST API. For API details, see collate and analyze in the LoadRunner Enterprise REST API Guide.
-
Remove the hosts from the test - optional
Note: Make sure that you collate the results for any load generators you intend to remove from the test before you delete them.
-
Remove the hosts from the test using the hosts/{hostID} API. For API details, see hosts/{hostID} in the LoadRunner Enterprise Administration REST API Guide.
-
Delete all Docker containers by running the following command:
"docker rm -f $(docker ps -a -q)";
-
Manually configure and assign Dockerized hosts to tests
This task describes how to manually configure and assign a Dockerized load generator to a performance test.
-
Prerequisite
Set up the Docker installation as described in the LoadRunner Enterprise Installation Guide (available from Installation).
-
In LoadRunner Enterprise Administration, select Maintenance > Hosts.
-
Select the Hosts tab, and then click the Add Host button .
-
Configure the host settings as follows:
-
Host Name. Enter the physical name of the host followed by
_dkr_<port_number>
, where<port_number>
is the port that is mapped to the Docker container (see the LoadRunner Enterprise Installation Guide).Example:
myHost_dkr_10110
-
Purpose. Select
Load Generator
only. -
Installation. Select the installation type:
Windows Host
,OneLG
, orUnix Load Generator
.
-
-
Click Save to add the host to the Hosts grid.
-
In the LoadRunner Enterprise user interface, assign the load generator to a test. For details, see Distribute load generators among Vuser groups and Assign elastic hosts to a test.
Notes and Limitations
For details, see Notes and limitations.
See also: