<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Virtualization Tools

Virtualization Tools

The Virtualization integration allows AnthillPro to clone, deploy, and undeploy configurations. Implemented as job steps, the integration can be used as part of your build workflows or as a secondary process.

VMware Lab Manager

The VMware Lab Manager (2.5.x and above) integration provides control environments used by AnthillPro, as well as those not directly related to AnthillPro. The integration allows AnthillPro users to ensure that specific sets of machines (e.g., DEV, QA, PROD, etc.) are available for use by the AnthillPro server; as well as the use of Lab Manager load management capabilities to maximize server resources.

The Lab Manager integration is implemented as AnthillPro job steps, and is configured on the Job Configuration page. When using the integration, click the Create Step button (or select the Insert After/Before icon) to add steps to a job. Once the job is configured, it is then added to the workflow under the Definition tab.

When configuring the Lab Manager integration, it is possible to include scripts and/or property lookups in all the fields. For example, specify ${bsh:...} or ${property:...} type strings that will be resolved to values at runtime (see Scripting). Any steps within AnthillPro relying on VMware Lab Manager will not work until the integration is configured. The Lab Manager integration includes the following AnthillPro job steps (in the VMware folder):

  • Lab Manager - Deploy Configuration. Deploys a Lab Manager configuration. This step will locate a configuration by name and start it if the configuration is deployed. If the configuration is not deployed, this step will deploy the configuration first.

  • Lab Manager - Undeploy Configuration. Undeploys a Lab Manager configuration. This step will locate the configuration by name and undeploy the configuration. If the configuration is undeployed the step will do nothing.

  • Lab Manager - Clone Configuration. Clones a Lab Manager configuration. This step will create a clone of any specified configuration and then identify the clone with a user specified name.

Lab Manager Prerequisites

  • You must have AnthillPro administrative privileges to configure the integration. See Manage Security.

  • VMware Lab Manager 2.5.x or greater.

  • Lab Manager base URL, user name, and password.

  • Necessary permissions set in Lab Manager that allow the specified AnthillPro user to access the web-service interface. If this is not done, Lab Manager may display an alert saying only the administrator has permission to use the web service.

Configure Lab Manager

  1. Go to System > VMware Lab Manager under the Integration menu.

  2. On the VMware Lab Manager Integration page, click Edit.

  3. Configure:

    • Give the Lab Manager Base URL.

    • User Name. Enter the user name to be used to connect to the Lab Manager server. This name needs to be pre-configured in Lab Manager and is used for authentication, allowing AnthillPro to perform Lab Manager tasks.

    • Password. Provide the password to be used to connect to the Lab Manager.

    • Password Script. To use a script or property lookups for the password, leave the Password field blank and enter it here. The password script is used to retrieve the password from external source. Essentially, this is a BeanShell script that reads the password from a file (or contacts an external service to retrieve the password) and populates the password field at runtime. This feature is most useful when passwords are changed often. See Scripting.

    • HTTP Connection Timeout. Enter the time (in minutes) it takes for the slowest Lab Manager configuration to deploy to a server.

  4. Click Set then Done.

Adding Lab Manager Steps to an Existing Job

Any Lab Manager step can be used as part of an existing job. Where the step is placed within the job depends on what the job does. The example in this section will copy and save a Lab Manager configuration to be reproduced later. When using the integration, click the Create Step button (or select the Insert After/Before icon) to add steps to a job. Once the job is configured, it is then added to the workflow under the Definition tab.

