hostProviders.json

The hostProviders.json file configures which resource providers LSF resource connector can use.

The default location for the hostProviders.json file is <LSF_TOP>/conf/resource_connector/hostProviders.json.

The hostProviders.json file contains a JSON list of named providers. For example, for AWS, the type is awsProv.

You can specify an absolute path for configuration and script files. The default assumes a path relative <LSF_TOP>/conf/resource_connector for configuration files and <LSF_TOP>/<LSF_VERSION>/resource_connector/ for scripts.

Changes to the hostProviders.json configuration file requires a reconfiguration of LSF by running the command badmin mbdrestart on the LSF management host.

You can define multiple providers in the list, so LSF can borrow hosts from EGO, OpenStack, AWS, and other providers, assuming that the providers are properly configured.

You can also configure multiple instances of the the same provider, with different properties for different purposes.

For hosts to operate in the same cluster, all host providers must have the same LSF administrator. The LSF administrator must have access to the directories specified by confPath and scriptPath.

You cannot define more than one pre- or post-provisioning script.

The pre- or post-provisioning script is local to each provider defined in the providers list. If you want all providers to run the same script, you need to specify the same path inside each provider.

Each host provider must have a unique name. If two different host providers use the same name, LSF logs a warning and ignores one of the entries.

Parameters

providers
A list of resource providers.
name
The name of the resource provider.
type
The type of the resource provider.
confPath
Path to the resource provider configuration directory. Full and relative paths are supported.

The default confPathis relative to LSF_TOP/conf/resource_connector.

scriptPath
Path to the resource provider script directory. Full and relative paths are supported.

The default scriptPath is relative to LSF_TOP/LSF_VERSION/resource_connector.

Important: Use the default scriptPath parameter value, which refers to the LSF_TOP/LSF_VERSION/resource_connector/provider_name file path. If you put the script files in the LSF_TOP/conf/resource_connector directory or use a custom value for scriptPath, LSF resource connector patch files do not automatically update the script and library files. This is because the LSF patchinstall command only updates files under the LSF_TOP/LSF_VERSION directory.
scriptOptions

For AWS resource provider. By default, LSF assumes that the management host has direct access to AWS. If your site's security policy requires the connection to AWS to be made through a proxy server, the scriptOptions attribute enables LSF to connect to AWS instances through the specified proxy host name or IP address, and proxy server port.

LSF sets environment variable SCRIPT_OPTIONS when launching the scripts.

preProvPath and postProvPath
Optional. The resource connector runs the pre-provisioning script (specified with absolute path, such as /usr/share/lsf/scripts/pre_provision.sh) after the instance is created and started successfully, but before it is marked allocated to the LSF cluster.

The resource connector runs the post-provisioning script (specified with absolute path, such as /usr/share/lsf/scripts/post_provision.sh) after the instance is terminated successfully, but before it is removed from the LSF cluster.

Here is an example input JSON file (note that the name value is the name assigned by the provider, not the hostname):
{
"machines": [
          {
            "name": "name_provided_by_provider",
            "publicIpAddress": "55.66.xx.xx",
            "privateIpAddress": "10.0.xx.xx",
            "machineId ": "i-19034xxxxx",
            "rcAccount": "project1" ,
            "providerName": "aws",
            "providerType": "awsProv",
            "templateName": "Template-VM-2"
          },
          {
            "name": "name_provided_by_provider",
            "machineId": "idxxxxxxxxxxxxx",
            "publicIpAddress": "55.66.xx.xx",
            "privateIpAddress": "10.0.xx.xx",
            "machineId ": "i-19034xxxxx",
            "rcAccount" : "project2",
            "providerName": "aws",
            "providerType": "awsProv",
            "templateName": "Template-VM-2"

          }
    ]
}

Next, the output JSON file is passed. The scripts run for each request and a request can have multiple machines in it.

