Create custom image for load generators on the cloud

This topic describes how to create custom images for the Google Cloud and DigitalOcean cloud environments. For information about creating images in Amazon and Azure cloud environments, see Create custom images for cloud hosts in the LoadRunner Enterprise Help Center.

Google Cloud - Windows

To create a custom image for the Google Cloud Platform on a Windows machine:

  1. Install the Google Compute SDK. It can be downloaded from https://cloud.google.com/sdk/.

  2. Using the SDK’s web interface from your browser:

    1. Define a network with any name (in our example, network1) and add the following rules:

      Name Source tag / IP range Allowed protocols / ports Target tags
      default-allow-lg 0.0.0.0/0 tcp:54345 (LR agent port)

      hp-lr-lg

      default-allow-rdp 0.0.0.0/0 tcp:3389 rdp
    2. Create an instance:

      1. Provide a name for the instance (for our example instance1).
      2. Specify a region for the instance (for our example, us-central1-a).
      3. Specify a machine size g1-small (1 vCPU, 1.7 GB RAM), or higher.
      4. Specify Windows Server 2012 R2 Standard x64 as the operating system.
      5. Select Create New image -> Management, Disk, Networking, Access & Security Options -> Management and specify the tag "rdp".
      6. Select Create New image -> Management, Disk, Networking, Access & Security Options -> Networking and specify network1 as the network.
      7. Confirm that you want to create the instance.

    3. Connect to the instance that you just created via RDP.

    4. Download the standalone load generator OneLG to the instance, and install using LoadRunner Enterprise (LRE) mode. The setup file is in the LoadRunner Professional installation package's Standalone Applications folder. Install it in a non-default location, such as C:\OneLG.

    5. When the load generator is installed:

      1. Open the Server Manager on the machine.
      2. From the Tools menu, select Computer Management.
      3. Under System Tools > Local Users and Groups, select Groups.
      4. On the right, open the properties of the Administrators group.
      5. In the General tab, under Members, remove IUSR_METRO.
      6. Click OK.
    6. Turn off firewalls using the following command:

      netsh advfirewall set allprofiles state off

    7. Register the LGCloudAgent service using the following command:

      sc create LGCloudAgent binPath= "c:\OneLG\bin\LGCloudAgent.exe" start= auto

    8. Disable autostart for the LoadRunnerAgent service:

      sc config LoadRunnerAgent start= demand

      sc config remotemanagementagent start= demand

    9. Run the System Preparation Tool using the Generalize and Shutdown options:

      cd %windir%\system32\sysprep

      sysprep (generalize, shutdown)

  3. Using the Google Compute SDK console:

    1. Authenticate yourself:

      gcloud auth login

    2. Set current project:

      gcloud config set project <project ID>

  4. Using the SDK’s web interface, determine the Project ID:

    1. Terminate the instance using the SDK console:

      gcloud compute instances delete instance1 --keep-disks boot

    2. Create an image from the instance disk. For example, for version 2021:

      gcloud compute images create <new image name> --description "LR LG, LRE Compatible, version{2021}, windows" --source-disk instance1 --source-disk-zone us-central1-a

Back to top

Google Cloud - Ubuntu

