Create custom image for cloud hosts

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

Custom Amazon (Windows) image

This section describes how to create a custom image for Amazon on a Windows environment.

Step 1: Provision a Windows Server (from supported versions) instance or virtual machine

  1. Install the latest Windows and Windows Defender updates.

  2. Launch a new instance from the cloud console. Make sure the Shutdown behavior is set to Stop. Refer to the product documentation for more details.

Note: Make sure .NET Framework 4.5 is enabled. Refer to the product documentation for more details.

Step 2: Install Load Generator Standalone

  1. Connect to the server using the Administrator account.

  2. Deactivate UAC (User Account Controls) and LUA (Limited User Account).

    1. Deactivate User Account Control (UAC) on the machine before installing Load Generator Standalone. For details, see the Microsoft documentation.

    2. Open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA in the Registry Editor, and change the Value data for "EnableLUA" to "0".

  3. Install OneLG on the cloud machine in the default LRE Mode, and install Network Virtualization. The setup file is in the LoadRunner installation package's Standalone Applications folder.

    Note:  

    • Install OneLG in a non-default location, such as C:\OneLG.

    • During installation, clear the Specify certificate option.

Step 3: Configure the load generator machine

  1. Add the IUSR_METRO local user to the machine, and choose a password that meets your organization's security requirements.

  2. Turn off firewalls using the following command:

    Copy code
    netsh advfirewall set allprofiles state off
  3. Configure your browser as follows:

    1. Switch the Administrator user with the IUSR_METRO user. Log out of the remote desktop session, and log on again with the IUSR_METRO user.

    2. Open your browser and modify the security settings.

      1. In the Control Panel, select Internet Options > Security.

      2. In the Internet security zone:

        • Reduce the security level to Medium.

        • Clear the Enable Protected Mode setting.

      3. In the Trusted sites zone, reduce the security level to Medium-low.

  4. Change the Temporary folder settings

    In System Properties > Environment Variables, change:

    • IUSR_METRO default path to C:\Temp.

    • System account temp folder to C:\Temp (by default it is C:\Windows\Temp).

  5. Switch IUSR_METRO with the Administrator user. Log out of the remote desktop session, and log on again with the Administrator user.

  6. Register the LGCloudAgent service using the following command:

    Copy code
    sc create LGCloudAgent binPath= "c:\OneLG\bin\LGCloudAgent.exe" start= auto
  7. Configure Services to use the IUSR_METRO user account when launching processes (such as lr_bridge and mdrv)

    1. In a command prompt, change directory to <Load Generator installation folder>\launch_service\bin, and run the following commands:

      Copy code
      magentservice.exe -remove
      magentservice.exe -install iusr_metro <user password>
    2. Update the user information for the alagent service by performing the following:

      In a command prompt, change directory to <Load Generator installation folder>\al_agent\bin and run the following commands:

      Copy code
      alagentservice.exe -remove
      alagentservice.exe -install iusr_metro <user password>
  8. Change the startup type of the LoadRunnerAgent and RemoteManagementAgent service by running the following commands:

    Copy code
    sc config LoadRunnerAgent start= demand
    sc config "LoadRunner Remote Managementagent" start= demand
  9. Deny remote login from IUSR_METRO.

    1. Open the Local Users and Groups console by running lusrmgr.msc from a command prompt.

    2. Click the Administrators group, and make sure IUSR_METRO is listed there.

    3. Click the Remote Desktop Users group, and make sure only the Administrator user is listed there (not the Administrators group).

    4. Open the Local Security Policy console by running secpol.msc from a command prompt.

    5. Expand Local Policies, and select User Rights Assignment.

    6. Open Allow log on through Remote Desktop Services policy, and make sure only Remote Desktop Users are included in it.

Step 4: Prepare the image

  1. Delete all temp data created by downloading, unpacking, and installing the load generator installer.

  2. Run the EC2Config utility.

    1. Set the Administrator password to Random.

    2. Click Shutdown with SysPrep.

    Note: Do not create an Amazon Machine Image (AMI) from a running instance. Doing so results in:

    • Inability to obtain the Administrator password using the key pair.

    • Services not being started at the provision time; hence the load generator is not usable for running tests.

Step 5: Create an image from the instance

  1. Create an AMI from an Instance.

    • Set the Name according to LR-LRE_Load_Generator_<version>_<OS> template. For example, LR-LRE_Load_Generator_2021_Win2019

    • Set the Description to ״LR LG, LRE Compatible״ and ״version{<version>}״ template. For example,״LR LG, LRE Compatible, version{2021}״

    • Select the Delete on Termination check box.

  2. Copy the image to all required regions.

Back to top