Here is an example expected return for the scripts. Note that delayOnReturn value specifies the number of minutes that the resource connector will wait before returning the host if a fails. The default wait time is 20 minutes. The delayOnReturn parameter is not used if the scripts execute successfully:
{
"machines": [
          {
            "name": "name_provided_by_providerl",
            "machineId ": "i-19034xxxxx",
            "result": "succeed",
            "message": ""                                             
           },
          {
            "name": "name_provided_by_provider",
            "machineId ": "i-19034xxxxx",
            "result": "failed",
            "message": "could not resolve host name”,      
            "delayOnReturn": 20                
          }
    ]
}
The script exit code is an integer:
  • A 0 exit code indicates a successful completion with no errors and produces an output JSON file with content.
  • A -1 exit code indicates a failed script or one that runs with fatal errors and produces an empty output JSON file.
provTimeOut
Optional. This parameter is used to avoid the pre- or post-provisioning program from running for unlimited time. Specify a value in minutes.

If the program does not complete in the specified time, it is ended and reported as failed. Setting the provTimeOut value to 0 disables script timeout.

The default value is ten minutes. If the pre-provisioning or post-provisioning program does not return after ten minutes, it ends.

provHostTimeOut

Optional. The timeout value for each host provider. The default value is ten minutes.

If a resource connector host does not join the LSF cluster within this timeout value, then the host is relinquished.

billingPeriod
Ignore the LSB_RC_EXTERNAL_HOST_IDLE_TIME value defined in the lsf.conf file and use the time the instance was launched to return the machine to the provider.

For example, if a host was launched at 10:00 AM, and billingPeriod is 60 minutes, and the host became idle at 10:55, it is returned before the next billing cycle that starts at 11 AM.

If set to 0 or not defined, the resource connector uses the value defined in the parameter LSB_RC_EXTERNAL_HOST_IDLE_TIME in the lsf.conf file.

The default billing period is 0.

Example

{
    "providers":[
        {
            "name": "ego",
            "type": "egoProv",
            "confPath": "resource_connector/ego",
            "scriptPath": "resource_connector/ego"
,            "billingPeriod":  "60",
            "preProvPath":  "/usr/share/lsf/scripts/pre_provision_ego.sh",
            "postProvPath": "/usr/share/lsf/scripts/post_provision_ego.sh",
            "provTimeOut" : 10
        },
        {
            "name": "openstack",
            "type": "openstackProv",
            "confPath": "resource_connector/openstack",
            "scriptPath": "resource_connector/openstack",
            "billingPeriod":  "60",
            "preProvPath":  "/usr/share/lsf/scripts/pre_provision.sh",
            "postProvPath": "/usr/share/lsf/scripts/post_provision.sh",
            "provTimeOut" : 10
        },
        {
            "name": "aws",
            "type": "awsProv",
            "confPath": "resource_connector/aws",
            "scriptPath": "resource_connector/aws",
            "scriptOptions": "-Dhttps.proxyHost=10.115.206.146 -Dhttps.proxyPort=8888",
            "billingPeriod":  "60",
            "preProvPath":  "/usr/share/lsf/scripts/pre_provision.sh",
            "postProvPath": "/usr/share/lsf/scripts/post_provision.sh",
            "provTimeOut" : 10
        },
        {
            "name": "azure",
            "type": "azureProv",
            "confPath":"/usr/share/lsf_nevis/conf/resource_connector/azure",
            "scriptPath": "/usr/share/lsf_nevis/resource_connector/azure"
        },
        {
           "name": "google",
           "type": "googleProv",
           "confPath": "resource_connector/google",
           "scriptPath": "resource_connector/google"
        },
        {
            "name": "cyclecloud",
            "type": "cyclecloudProv",
            "confPath": "resource_connector/cyclecloud",
            "scriptPath": "resource_connector/cyclecloud"
        }
        {
            "name": "ibmcloudgen2",
            "type": "ibmcloudgen2Prov",
            "confPath": "resource_connector/ibmcloudgen2",
            "scriptPath": "resource_connector/ibmcloudgen2"
        }
    ]
}