IBM Cloud Orchestrator, Version 2.5.0.8

Installing the IBM Cloud Orchestrator extensions for Horizon

To support the IBM® Cloud Orchestrator functionality, you must extend the base OpenStack Horizon software to provide additional options in the OpenStack Dashboard.

Before you begin

Ensure that you copied the BYOOS_configure_ico_horizon_extensions.sh script from the IBM Cloud Orchestrator server, as described in Copying the IBM Cloud Orchestrator scripts to the OpenStack servers.

Depending on your installation and OpenStack distribution, you may need to adapt the script.

About this task

The IBM Cloud Orchestrator extensions for Horizon provide the following capability in the OpenStack Dashboard:
  • Support for availability zones on domains and projects
  • Support for quotas on domains
  • Creation of a default project when a domain is created
  • Ability to add domain administrators to the default project of a domain

In this procedure, the example scripts directory on the OpenStack Controller is /opt/ico_scripts. Replace this value with the appropriate value for your installation.

Complete the following steps on each OpenStack server where the Horizon service is installed.

Procedure

  1. Log on to the OpenStack Controller as a root user.
  2. Make sure that the unzip and msgfmt utilities are installed.
  3. Change directory to the directory where you store the IBM Cloud Orchestrator scripts:
    cd /opt/ico_scripts
  4. Set the environment to the correct OpenStack values. Most OpenStack distributions provide an RC file containing these values, for example /root/openrc or /root/keystonerc. Run the following command:
    source /root/openrc
    If an RC file is not provided by your OpenStack distribution, set the values manually, for example:
    export OS_USERNAME=admin
    export OS_PASSWORD=openstack1
    export OS_TENANT_NAME=admin
    export OS_AUTH_URL=http://192.0.2.68:5000/v2.0
    export OS_REGION_NAME=kvm-allinone2
    export OS_VOLUME_API_VERSION=2
  5. Review the BYOOS_configure_ico_horizon_extensions.sh script and adapt it to your installation if needed. Then run the following command:
    ./BYOOS_configure_ico_horizon_extensions.sh
  6. Make the following changes to the <path_to_Python_site_package>/openstack_auth/user.py file paying attention to the Python indentation:
    1. import urlparse
    2. Find the available_services_regions(self) method and add the following lines (in bold):
      @property
          def available_services_regions(self):
              """Returns list of unique region name values in service 	     
              catalog."""
              regions = []
              if self.service_catalog:
                  for service in self.service_catalog:
                      service_type = service.get('type')
                      if service_type is None or service_type == 'identity':
                          continue
                      for endpoint in service.get('endpoints', []):
                          # IBM ONLY ICO BEGIN
                          # ICO should also exclude PCG regions
                          # PCG regions have the region name as part of the URL
                          path = urlparse.urlparse(endpoint['url']).path
                          if endpoint['region'] in path:
                              continue
                          # IBM ONLY ICO END
                          region = utils.get_endpoint_region(endpoint)
                          if region not in regions:
                              regions.append(region)
              	return regions
    3. Add the following new method:
      # IBM ONLY ICO BEGIN
          @property
          def all_services_regions(self):
              """
              Returns list of unique region name values found in service catalog
              Method used to load availablity zones of all regions including PCG region
              """
              regions = []
              if self.service_catalog:
                  for service in self.service_catalog:
                      service_type = service.get('type')
                      if service_type is None or service_type == 'identity':
                          continue
                      for endpoint in service.get('endpoints', []):
                          region = utils.get_endpoint_region(endpoint)
                          if region not in regions:
                              regions.append(region)
              return regions
      
      	# IBM ONLY ICO END 
  7. In the <path_to_Python_site_package>/openstack_auth/utils.py file, add the following line (in bold), if the method exists, paying attention to the Python indentation:
    default_services_region(service_catalog, request=None): 
    available_regions = [get_endpoint_region(endpoint) for service
                            in service_catalog for endpoint
                            in service.get('endpoints', [])
                            if (service.get('type') is not None
                            and service.get('type') != 'identity'
                            and endpoint.get('region') not in urlparse.urlparse(endpoint['url']).path)] 
  8. Restart the Horizon service.

Results

When you log in to the OpenStack Dashboard, you can work with the IBM Cloud Orchestrator extensions.
Note: For VMware regions, the Reassign Instances functionality is not available in a generic OpenStack environment, even if the related button is displayed in the OpenStack Dashboard.