Custom Amazon (Ubuntu) image

This section describes how to create a custom image for Amazon on Ubuntu.

Step 1: Provision an Ubuntu 16.04 x64 instance

Launch a new instance from the cloud console. Use the latest Ubuntu Server 16.04 x64 image. Make sure the Shutdown behavior is set to Stop. Refer to the product documentation for more details.

Step 2: Install Load Generator Standalone

  1. Connect to the instance that you just created, signing in as ubuntu.

  2. Run the following command to update the image:

    Copy code
    sudo
    dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y install libc6-i386 lib32stdc++6 lib32ncurses5 libkrb5support0:i386 libkeyutils1:i386 gsoap:i386 mc libglib2.0-0:i386 libidn11:i386
  3. Install an LG SA (Load Generator Standalone) on the cloud machine, and install Network Virtualization. The setup file is in the LoadRunner installation package's Standalone Applications folder.

    During installation, accept all of the defaults. Skip the Certificate Installation step and the Load Generator startup.

    Note: Installing LG SA means installing a full build (the Linux installer is always a full installer).

  4. Perform the following in the /etc/rc.local file:

    1. Insert the following lines:

      Copy code
      #!/bin/bash
      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
    2. Change file permissions by running the command:

      Copy code
       sudo chmod a+x /etc/rc.local

Step 3: Create an image from the instance

  1. Create an AMI from the instance.

    • Set the Name according to LR-LRE_Load_Generator_<version>_<OS> template. For example, LR-LRE_Load_Generator_2021_Ubuntux64

    • Set the Description to ״LR LG, LRE Compatible״ and ״version{<version>}״ template. For example, ״LR LG, LRE Compatible, version{2021}״

    • Select the Delete on Termination check box.

  2. Copy the AMI to all required regions.

Back to top

Custom Azure (Windows) image

This section describes how to create a custom image for Azure on a Windows environment.

Step 1: Provision a Windows Server (from supported versions) instance or virtual machine

  1. Install the latest Windows and Windows Defender updates.

  2. In the Azure portal, go to Virtual machines and create a new virtual machine.

Note: Make sure .NET Framework 4.5 is enabled. Refer to the product documentation for more details.

Step 2: Install Load Generator standalone

  1. Connect to the server using the Administrator account.

  2. Deactivate UAC (User Account Controls) and LUA (Limited User Account).

    1. Deactivate User Account Control (UAC) on the machine before installing Load Generator Standalone. For details, see the Microsoft documentation.

    2. Open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA in the Registry Editor, and change the Value data for "EnableLUA" to "0".

  3. Install OneLG on the cloud machine in the default LRE Mode, and install Network Virtualization. The setup file is in the LoadRunner installation package's Standalone Applications folder.

    Note:  

    • Install OneLG in a non-default location, such as C:\OneLG.

    • During installation, clear the Specify certificate option.

Step 3: Configure the load generator machine

  1. Add the IUSR_METRO local user to the machine, and choose a password that meets your organization's security requirements.

  2. Turn off firewalls using the following command:

    Copy code
    netsh advfirewall set allprofiles state off
  3. Configure your browser as follows:

    1. Switch the Administrator user with the IUSR_METRO user. Log out of the remote desktop session, and log on again with the IUSR_METRO user.

    2. Open your browser and modify the security settings.

      1. In the Control Panel, select Internet Options > Security.

      2. In the Internet security zone:

        • Reduce the security level to Medium.

        • Clear the Enable Protected Mode setting.

      3. In the Trusted sites zone, reduce the security level to Medium-low.

  4. Change the Temporary folder settings

    In System Properties > Environment Variables, change:

    • IUSR_METRO default path to C:\Temp.

    • System account temp folder to C:\Temp (by default it is C:\Windows\Temp).

  5. Switch IUSR_METRO with the Administrator user. Log out of the remote desktop session, and log on again with the Administrator user.

  6. Register the LGCloudAgent service using the following command:

    Copy code
    sc create LGCloudAgent binPath= "c:\OneLG\bin\LGCloudAgent.exe" start= auto
  7. Configure Services to use the IUSR_METRO user account when launching processes (such as lr_bridge and mdrv).

    1. In a command prompt, change directory to <Load Generator installation folder>\launch_service\bin, and run the following commands:

      Copy code
      magentservice.exe -remove
      magentservice.exe -install iusr_metro <user password>
    2. Update the user information for the alagent service by performing the following:

      In a command prompt, change directory to <Load Generator installation folder>\al_agent\bin and run the following commands:

      Copy code
      alagentservice.exe -remove
      alagentservice.exe -install iusr_metro <user password>
  8. Change the startup type of the LoadRunnerAgent and RemoteManagementAgent service by running the following commands:

    Copy code
    sc config LoadRunnerAgent start= demand
    sc config "LoadRunner Remote Managementagent" start= demand
  9. Deny remote login from IUSR_METRO.

    1. Open the Local Users and Groups console by running lusrmgr.msc from a command prompt.

    2. Click the Administrators group, and make sure IUSR_METRO is listed there.

    3. Click the Remote Desktop Users group, and make sure only the Administrator user is listed there (not the Administrators group).

    4. Open the Local Security Policy console by running secpol.msc from a command prompt.

    5. Expand Local Policies, and select User Rights Assignment.

    6. Open Allow log on through Remote Desktop Services policy, and make sure only Remote Desktop Users are included in it.

  10. If the %SYSTEMDRIVE%\AzureData folder exists, remove it and its contents.
  11. Restart the virtual machine.