Though the example embeds a single job within a workflow, it is possible to use the Lab Manager integration in a number of ways. The integration can be used with originating or non-originating workflows, and can be run sequentially or in parallel with other jobs within the same workflow. For simplicity, the Lab Manager steps have been included as part of a single build job in the example.

  1. Go to Administration, select the appropriate project, and then select the job that the Lab Manager steps are to be added to.

  2. Lab Manager - Deploy Configuration. Select the Insert After icon of the step prior to where the Deploy Configuration step is to be included (the Set Working Directory step for example). Expand the VMware folder, select the Lab Manager - Deploy Configuration step, and click Select.

    • Name the step.

    • Description. Provide an optional description.

    • Configuration Name. Give the Lab Manager configuration name (a script may be used).

      If using the Wait for Agents option below, the configuration name must be an exact match to the property set on the agent, or the deploy configuration step will fail. Any punctuation, capitalization, and/or spaces must be identical. For example, if the configuration name is test.config, the property on the agent must be named lab.manager.test.config (not lab.manager.test-config, lab.manager.test config, etc.). If a script is used to determine the configuration name, it must return a name that exactly matches the agent property set below.

    • Fence Mode. Select the Lab Manager options to fence; to block traffic in and out; to allow traffic out only; or to allow traffic in and out.

    • Wait for Agents. Select this option to have AnthillPro wait for agents within the configuration to come online. The default timeout value for this step is set to 10 minutes to prevent unsuccessful deploys from blocking the workflow execution. If your deploys run longer, you may need to adjust this setting (see Show Additional Options below).

      For an agent to be considered a member of a configuration, it must contain an agent property of the form lab.manager.<configurationName>, where configurationName is the name of the configuration being deployed. For example, if the configuration name is test.config, the property set on the agent must be lab.manager.test.config (only the agent property name is used, so there are no requirements for the property value). Once the agents in the configuration have this property, AnthillPro will wait until the number of agents defined below are online.

      When setting the agent property, first make sure the agent is installed (see Installing AnthillPro) within the configuration to be deployed and has been added to the correct AnthillPro environment(s) (see also Configure Agents). With the agent online, add the property. See here in the Configure Agents section.

    • Number of Agents to Wait For. If the Wait for Agents option is selected, specify the minimum number of agents to come online before the step completes. With the default value, 0 (zero), AnthillPro will wait for 1 agent from each machine in the configuration (a value of 1 is equivalent).

      While waiting for agents to come online, AnthillPro will look for the agent property set above, so the number of agents set here may not exceed the number of agents that contain the property set in the previous step -- otherwise the step will timeout. For example, if the lab.manager.test.config property is set on 3 agents within the configuration test.config, and the number of agents to wait for is set at 4, the step will fail. However, if the lab.manager.test.config property is set on 3 agents within the configuration test.config, and the number of agents to wait for is set at 1, the step will complete (i.e., AnthillPro will not wait for all 3 agents to come online before completing the deploy configuration step).

      The default timeout value for this step is set to 10 minutes to prevent unsuccessful deploys from blocking the workflow execution. If your deploys run longer, you may need to adjust this setting (see Show Additional Options below).

    • Show Additional Options (advanced). Select the Show Additional Options link to configure more options.

      • Is Active. Select No to temporarily deactivate the step without deleting it; otherwise select Yes.

      • Pre-Condition Script. From the drop down menu, select the condition which must be met for the step to continue. Before editing an existing script or creating a new one, see Step Pre-Condition Scripts.

      • Ignore Failures. Select Yes if this step should not effect the determination for step continuation or the status determination of the job.

      • PostProcessingScript. Select a script for determining when commands should count as fail or succeed. See Post Processing Scripts.

      • Timeout. Enter the time in minutes after the start of the step when AnthillPro will consider the step as timed out and abort it. The default wait time is set to 10 minutes. If it takes longer to deploy, increase this default value. This value will be used to determine how long AnthillPro will wait for the agents specified above.

  3. Click Save.

  4. Lab Manager - Clone Configuration. Select the Insert After icon of the step prior to where the Clone Configuration step is to be included (the Run QTP Test step for example). Expand the VMware folder, select the Lab Manager - Clone Configuration step, and click Select.

    • Name the step.

    • Description. Give a description.

    • Configuration Name. Provide the name of the Lab Manager configuration to be closed.

    • Cloned Configuration Name. Give a name for the cloned configuration. This should be different from the original.

    • Show Additional Options (advanced). See Show Additional Options.

  5. Click Save.

  6. Lab Manager - Undeploy Configuration. Select the Insert After icon of the Lab Manager - Clone Configuration step, expand the VMware folder, select Lab Manager - Undeploy Configuration, and click Select.

    • Name the step.

    • Description. Give a description.

    • Configuration Name. Provide the name of the Lab Manager configuration to be closed.

    • Show Additional Options (advanced). See Show Additional Options.

  7. Click Save.

Adding Lab Manager Job to Workflow

This example adds a job to an existing workflow. Complete workflow configuration is beyond the scope of this tutorial. The topics covered in detail below are specific to using the Lab Manager integration.

  1. Go to Administration, select the workflow the Lab Manager job is to be added to.

  2. Select the Definition tab, choose Embedded Definition from the drop-down menu, and click Select.

  3. Left-click the START icon and select Insert Job After.

  4. Select the Job from the drop-down menu, choose a pro-condition script, and click Insert Job.