Installation and configuration¶
Installation¶
Important
First need to do setting up the environment. All commands are executed only from superuser.
Mode superuser:
sudo -i
Important
Installation is performed on control node.
Save the list of previously installed packages before starting the installation, this will allow to painlessly restore the system in case of damage. Run the following commands to do this:
mkdir -p /tmp/rollback/dashboard pip3 freeze > /tmp/rollback/dashboard/pip_before.txt
After that, the directory
/tmp/rollback/dashboard
will contain the filepip_before.txt
with a list of installed applications.Also save migration versions:
python3 /usr/share/openstack-dashboard/manage.py showmigrations > /tmp/rollback/dashboard/migrations.txt
Where:
/tmp/rollback/dashboard/
is a file directory;migrations.txt
is a name of the file with migration versions.
OpenStack Horizon package installation:
apt-get install openstack-dashboard
Dashboard package installation:
from Python package repository:
pip3 install dashboard
Save the list of installed packages after installation to be able to roll back changes:
pip3 freeze > /tmp/rollback/dashboard/pip_after.txt
Note
To install Dashboard and Dashboard Theme on Astra Linux (Smolensk) do following:
Connect the provided repository with AccentOs packages.
Install the package with the command:
sudo apt install -y aos-dashboard sudo apt install -y aos-dashboard-theme
Installation on two or more controllers¶
It is need when installing Dashboard on two or more controllers:
- to replicate database for each of controllers;
- to install module with the same parameters for each of controllers.
Note
Deleting and diagnostics of the module on each controller is performed in the same way as in the case of one controller.
Configuration¶
It is need to configure the Dashboard module for correct operation.
Perform the initial configuration of the module:
openstack aos configure -n dashboard
Check for the presence of a configuration file named
local_settings
orlocal_settings.py
in the directory/etc/openstack-dashboard/
, if it is missing, copy the settings from the sample (local_settings.py.example
) and add the Dashboard settings import to it:try: from dashboard.django_settings import * except ImportError: pass
Copy the sample configuration file, if using non-standard parameters, edit them (for details see Configuration file):
cp /etc/aos/dashboard.conf.example /etc/aos/dashboard.conf
Run the command to collect static files:
python3 /usr/share/openstack-dashboard/manage.py collectstatic
Create database using MySQL as an example, configure rights, database type and other parameters:
# Login to the database using the root password mysql -uroot -p # Create dashboard database CREATE DATABASE dashboard; # Give permission to read, edit, perform any actions on all tables in dashboard database GRANT ALL PRIVILEGES ON dashboard.* TO 'aos'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON dashboard.* TO 'aos'@'%' IDENTIFIED BY 'password'; # Exit the database
Edit section
[database]
of the configuration fileetc/aos/dashboard.conf
, for example:[database] url = mysql+pymysql://aos:password@tst.stand.loc:3306/dashboard?charset=utf8
Migrate database:
openstack aos db migrate -n dashboard
Restart the web server and caching service:
# Debian: systemctl restart apache2 systemctl restart memcached
Connecting Dashboard Module Theme¶
Note
Theme is an additional option and is optional for the normal operation of the module.
Connecting standard Dashboard Theme:¶
Install the theme package:
from Python package repository:
pip3 install dashboard_theme
Check for the presence of a configuration file named
local_settings
in the directory/etc/openstack-dashboard/
п, if it is missing, copy the settings from the sample (local_settings.py.example
)If the Dashboard module is not installed connect the theme in the configuration file
local_settings.py
:try: from dashboard_theme import * except ImportError: pass
Run the command to collect static files:
python3 /usr/share/openstack-dashboard/manage.py collectstatic
If
local_settings.py
contains the flagtrue
for the line:COMPRESS_OFFLINE = True
run the command:
python3 /usr/share/openstack-dashboard/manage.py compress
Restart the web server and caching service:
# Debian: systemctl restart apache2 systemctl restart memcached
Connecting AccentOS® Ocean theme:¶
Note
Dashboard Ocean theme for Astra Linux 1.7 is supported since version 1.14.0.
In addition to the standard AccentOS® theme, you can install the AccentOS® Ocean theme if required. To do this, follow these steps:
Install the AccentOS® Ocean theme package:
pip3 install dashboard_ocean
Check for the presence of a configuration file named
local_settings
in the directory/etc/openstack-dashboard/
п, if it is missing, copy the settings from the sample (local_settings.py.example
)If the Dashboard module is not installed connect the theme in the configuration file
local_settings.py
:try: from dashboard_ocean import * except ImportError: pass
Run the command to collect static files:
python3 /usr/share/openstack-dashboard/manage.py collectstatic
If
local_settings.py
contains the flagtrue
for the line:COMPRESS_OFFLINE = True
run the command:
python3 /usr/share/openstack-dashboard/manage.py compress
Restart the web server and caching service:
# Debian: systemctl restart apache2 systemctl restart memcached
Note
If you install both themes (AccentOS® and AccentOS® Ocean) without installing the Dashboard module, then import of both themes must be added to the local_settings.py file.
Configuration file¶
Note
Config file allows to override sections and parameters of common file aos.conf
for specific module.
Note
There are no lines with the level logging by default in the file dashboard.conf.example
, it is specified if necessary. Level logging is set by default in the general configuration file. More information about the configuration files can be found in the corresponding section.
Configuration file is presented in ini
format and consists of the following sections and parameters:
Section | Parameter | Description | Default value |
---|---|---|---|
DEFAULT | enable_cinder_backups | Flag responsible for displaying the «Volume Backups» tabs and actions for creating volume backups. | True |
DEFAULT | enable_clouds | «Public clouds» tab activation. | False |
DEFAULT | enable_numa_topology | «NUMA Topology» tab activation. | False |
DEFAULT | enable_qos | QoS Network Policies tab activation. | False |
DEFAULT | enable_tkcontrol | «TKControl» tab activation. | True |
DEFAULT | min_reserve_vm | Default value for the minimum number of reserved virtual machines when creating a TRS project. | 1 |
DEFAULT | otp_sender_method | Method of sending OTP to user. | telegram |
DEFAULT | selectable_themes | List of available themes to choose from. | default, accentos, accentos_ocean |
DEFAULT | tkcontrol_host | TKControl host address. | |
DEFAULT | tkcontrol_password | User password for authorization in TKControl. | admin |
DEFAULT | tkcontrol_user | Username for authorization in TKControl. | admin |
database | url | Database connection settings. | mysql+pymysql:/ /aos:password@l ocalhost:3306/d ashboard?charse t=utf8 |
Important
It is need to perform the procedure described in the section «Updating config file» when changing the parameters of the configuration file to take effect.
Recovery plan¶
Roll back if the Dashboard plug-in installation or update fails:
Compare versions of migrations in file
/tmp/rollback/dashboard/migrations.txt
with current. If there are any differences, migrate to the previous version for each of the applications. Migration example:python3 /usr/share/openstack-dashboard/manage.py showmigrations openstack aos db migrate -n dashboard --migration "frame 0001_initial" openstack aos db migrate -n dashboard --migration "sessions 0001_initial"
Revert to the previous state of the packages:
cd /tmp/rollback/dashboard diff --changed-group-format='%>' --unchanged-group-format='' pip_before.txt pip_after.txt > pip_uninstall.txt diff --changed-group-format='%<' --unchanged-group-format='' pip_before.txt pip_after.txt > pip_install.txt pip3 uninstall -r pip_uninstall.txt pip3 install -r pip_install.txt