How does openstack enable non-admin users to see the host where the virtual machine is located
The editor today shows you how openstack allows non-admin users to see the host where the virtual machine is located. The knowledge points in this article are described in great detail. Friends who feel helpful can browse the content of the article with the editor, hoping to help more friends who want to solve this problem find the answer to the problem. Let's follow the editor to learn more about "how openstack enables non-admin users to see the host where the virtual machine is located".
# modify the installation of horizon in / usr/share/openstack-dashboard under horizon ubuntu
# / usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/instances/tables.py [...] class InstancesTable (tables.DataTable): TASK_STATUS_CHOICES = ((None, True), ("none", True)) STATUS_CHOICES = (("active", True), ("shutoff", True), ("suspended", True), ("paused", True) ("error", False), ("rescue", True), ("shelved", True), ("shelved_offloaded", True), name= tables.Column ("name", link= "horizon:project:instances:detail", verbose_name=_ ("Instance Name")) host = tables.Column ("OS-EXT-SRV-ATTR:host") Verbose_name=_ ("Host") image_name = tables.Column ("image_name", verbose_name=_ ("Image Name")) [...]
Add a host line between name and image_name
Restart apache
Service apache2 restart
# configure nova-api to open / etc/nova/policy.json file
"compute_extension:extended_server_attributes": "rule:admin_api"
Find the above line and remove the rule:admin_api from it
Restart nova-api
Service nova-api restart
# verify that a non-admin user is logged in to horizon. Go to Project-> Compute- > instance to view. You can see that there is an extra column of host fields in the table. if the value in the host shows -, you need to make sure that the policy configuration at nova-api is correct.
# debug if the modified code does not take effect, try deleting the pyc file: find / usr/share/openstack-dashboard-name "* .pyc"-exec rm-rf {}\
Thank you for your reading. this is all about "how openstack makes non-admin users see the host where the virtual machine is located". Let's get started. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!