How to customize OpenStack Horizon Dashboard

Updated on September 8, 2023

Customize OpenStack Horizon Dashboard allows you to tailor the interface to your specific needs and preferences such as its appearance, including logos, colors, and styles, to match the organization’s branding. Let’s dive into start rebrand OpenStack Horizon dashboard.

OpenStack Horizon Dashboard

OpenStack Horizon is a web-based user interface (GUI) for managing various aspects of OpenStack Cloud infrastructure, including VMs, Networking, Storage and more. It is implemented using the Django web framework developed in Python.

How to customize OpenStack Horizon Dashboard?

Following guide will help to customize the OpenStack Horizon Dashboard elements:

  • Logo
  • Site Colors
  • Site Title
  • Site branding link
  • Help URL
  • Additional Stylesheets

Current theme uses 2 logos:

  • On the login page (logo-splash.svg )
  • After the login (logo.svg – 200pxx27px)

Step 1: Create a 2-graphical logos with a transparent background (png or svg), a favicon.ico of your logo, and place it in the folder /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/

Step 2: Create a custom.css file under /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css/and the below contents

/*
* * New theme colors for dashboard that override the defaults:
* *
* * By Techglimpse.com <techglimpse.newsletter@gmail.com>
* */
h1.brand {
background: #355796 repeat-x top left;
border-bottom: 2px solid #BAD3E1;
}
h1.brand a {
background: url(../img/CUSTOMLOGOAFTER) top left no-repeat;
}
Add more css

You can add css code that overrides the default elements.

OpenStack Logo after login

Step 3: Add the below code in /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html

<link href='{{ STATIC_URL }}dashboard/css/custom.css' media='screen' rel='stylesheet' />

Step 4: Edit the shortcut icon line to the below in /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html

<link rel="shortcut icon" href='{{ STATIC_URL }}dashboard/img/CUSTOMFAVICO' />

Step 5: Open the file /usr/share/openstack-dashboard/openstack_dashboard/templates/auth/_splash.htmland edit the logo name

<img class="splash-logo" src={% themable_asset "img/CUSTOMLOGOBEFORE" %}>
Rename the image file names

Do not forget to rename the image file name at CUSTOMLOGOAFTER, CUSTOMLOGOBEFORE and CUSTOMFAVICO

Openstack login page

How to change the Site Title?

Change the default Site Title ‘Openstack Dashboard’ by adding the following line to /etc/openstack-dashboard/local_settings 

SITE_BRANDING = "Techglimpse Cloud"

How to change help url?

By default, the help URL points to https://docs.openstack.org. However, if you need to point to your own help page, add the below following attribute in the file /etc/openstack-dashboard/local_settings

HORIZON_CONFIG["help_url"] = "http://techglimpse.com"

OpenStack custom help link

Restart Apache Webserver

You need to restart apache to take the effect of above changes

# systemctl restart httpd

Reload the dashboard page in the browser and fine tune your CSS such as color schemes, positions, width, height, padding, logo size etc.,

Enabling OpenStack Dashboard for single domain support

OpenStack supports multi-domain support and the clouds that use domain-specific Identity configuration, a user must provide their domain name, username, and password in order to log into horizon. A user must be aware of their domain’s name and enter it into a text box at login. This is sensible on public clouds, because supplying potential domains to an unauthenticated user exposes too much information about other customers and makes potential attacks easier. On private clouds, however, it is a hinderance to usability.

Below procedure helps to remove the domain for a private cloud that uses single domain.

Step 1: On the controller node, Add the below content to the file /etc/openstack-dashboard/local_settings 

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'default'

Step 2: Restart Apache Webserver

You need to restart apache to take the effect of above changes

# systemctl restart httpd

OpenStack single domain

Enabling OpenStack Dashboard for multi-domain support with dropdown menu

Do Not enable dropdown menu for domains on public clouds

It is strongly advised NOT to enable this for public clouds, as advertising enabled domains to unauthenticated users irresponsibly exposes private information.

Step 1: On the controller node, Add the below content to the file /etc/openstack-dashboard/local_settings 

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'default'
OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN = True
OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
  ('Default', 'Default'),
)

Step 2: Restart Apache Webserver

You need to restart apache to take the effect of above changes

# systemctl restart httpd

OpenStack multi domain

Was this article helpful?

Related Articles

Leave a Comment