Step 4: Prepare the image

  1. Connect to the server using the Administrator account and delete all temp data created by downloading, unpacking, and installing the load generator installer.

  2. Run the System Preparation Tool using the Generalize and Shutdown options.

    1. Open the Command Prompt window as an administrator. Change the directory to %windir%\system32\sysprep, and then run sysprep.exe.

    2. In the System Preparation Tool dialog box, select Enter System Out-of-Box Experience (OOBE), and make sure that the Generalize check box is selected.

    3. In Shutdown Options, select Shutdown and then click OK.

    4. When Sysprep completes, it shuts down the virtual machine. Do not restart the VM.

Step 5: Create an image from the virtual machine

Note: The virtual machine must be in Stopped state before proceeding with this step.

  1. Create an image from the virtual machine, and configure the following settings:

    • Set Image name according to the LR-LRE_Load_Generator_<version>_<OS> template. For example, LR-LRE_Load_Generator_2021_Win2019.

    • Select the I've run Sysprep on the virtual machine check box. This deletes the virtual machine after the capture operation is completed.

  2. Add a tag to the virtual machine with the following values:

    • Name: ImageVersion

    • Value: LR LG, LRE Compatible, version{<version>}

      For example, LR LG, LRE Compatible, version{2021}.

  3. The new image is available in the VM images menu.

  4. (Optional) To quickly copy the image to other regions, add the image to the Azure Compute Gallery. Tag the image gallery image as in step 2 above.

Back to top

Custom Azure (Ubuntu) image

This section describes how to create a custom image for Azure on Ubuntu.

Step 1: Provision an Ubuntu 16.04 x64 virtual machine

In the Azure portal, go to Virtual machines and create a new virtual machine. Use the latest Ubuntu Server 16.04 x64 image. Refer to the product documentation for more details.

Step 2: Install Load Generator standalone

  1. Connect to the virtual machine that you just created.

  2. Run the following command to update the image:

    Copy code
    sudo apt-get update
    sudo apt-get upgrade
  3. Install an LG SA (Load Generator Standalone) on the cloud machine, and install Network Virtualization. The setup file is in the LoadRunner installation package's Standalone Applications folder.

    During installation, accept all of the defaults. Skip the Certificate Installation step and the Load Generator startup.

    Note: Installing LG SA means installing a full build (the Linux installer is always a full installer).

  4. Perform the following in the /etc/rc.local file:

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

      Copy code
      #!/bin/bash
      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/MF/MF_LoadGenerator/bin
      export PRODUCT_DIR=/opt/MF/MF_LoadGenerator
      export M_LROOT=/opt/MF/MF_LoadGenerator
      /opt/MF/MF_LoadGenerator/bin/LgCloudAgent
    2. Change file permissions by running the command:

      Copy code
      sudo chmod a+x /etc/rc.local
  5. Run the following:

    Copy code
    sudo waagent -deprovision
  6. If the var/lib/waagent/ folder exists, remove it and its contents.
  7. Shut down the instance and verify that it has stopped.

Step 3: Create an image from the virtual machine

  1. Create an image from the virtual machine, and configure the following settings:

    • Set Image name according to the LR-LRE_Load_Generator_<version>_<OS> template. For example, LR-LRE_Load_Generator_2021_Win2019.

    • Select the I've run Sysprep on the virtual machine check box. This deletes the virtual machine after the capture operation is completed.

  2. Add a tag to the virtual machine with the following values:

    • Name: ImageVersion

    • Value: LR LG, LRE Compatible, version{<version>}

      For example, LR LG, LRE Compatible, version{2021}.

  3. The new image is available in the VM images menu.

  4. (Optional) To quickly copy the image to other regions, add the image to the Azure Compute Gallery. Tag the image gallery image as in step 2 above.

Back to top