Setting up images, regions, and flavors for the cloud discovery service and engine

The cloud discovery service provides information about available images, regions, and flavors to the blueprint design server. This service runs with a default set of options, but you can customize these options so your images, regions and flavors are shown in the blueprint designer.

About this task

To configure the cloud discovery service, you must set up the list of regions and flavors on the engine. Then, you must configure the cloud discovery service to recognize the same regions, and flavors. You must also configure the cloud discovery service to recognize specific images that are used with some clouds.

Setting up regions and flavors on the engine

For the cloud discovery service to provide an accurate list of regions and flavors in the blueprint designer, you must first configure those regions and flavors on the engine. The heat engine does not need a list of available image names to provision instances of those images.

Procedure

  1. On the computer that hosts the Heat engine, make a backup copy of the ibm-cloud-discovery.conf file. This file is in the /usr/lib/heat/ibm-cloud-ext/resources folder.
  2. In the ibm-cloud-discovery.conf file, add images, regions, and flavors. This file provides information for the Heat engine about regions and flavors on the target clouds.
    Note: The information in this file does not support wildcards such as asterisks (*).
    Different clouds require different information:
    • For Amazon EC2 and Azure, no information is needed in this file. You do not configure image names on the engine.
    • For OpenStack and OpenStack-based clouds, no information is needed in this file.
    • For vRealize Automation, list the flavors to use. For example, the following code shows six flavors:
      [vra]
      flavors: [
          {
              "flavor": "default",
              "memory": 0,
              "disk": 0,
              "vcpu": 0
          }, {
              "flavor": "m1.tiny",
              "memory": 512,
              "disk": 20,
              "vcpu": 1
          }, {
              "flavor": "m1.small",
              "memory": 2048,
              "disk": 20,
              "vcpu": 2
          }, {
              "flavor": "m1.medium",
              "memory": 4096,
              "disk": 40,
              "vcpu": 2
          }, {
              "flavor": "m1.large",
              "memory": 8192,
              "disk": 80,
              "vcpu": 4
          }, {
              "flavor": "m1.xlarge",
              "memory": 16384,
              "disk": 100,
              "vcpu": 8
          }]
    • For vCenter, list the flavors to use. For example, the following code shows five flavors:
      [vcenter]
      flavors: [
          {
              "flavor": "m1.tiny",
              "memory": 512,
              "disk": 20,
              "vcpu": 1
          }, {
              "flavor": "m1.small",
              "memory": 2048,
              "disk": 20,
              "vcpu": 2
          }, {
              "flavor": "m1.medium",
              "memory": 4096,
              "disk": 40,
              "vcpu": 2
          }, {
              "flavor": "m1.large",
              "memory": 8192,
              "disk": 80,
              "vcpu": 4
          }, {
              "flavor": "m1.xlarge",
              "memory": 16384,
              "disk": 100,
              "vcpu": 8
          }]
    • For SoftLayer, list the flavors to use. For example, the following code shows five flavors:
      [softlayer]
      flavors: [
          {
              "flavor": "m1.tiny",
              "memory": 1024,
              "disk": 20,
              "vcpu": 1
          }, {
              "flavor": "m1.small",
              "memory": 2048,
              "disk": 20,
              "vcpu": 2
          }, {
              "flavor": "m1.medium",
              "memory": 4096,
              "disk": 40,
              "vcpu": 2
          }, {
              "flavor": "m1.large",
              "memory": 8192,
              "disk": 80,
              "vcpu": 4
          }, {
              "flavor": "m1.xlarge",
              "memory": 16384,
              "disk": 100,
              "vcpu": 8
          }]
    • Also, at the bottom of the file, a section lists the default regions for the system. These regions are used only when you are connected to a cloud that does not have regions defined.
      regions: [
          {
              "id": "RegionOne",
              "name": "RegionOne"
          }]
  3. Restart the engine.
  4. If you are using more than one engine, copy the ibm-cloud-discovery.conf to the other engines and restart them.

