Creating a custom Linux image in Azure

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

Before you begin

If your cluster is a mixed environment that contains a combination of Linux and Windows hosts, see Configuring a mixed operating system cluster.

Procedure

  1. Use SSH to connect to the Azure VM and upload the IBM Spectrum Symphony installer and entitlement file to the VM:
    scp sym-version_architecture.bin account_name@vm_ip:/home/account_name
  2. Update the Administrator user (root) password and switch to the Administrator user (root):
    sudo passwd root
    su –
  3. Update the /etc/hosts file on the Azure VM to add the host names of the primary host and primary host candidates in your IBM Spectrum Symphony cluster.
    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. For example:
    cat /etc/hosts
    198.51.100.4 localhost.localdomain localhost
    192.0.2.3 symcompute.azure.com symcompute
    192.0.2.5 symprimary.mycompany.com symprimary

    If an external DNS is not available, you can configure the ServiceDirector in IBM Spectrum Symphony as an internal DNS server (see Running IBM Spectrum Symphony without external DNS).

  4. Use root or sudo to install IBM Spectrum Symphony on the VM as a compute host.
    1. Install IBM Spectrum Symphony (see Installing on a Linux compute host), for example:
      export BASEPORT=30600
      export CLUSTERADMIN=root
      export CLUSTERNAME=cloud
      export DERBY_DB_HOST=symcompute.azure.com
      export SIMPLIFIEDWEM=N
      export EGOCOMPUTEHOST=Y
      export IBM_SPECTRUM_SYMPHONY_LICENSE_ACCEPT=Y
      ./sym-version_architecture.bin
      Note: Do not install IBM Spectrum Symphony to your home directory because the directory is cleaned up before IBM Spectrum Symphony is started to create an image of the VM. Choose to install to (for example) /opt.
    2. Source the environment for your shell; for example, when you use BASH, enter:
      . $EGO_TOP/profile.platform
    3. Join the VM to the cluster (see Adding a host to a cluster); for example, enter:
      egoconfig join symprimary
  5. 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.

What to do next

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