1) Basics of Dashboard
1. Concept
The OpenStack cloud computing platform can be used through command line management tools, or other applications can be called by other programs through application programming interfaces. But they are both cumbersome and not intuitive enough, so Dashboard came into being randomly. Its essence is a web front-end console, and its main function is to allow users to complete the configuration and management of the cloud computing platform through operations on the web page.
2. Organizational structure
Dashboard is a web application written in Python that supports the WSGI protocol and deployed on the Apache server. The OpenStack cloud computing platform and its core components also support the WSGI protocol. Therefore, Dashboard can be connected to the OpenStack cloud computing platform framework and other components through WSGI.
Dashboard is a web application that cannot run independently of the web server (it can be understood as a website). It runs in the httpd server like other components of OpenStack. After Dashboard is installed, its main website file path is "/usr/share/openstack-dashboard", which needs to be used after establishing a relationship with the httpd server.
3. Workflow
By accessing the Dashboard website service of the dashboard component, the user can call the API of each component through it, so as to achieve the purpose of managing each component of the OpenStack cloud computing platform.
The only thing Dashboard depends on is Keystone. If there is a problem with the Keystone service, Dashboard will not be able to log in to the system. When other component services have problems, it will not affect the Dashboard to manage other components, but the operations related to the problem component services cannot be executed.
a-test
After installing the Dashboard, follow the method below to view the log file directory of httpd. You can see that there are two log files about keystone in this directory: "openstack_dashboard-error.log" and "openstack_dashboard-access.log". They are recorded in The usage of keystone during Dashboard running.
ls /var/log/httpd
2) Project implementation
1. Install and configure Dashboard service
The following operations are performed on compute
a - Install the Dashboard package
yum -y install openstack-dashboard
b- Configure the Dashboard service
The configuration file of Dashboard is "/etc/openstack-dashboard/local_settings".
The first step is to open the configuration file
vi /etc/openstack-dashboard/local_settings
The second step is to configure the basic information of the web server
ALLOWED_HOSTS=['*']#允许从任意主机访问Web服务
OPENSTACK_HOST="controller"#指定控制节点的位置
TIME_ZONE="ASIA/Shanghai"#将当前时区指向“亚洲/上海”
The third step is to configure the cache service.
The following configuration can be changed on the original configuration code
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES={
'default':{
'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION':'controller:11211',
}
}
The fourth step is to enable support for multiple domains
and add a line of content
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT=True#允许使用多个域
The fifth step is to specify the version of the OpenStack component.
Add the following information, corresponding to the version numbers of the OpenStack authentication, image, and storage components
OPENSTACK_API_VERSIONS = {
"identity":3,
"image":2,
"volume":3,
}
The sixth step is to set the default domain to which the user created through Dashboard belongs.
Add a line of content
OPENSATCK_KEYSTONE_DEFAULT_DOMAIN = "default"
The seventh step is to set the default role of the user created through Dashboard to "user"
OPENSATCK_KEYSTONE_DEFAULT_ROLE = "user"
The eighth step is to set how to use the Neutron network.
In the configuration file, modify "OPENSTACK_NEUTRON_NETWORK" as follows
OPENSTACK_NEUTRON_NETWORK = {
'enable_auto_allocated_network': False,
'enable_distributed_router': False,
'enable_fip_topology_check': False,
'enable_ha_router': False,
'enable_ipv6': False,
# TODO(amotoki): Drop OPENSTACK_NEUTRON_NETWORK completely from here.
# enable_quotas has the different default value here.
'enable_quotas': False,
'enable_rbac_policy': False,
'enable_router': False,
'default_dns_nameservers': [],
'supported_provider_types': ['*'],
'segmentation_id_range': {
},
'extra_provider_types': {
},
'supported_vnic_types': ['*'],
'physical_networks': [],
}
2. Publish the Dashboard service
Dashboard is a web service, it must run on a web server like Apache, so we need to make some settings
a- Rebuild Dashboard's web application configuration file
Apache's default website main directory is "/var/www/html", and after Dashboard is installed, its website directory is "/usr/share/openstack-dashboard", so a configuration file is needed to let Apace find the correct website directory.
The following operations are performed under compute
. The first step is to enter the Dashboard website directory
cd /usr/share/openstack-dashboard
The second step is to compile and generate the Web service configuration file of Dashboard
python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
If you look at the generated configuration file, you can see the various parameters required to run Dashboard.
cat /etc/httpd/conf.d/openstack-dashboard.conf
Among them, "DocumentRoot" represents the main directory of the website, and you can see that the main directory of the website has pointed to the website directory of Dashboard.
b- Establish a soft connection to the policy file
There are some policy files built in "/etc/openstack-dashboard", which are the default policies when Dashboard interacts with other components.
Use the following methods to view the policy files in this directory
ls /etc/openstack-dashboard
In order for these policy files to take effect, they need to be placed in the Dashboard project, and these policy files are put into the project in the form of soft links below.
ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/ openstack_dashboard/conf
View Dashboard's website directory
ll /usr/share/openstack-dashboard/openstack_dashboard/
You can see that there is a directory conf under "/usr/share/openstack-dashboard/openstack_dashboard/", which is mapped from "/etc/openstack-dashboard".
c-Start the Apace server to make the configuration take effect
The first step is to set the httpd service to start at boot
systemctl enable httpd
The second step is to start the httpd service
systemctl start httpd
3) Project detection
1. Log in to the system
Enter in the browser of the local host or the Firefox browser in the virtual machine
http://192.168.10.20
Try to see if you can see the correct interface.
The default domain name is Default, the user name is admin, and the password is 000000. Of course, these are all settings we have made before, and can be rewritten according to your actual situation. You can log in after entering the correct one
2. View the mirror image
On the left menu of the overview interface, select Calculation -> Mirror option to enter the images interface.
The cirros image here is the last uploaded image in the previous glance component. Readers can view it.
So far, the Dashboard of this chapter is over.