Setting up images, regions, and flavors on the cloud discovery service

Now that you have set up the regions and flavors on the engine, you can add those regions and flavors and any required images to the cloud discovery service configuration file

Procedure

  1. On the computer that hosts the cloud discovery service and the blueprint design server, create a configuration file or update the existing configuration file. To create a configuration file, copy the template in the file /usr/lib/python2.7/site-packages/clouddiscoveryservice/default_settings.py. The blueprint design server displays images, regions, and flavors based on the contents of this configuration file. You must provide the images, regions, and flavors for your clouds in the configuration file.
    Note: The flavor and region information in this configuration file must match the information in the /usr/lib/heat/ibm-cloud-ext/resources/ibm-cloud-discovery.conf file on the Heat engine. For example, if you are using vCenter, the flavors for that cloud are listed in the ibm-cloud-discovery.conf file. In this case, these flavors must match the flavors in the cloud discovery service configuration file. If the flavor and region information in the ibm-cloud-discovery.conf file does not match the information in the cloud discovery service file, then the images that the Heat engine provisions might not match the images that are displayed in the blueprint designer.
    The configuration file has separate sections for each cloud type. The format of each section differs, depending on the cloud type:
    • For EC2, you must register regions and images in the cloud discovery service file. See Registering Amazon EC2 images with the cloud discovery service.
      The following code is an example of the section for EC2. It includes three specific image IDs and five image name patterns that contain asterisks (*) as wildcards:
      "amazon": {
        "regions": [
          {
            "id": "us-east-1",
            "name": "US East (Northern Virginia)",
            "images": [
              "ami-abcd1234",
              "ami-1234abcd",
              "ami-5678abcd"
              "name:RHEL-*HVM*-20*-GP2",
              "name:suse-sles-12-sp*v20*hvm-ssd-x86_64*",
              "name:suse-sles-11-sp4*v20*hvm-ssd-x86_64*",
              "name:ubuntu/images/hvm-ssd/ubuntu-*-amd64-server-2016*",
              "name:Windows_Server-20*English-64Bit-Base-2016*"
            ]
          }
        ]
      },
    • For Azure, you must register images in the cloud discovery service file. See Registering Azure marketplace images with the cloud discovery service and Registering Azure custom images with the cloud discovery service.
      The following code is an example of the section for Microsoft Azure. It includes a private_images section with information about custom images and an images section with information about marketplace images:
      "azure": {
          "private_images": [{
                "resource_group": "myResourceGroup",
                "storage_account": "myStorageAccount",
                "container_list": ["container1","container2"]
      }],
          "images": [
              {
                  "publisher": "openlogic",
                  "sku": ["6.5","6.6","6.7","7.0","7.1","7.2"],
                  "offer": "CentOS",
                  "display_name" : "CentOS"
              },
              {
                  "publisher": "Canonical",
                  "sku": ["12.04.5-LTS","14.04.4-LTS","15.10"],
                  "offer": "UbuntuServer",
                  "display_name": "Ubuntu Server"
              },
              {
                  "publisher": "MicrosoftWindowsServer",
                  "sku": ["2012-R2-Datacenter","2008-R2-SP1"],
                  "offer": "WindowsServer",
                  "display_name": "Windows Server"
              }
          ]
      },
    • For vRealize Automation, you must register flavors in the cloud discovery service file. See Configuring VMware vRealize Automation image flavors. The following code is an example for vRealize Automation. This section lists six flavors:
      "vra": {
          "flavors": [
              {
                  "flavor": "default",
                  "memory": 0,
                  "disk": 0,
                  "vcpu": 0
              },
              {
                  "flavor": "m1.tiny",
                  "memory": 1024,
                  "disk": 20,
                  "vcpu": 1
              },
              {
                  "flavor": "m1.small",
                  "memory": 2048,
                  "disk": 20,
                  "vcpu": 2
              },
              {
                  "flavor": "m1.medium",
                  "memory": 4096,
                  "disk": 40,
                  "vcpu": 2
              },
              {
                  "flavor": "m1.large",
                  "memory": 8192,
                  "disk": 80,
                  "vcpu": 4
              },
              {
                  "flavor": "m1.xlarge",
                  "memory": 16384,
                  "disk": 100,
                  "vcpu": 8
              }
          ]
      }
    • For vCenter, you must register flavors in the cloud discovery service file. See Configuring VMware vCenter image flavors. The following code is an example for VMware vCenter. This section lists five flavors:
      "vcenter": {
          "flavors": [{
              "flavor": "m1.tiny",
              "memory": 512,
              "disk": 20,
              "vcpu": 1
          }, {
              "flavor": "m1.small",
              "memory": 2048,
              "disk": 20,
              "vcpu": 2
          }, {
              "flavor": "m1.medium",
              "memory": 4096,
              "disk": 40,
              "vcpu": 2
          }, {
              "flavor": "m1.large",
              "memory": 8192,
              "disk": 80,
              "vcpu": 4
          }, {
              "flavor": "m1.xlarge",
              "memory": 16384,
              "disk": 100,
              "vcpu": 8
          }]
      },
    • For SoftLayer, you must register flavors. See Configuring SoftLayer image flavors. The following code is an example of the section for SoftLayer. It includes five flavors:
      "softlayer": {
          "flavors": [{
              "flavor": "m1.tiny",
              "memory": 1024,
              "disk": 20,
              "vcpu": 1
          }, {
              "flavor": "m1.small",
              "memory": 2048,
              "disk": 20,
              "vcpu": 2
          }, {
              "flavor": "m1.medium",
              "memory": 4096,
              "disk": 40,
              "vcpu": 2
          }, {
              "flavor": "m1.large",
              "memory": 8192,
              "disk": 80,
              "vcpu": 4
          }, {
              "flavor": "m1.xlarge",
              "memory": 16384,
              "disk": 100,
              "vcpu": 8
          }]
      },
    • Also, at the bottom of the file, a section lists the default regions for the system. These regions are used only when you are connected to a cloud that does not have regions defined.
      regions: [
          {
              "id": "RegionOne",
              "name": "RegionOne"
          }]
  2. Set the system variable CLOUDDISCOVERYSERVICE_SETTINGS_FILE to the location of the cloud discovery service configuration file. The file can be in any location on the system that hosts the cloud discovery service.
  3. In versions 6.2.1.1 and later that are installed on Red Hat Enterprise Linux version 7, provide the location of the cloud discovery service configuration file to the systemd service. To do this, add the location of the file to the systemd service configuration file. In the Service section of the /usr/lib/systemd/system/ibm-cloud-discovery.service file, add an Environment parameter. This parameter must set the CLOUDDISCOVERYSERVICE_SETTINGS_FILE system variable to the location of the cloud discovery service configuration file. For example, if the cloud discovery service configuration file is named /home/ec2-user/cloud_discovery_customizations.conf, the systemd service configuration file resembles the following code:
    [Unit]
    Description=IBM Cloud Discovery Service
    After=syslog.target network.target
    
    [Service]
    Environment="CLOUDDISCOVERYSERVICE_SETTINGS_FILE=/home/ec2-user/cloud_discovery_customizations.conf"
    Type=simple
    Restart=on-failure
    RestartSec=0
    ExecStart=/usr/bin/python -m clouddiscoveryservice.runserver
    
    [Install]
    WantedBy=network-online.target 
  4. Restart the cloud discovery service. See Stopping the blueprint designer, cloud discovery service, and engine and Starting the blueprint designer, cloud discovery service, and engine.
  5. If you have other cloud discovery services, copy the file to them and configure the system variables in the same way. Then, restart each other cloud discovery service.

What to do next

Now you can use this file to register images for use with the blueprint design server. See the related information for each cloud type:

Feedback