Create custom image for Load Generators in the cloud

The LoadRunner installation includes images for load generators for various cloud environments. This topic describes how to create custom images for those environments.

Azure – Windows

To create a custom image for Azure – Windows:

  1. Create new instance from the cloud console, using a Windows Server 2012 R2 Standard x64 image. For details, see http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-custom/.
  2. Connect to the instance that you just created. For details, see http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-log-on-windows-server/.
  3. Install an LG SA (Standalone Load Generator) in Performance Center (PC) Mode.
  4. 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.
  5. Turn off firewalls using the following command:

    netsh advfirewall set allprofiles state off

  6. Register the LGCloudAgent service using the following command:

    sc create LGCloudAgent binPath= "c:\Program Files (x86)\HPE\Load Generator\bin\LGCloudAgent.exe" start= auto

  7. Disable autostart for the LoadRunnerAgent service:

    sc config LoadRunnerAgent start= demand

    sc config remotemanagementagent start= demand

  1. Run the System Preparation Tool using the Generalize and Shutdown options, as described in http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/. Wait until the instance stops.

  2. You must create an SSL certificate in order to upload to Azure. For details, see Create Certificates for Azure Cloud. Upload the *.cer file to Azure using Settings > Management Certificates.

  3. Create an image from the instance.

    %LR_PATH%\bin\AzureCaptureRole.exe -s $subscription_id -c $path_to_certificate_file -n $vmname -i $new_image_name -v $lr_version –d $lr_drop --proxy proxy_url

    Follow these naming guidelines:

    $path_to_certificate_file The path to the .pem file corresponding to .cer file, that you previously uploaded to Azure
    $vmname The name of the instance from the Web console
    $lr_version, $lr_drop The version and drop of LoadRunner, for example "12.55"
    $proxy_url The url and port of a proxy server, if relevant
    $subscription_id

    The subscription id of the image

    To determine this value, see the Settings > Subscriptions page on the Azure console.

Back to top

Azure - Ubuntu

To create a custom image for Azure – Ubuntu:

  1. Create new instance from the cloud console, using an Ubuntu 12.04 x64 image.
  2. Connect to the instance that you just created.
  3. Run the following commands to update the image:

    sudo apt-get update

    sudo apt-get upgrade

  1. Upload the Load Generator standalone installation for Linux to the machine.
  2. Execute following command for uploaded files:

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

  3. Install the Load Generator:

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

  4. Run the following command:

    bash installer.sh

  5. Install the Standalone Load Generator, accepting all of the defaults. Skip the Certificate Installation step and the Load Generator startup.

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

    • egrep '/([[:alnum:]]+:)?CustomData' /var/lib/waagent/ovf-env.xml | sed -re 's,.*<([[:alnum:]]+:)?CustomData>,,;s,</([[:alnum:]]+:)?CustomData>.*,,' | base64 -d > /var/lib/waagent/CustomData
    • export LD_LIBRARY_PATH=/opt/HP/HP_LoadGenerator/bin
    • export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
    • export M_LROOT=/opt/HP/HP_LoadGenerator
    • /opt/HP/HP_LoadGenerator/bin/LgCloudAgent
  7. Run the following:

    sudo waagent -deprovision

  8. Shut down the instance and verify that it has stopped.

  9. You must create an SSL certificate in order to upload to Azure. For details, see Create Certificates for Azure Cloud.

  10. Create an image from the instance.

    %LR_PATH%\bin\AzureCaptureRole.exe -s $subscription_id -c $path_to_certificate_file -n $vmname -i $new_image_name -v $lr_version --proxy proxy_url

    Follow these naming guidelines:

    $path_to_certificate_file The path to the .pem file corresponding to .cer file, that you previously uploaded to Azure
    $vmname The name of the instance from the Web console
    $lr_version The version of LoadRunner, for example "12.55"
    $proxy_url The url and port of a proxy server, if relevant
    $subscription_id

    The subscription id of the image

    To determine this value, see the Settings > Subscriptions page on the Azure console.

Back to top

Amazon EC2 – Windows

