Creating a custom image in Azure

Optionally, create a custom image with the base OS and IBM® Spectrum Conductor installed. Azure VMs are provisioned using this custom image, significantly reducing the time that it takes to provision a VM from the cloud.

About this task

To create a custom image, manually order an Azure VM with a base Linux® image. Then, customize the VM by installing IBM Spectrum Conductor.

Procedure

  1. Use SSH to connect to the Azure VM and upload the IBM Spectrum Conductor installer and entitlement file to the VM.
  2. Update the Administrator user (root) password and switch to the Administrator user (root).
  3. Update the /etc/hosts file on the Azure VM to add the host names of the IBM Spectrum Conductor primary and primary candidates. If the ego.conf file in your cluster uses a short name for the primary host, add the short name of the host as well.
  4. Use root or sudo to install IBM Spectrum Conductor on the VM as a compute host. For more information, see Installing on a compute host.
    Note: Do not install IBM Spectrum Conductor to your home directory because the directory is cleaned up before IBM Spectrum Conductor is started to create an image of the VM. Choose to install to (for example) /opt.
  5. After installation, join the host to the cluster and start IBM Spectrum Conductor on the VM. For more information, see Configuring IBM Spectrum Conductor.
    1. Source the environment for your shell. For example, when you use BASH, enter:
      . $EGO_TOP/profile.platform
    2. Join the VM to the cluster:
      egoconfig join primary_host
    3. Ensure that the instance group used for cloud bursting is deployed to the host. You can deploy the instance group either by triggering automatic deployment when the host joins a resource group in which the instance group is already deployed, or by deploying a new instance group to the resource group that the host belongs to.
    4. Disable automatic deployment in the $EGO_CONFDIR/../../ascd/conf/ascd.conf file to prevent automatic deployment during cloud bursting:
      ASC_AUTO_DEPLOY_ON_NEW_HOST=OFF
  6. Create the image of the VM.
    1. On the custom VM that was manually created, run the following command:
      sudo waagent -deprovision+user -force && halt

      For more information, see How to create an image of a virtual machine or VHD.

    2. From the machine on which you installed the Azure CLI, run the following commands:
      az vm deallocate -g "resource_group_name" -n "instance_name"  
      az vm generalize -g "resource_group_name" -n "instance_name"
      az image create -n "image_name" -g "resource_group_name" --os-type Linux --source "instance_name"
      where:
      • resource_group_name is the name of the Azure resource group that this VM belongs to.
      • instance_name is the name of the Azure VM that you ordered.
      • image_name is the name chosen for the custom Linux image.
      Note: Keep track of image properties, especially details such as the image ID. You will need this information to set up your host template configuration in the azureprov_template.json file.

What to do next

After creating your custom image, configure a post-provisioning script for greater flexibility in managing your configuration. See Configuring the sample post-provisioning script for Azure.