This chapter describes how to use the OpenStack CLI and dashboard. The chapter does not cover exam questions.
Using the OpenStack CLI
OpenStack comes with many client utilities. Most services have their own command-line interface (CLI) utility, which has the same name as the service itself. Some of these utilities will become obsolete because of the universal OpenStack CLI, which this book mainly uses.
Horizon’s Architecture
I assume that you have used Horizon, OpenStack’s dashboard, since Chapter 1. For first-time OpenStack users, it is probably easier than using CLI. However, you need to know that Horizon gives access to only about 70% to 80% of its overall functions. In certain situations, you are forced to use CLI. Figure 3-1 shows the login page for the OpenStack dashboard.
Horizon is a Python project that provides a complete dashboard and an extensible framework for building new dashboards. Horizon has the Django web framework as a dependency. The dashboard aims to support all core OpenStack projects. The minimum required set of running OpenStack services comprises Keystone, Nova, Neutron, and Glance. If the Keystone endpoint for a service is configured, Horizon detects it and enables support for optional services, such as Cinder, Swift, and Heat. Horizon can also work with services that are outside the scope of the Certified OpenStack Administrator exam and this book, such as Ceilometer, Sahara, and Trove.
OpenStack’s Horizon dashboard runs under a web server, commonly Apache or NGINX. For large-scale deployments, it is recommended that you configure a caching layer in front of Horizon; for example, the memcached daemon.
You need to use a web browser with JavaScript and HTML5 support while working with Horizon, which is primarily tested and supported on the latest versions of Firefox, Chrome, and Microsoft Edge.
You can enable SSL support for the dashboard with the packstack installation tool. You need to provide the CONFIG_HORIZON_SSL=y option in the answer file for that.
Verifying the Operation of the Dashboard
When you start to work with Horizon, you should put your server IP or name in the web browser address bar and connect to port 80 or 443 in case you have SSL-enabled deployment of your Horizon server. It can be a separate server or one of the control nodes.
The dashboard’s main configuration file is /etc/openstack-dashboard/local_settings. This configuration file has many options; however, the Keystone server URL is the most important.
OPENSTACK_KEYSTONE_URL = "http://192.168.122.10:5000/v3"
In some cases, it can be beneficial to increase this parameter. For example, if you plan to upload big virtual machine images via a slow connection.
This lists the IP addresses or FQDNs on which Horizon accepts connections. The default star symbol means all server IPs accept it.
Some vendors supply their own themes with the Horizon dashboard installation. If your installation has a standard look, you can delete additional packages with branded themes. For Ubuntu, use apt-get remove --auto-remove openstack-dashboard-ubuntu-theme. For the Red Hat OpenStack platform, use rpm -e openstack-dashboard-theme --nodeps.
The Horizon log file is situated in the /var/log/horizon/horizon.log file.
Creating and Managing RC Files to Authenticate with Keystone for Command-Line Use
While working in the command line, it is recommended to use run control (RC) environment files, one for each user and project combination, to set authentication parameters. You are provided an RC file if you installed OpenStack using one of the deployment tools like PackStack or DevStack.
RC File Main Configuration Options
Example of Config Options | Description |
---|---|
OS_AUTH_URL=http://192.168.122.10:5000/v3 | The Keystone service URL |
OS_REGION_NAME=RegionOne | The region name |
OS_USERNAME=admin | The username |
OS_PASSWORD=openstack | The password in clear text |
OS_PROJECT_NAME=admin | The project name |
OS_USER_DOMAIN_NAME=Default | The domain name |
OS_IDENTITY_API_VERSION=3 | The Keystone API version |
Summary
This chapter described how to use OpenStack’s CLI and dashboard, which are used in all the following chapters.
The next chapter explores identity management.
Review Questions
- 1.Which of the following is OpenStack dashboard’s main configuration file?
- A.
/var/www/html/openstack-dashboard/local_settings
- B.
/etc/openstack-dashboard/local_settings
- C.
/etc/horizon/horizon.conf
- D.
/etc/horizon/local_settings
- 2.How do you set up a half-hour session timeout?
- A.
TIMEOUT=30
- B.
SESSION_TIMEOUT=3600
- C.
SESSION_TIMEOUT=1800
- D.
TIMEOUT=300
Answers
- 1.
B
- 2.
C