To create a custom image for Google Cloud on an Ubuntu machine:

  1. Install the Google Compute SDK. It can be downloaded from https://cloud.google.com/sdk/.

  2. Using the SDK’s web interface from your browser:

    1. Define a network with any name (in our example, network1) and add the following rules:

      Name Source tag / IP range Allowed protocols / ports Target tags
      default-allow-lg 0.0.0.0/0 tcp:54345 (LR agent port) hp-lr-lg
      default-allow-ssh 0.0.0.0/0 tcp:22 ssh
    2. Create an instance:

      1. Provide a name for the instance (for our example instance1).
      2. Specify a region for the instance (for our example, us-central1-a).
      3. Specify a machine size g1-small (1 vCPU, 1.7 GB RAM), or higher.
      4. Specify Ubuntu 14.04 x64 as the operating system.
      5. Select Create New image -> Management, Disk, Networking, Access & Security Options -> Management and specify the tag "ssh".
      6. Select Create New image -> Management, Disk, Networking, Access & Security Options -> Networking and specify network1 as the network.
      7. Confirm that you want to create the instance.

    3. Connect to the instance that you just created via SSH.

    4. Download the standalone load generator installation file to instance1 from the LoadRunner Professional installation package:

      \Linux\Web_Installers_64\InstData\Linux\VM

      or

      \Linux\Web_Installers_32\InstData\Linux\VM

    5. Run the following commands to update the image:

      sudo apt-get update

      sudo apt-get upgrade

    6. Upload the standalone load generator installation to the machine. Execute the following command on the uploaded files:

      chmod a+x inst64.bin installer.csh installer.sh unzip

    7. Install the load generator machine’s prerequisites:

      sudo apt-get install libc6-i386 lib32stdc++6 lib32ncurses5 libkrb5support0:i386 libkeyutils1:i386 gsoap:i386 mc libglib2.0-0:i386

    8. Install the load generator, accepting all of the defaults. Skip the certificate installation and set the load generator to startup.

    9. Insert the following lines into /etc/rc.local:

      • export LD_LIBRARY_PATH=/opt/MF/MF_LoadGenerator/bin
      • export PRODUCT_DIR=/opt/MF/MF_LoadGenerator
      • export M_LROOT=/opt/MF/MF_LoadGenerator
      • /opt/MF/MF_LoadGenerator/bin/LgCloudAgent
    10. Shut down the instance and verify that it has stopped.

  1. Using the SDK’s console:

    1. Authenticate yourself with the following command:

      gcloud auth login

    2. Set the current project.

      gcloud config set project <project ID>

    3. Terminate the instance:

      gcloud compute instances delete instance1 --keep-disks boot

    4. Create an image from the instance disk. For example, for version 2021:

      gcloud compute images create <new image name> --description "LR LG, LRE Compatible, version{2021}, linux" --source-disk instance1 --source-disk-zone us-central1-a

Back to top

DigitalOcean - Ubuntu

To create a custom image for DigitalOcean – Ubuntu:

  1. Create new instance from the cloud console using the Ubuntu 14.04 x64 image.
  2. Connect to the instance using the credentials from your mailbox.
  3. Install the required packages:

    dpkg --add-architecture i386 && apt-get update && apt-get -y upgrade && apt-get -y install libc6-i386 lib32stdc++6 lib32ncurses5 libkrb5support0:i386 libkeyutils1:i386 gsoap:i386 mc libglib2.0-0:i386

  4. Upload the standalone load generator files. The files may be found in installation package, in the following locations:

    \Linux\Web_Installers_64\InstData\Linux\VM

    or

    \Linux\Web_Installers_32\InstData\Linux\VM

  5. Execute following command for uploaded files:

    chmod a+x inst64.bin installer.csh installer.sh unzip

  6. Run the following:

    bash installer.sh

  7. Install the load generator, accepting all of the defaults. Skip the Certificate Installation step and the load generator startup.

  8. Insert the following lines into /etc/rc.local:

    1. export LD_LIBRARY_PATH=/opt/MF/MF_LoadGenerator/bin
    2. export PRODUCT_DIR=/opt/MF/MF_LoadGenerator
    3. export M_LROOT=/opt/MF/MF_LoadGenerator
    4. export CLOUD=DigitalOcean
    5. /opt/MF/MF_LoadGenerator/bin/LgCloudAgent
  9. Power off. Wait for the instance to be in the Off state in the web UI.

  10. Create a snapshot (Select droplet, and select the ‘snapshots’ menu item, fill in a name and click the button). The name should contain "LR LG" and the relevant version number. Wait while the snapshot is processed.

  11. Copy the image to other regions. Go to https://cloud.digitalocean.com/images, select the new image, click Edit region availability and transfer it to other regions.

  12. Make sure that all metadata and tags are copied to each of the images.

Back to top

See also: