Configuring the sample post-provisioning script for IBM Cloud

Customize compute hosts that are provisioned from the cloud service provider by using post-provisioning scripts. IBM® Spectrum Conductor provides sample scripts that you can use with minimal configuration.

About this task

Based on your image option, configure one of the following sample scripts for IBM Cloud compute hosts:
Provisioning option Sample script to use
Custom image Use the short post_install.sh script to configure IBM Spectrum Conductor, then start EGO.
Note: Ensure that automatic startup is not configured in your custom image. With automatic startup, IBM Spectrum Conductor is started on the host before the post-provisioning script runs on it, preventing any custom configuration from taking effect.
Base OS image Use the long fresh_install.sh script to download, install, and configure IBM Spectrum Conductor on the host, then start EGO.

After you customize the sample script, you must add it to a HTTPS repository. Remember this location to be configured in the postProvisionURL parameter of the softlayerprov_templates.json file.

Procedure

  • If you provisioned hosts by using a custom image, configure the post_install.sh script to define any custom configuration, then start EGO on the host:
    1. Go to the $EGO_TOP/hostfactory/1.1/providerplugins/ibmcloud/samplepostprovision/cws/ directory and back up the post_install.sh script for recovery purposes.
    2. Use any text editor to open the post_install.sh script.
    3. Define the EGO_TOP parameter to the IBM Spectrum Conductor installation directory, for example, /opt/ibm/spectrumcomputing.
    4. Update the script for any custom configuration (for example, if you want cloud hosts to join resource groups other than the default ComputeHosts resource group; see Adding cloud hosts to resource groups).
    5. Set up a HTTPS repository to store your post-provisioning script and copy the post_install.sh script to this repository, so that the script can be accessed and automatically run on provisioned IBM Cloud instances.
  • If you provisioned hosts by using a base OS image, configure the fresh_install.sh script to download, install, and configure IBM Spectrum Conductor on the host, then start EGO:
    1. Copy the IBM Spectrum Conductor installation files to any accessible host.
      1. Set the IBM_SPECTRUM_CONDUCTOR_LICENSE_ACCEPT environment variable to indicate acceptance of the licensing terms and conditions, for example:
        export IBM_SPECTRUM_CONDUCTOR_LICENSE_ACCEPT=Y
      2. Extract the .rpm files that are required to install IBM Spectrum Conductor, as instructed in step 5 of the Installing on a compute host topic.
      3. Copy the .rpm files to any accessible host.
    2. Update the fresh_install.sh script to download, install, and configure IBM Spectrum Conductor on provisioned cloud hosts:
      1. Go to the $EGO_TOP/hostfactory/1.1/providerplugins/ibmcloud/samplepostprovision/cws/ directory and back up the fresh_install.sh script for recovery purposes.
      2. Use any text editor to open the fresh_install.sh script.
      3. Define the CLUSTERNAME, DERBY_DB_HOST, and BASEPORT parameters for your cluster configuration. Also, define the master_host and master_ip parameters.

        The script connects to the primary host as root. If you installed IBM Spectrum Conductor as non-root, then update the parameters in the configuration file. For detailed instructions, review the comments in the script file.

      4. Specify the host from which to download the .rpm files (which you previously copied in step 1).
      5. Update the script for any custom configuration (for example, if you want cloud hosts to join resource groups other than the default ComputeHosts resource group; see Adding cloud hosts to resource groups).
      6. Set up a HTTPS repository to store your post-provisioning script and copy the post_install.sh script to this repository, so that the script can be accessed and automatically run on provisioned IBM Cloud instances.

What to do next

Configure the IBM Cloud provider plug-in. See Configuring the IBM Cloud provider instance.