To create a custom image for Amazon EC2 – Windows:

  1. Launch a new instance from the cloud console. Use the latest Windows Server 2012 R2 Standard x64 image. Make sure the Shutdown behavior is set to Terminate. For details, see the AWS Documentation.
  2. Connect to your Amazon EC2 instance. For details, see the AWS Documentation.

  3. Install an LG SA (Standalone Load Generator) on the cloud machine in the default PC Mode. The setup file is in the LoadRunner DVD's Standalone Applications folder.

  4. 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.
  5. Turn off the firewall using the following command:

    netsh advfirewall set allprofiles state off

  6. Install any additional software required, for example, a Citrix client.

  7. If you are planning to use the Citrix protocol, check that your network can access the cloud machine. We recommend that you disable firewalls completely on the cloud machine, and use the network management, such as security groups, provided by the cloud provider.

  8. Register the LGCloudAgent service on the machine using the following command:

    sc create LGCloudAgent binPath= "c:\Program Files (x86)\HPE\Load Generator\bin\LGCloudAgent.exe" start= auto

  9. Disable autostart for the LoadRunnerAgent service:

    • sc config LoadRunnerAgent start= demand
    • sc config remotemanagementagent start= demand
  10. Run the EC2Config utility and set the Administrator password to Random.

  11. Create an AMI from an Instance.

    • Set the Name according to LR-PC_Load_Generator_<version>_<OS> template, e.g. LR-PC_Load_Generator_12.55_Win2012R2
    • Set the Description to ״LR LG, PC Compatible״ and ״version{<version>}״ template, e.g. ״LR LG, PC Compatible, version{12.55
  12. Set the AMI to public if required.

  13. Copy the image to all required regions. Ensure each new image has the correct tags and permissions set after it reaches the active state.

Back to top

Amazon EC2 - Ubuntu

To create a custom image for Amazon EC2 – Ubuntu:

  1. Launch a new instance from the cloud console, using an Ubuntu Server 12.04 x64 image.
  2. Connect to the instance that you just created, signing in as ubuntu.
  3. Run the following commands to update the image:

    sudo apt-get update

    sudo apt-get upgrade

    sudo apt-get -y install libc6-i386 lib32stdc++6 lib32ncurses5 gsoap:i386 mc

  4. Upload the Load Generator standalone installation to the Linux machine. You can find the installation files in the LoadRunner DVD folders:

    DVD\Linux\Web_Installers_64\InstData\Linux\VM

    or

    DVD\Linux\Web_Installers_32\InstData\Linux\VM

  5. Execute the following command for the uploaded files:

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

  6. Run the following:

    bash installer.sh

  7. Install the standalone 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:

    • export LD_LIBRARY_PATH=/opt/HP/HP_LoadGenerator/bin
    • export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
    • export M_LROOT=/opt/HP/HP_LoadGenerator
    • /opt/HP/HP_LoadGenerator/bin/LgCloudAgent
  9. Create an AMI from the instance. Set the name and description according to the following:

    1. Name: LR-PC_Load_Generator_<version>_<OS> template, e.g. LR-PC_Load_Generator_12.55_Ubuntux64
    2. Description: LR LG, PC Compatible, version{12.55}, e.g. LR LG, PC Compatible, version{12.55}
    3. $subscription_id: the subscription id of the image. To determine this value, see the Settings > Subscriptions page on the Azure console.
  10. Set the AMI to public if necessary.

  11. Copy the AMI to all required regions. Make sure to copy all tags and permissions to each new image.

Back to top

Google Cloud - Windows

To create a custom image for Google Cloud – Windows:

  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) hpe-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 Load Generator Standalone installation file to the instance, and install in Performance Center (PC) Mode.

    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:\Program Files (x86)\HPE\Load Generator\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.

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

Back to top

Google Cloud - Ubuntu

To create a custom image for Google Cloud – Ubuntu:

  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) hpe-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 Load Generator Standalone installation file to instance1 from:

      DVD\Linux\Web_Installers_64\InstData\Linux\VM

      or

      DVD\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 Load Generator standalone 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/HP/HP_LoadGenerator/bin
      • export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
      • export M_LROOT=/opt/HP/HP_LoadGenerator
      • /opt/HP/HP_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.

      gcloud compute images create <new image name> --description "LR LG, PC Compatible, version{12.55}, 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 the following locations:

    <DVD>\Linux\Web_Installers_64\InstData\Linux\VM

    or

    <DVD>\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/HP/HP_LoadGenerator/bin
    2. export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
    3. export M_LROOT=/opt/HP/HP_LoadGenerator
    4. export CLOUD=DigitalOcean
    5. /opt/HP/HP_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 version {12.55} or any other 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