Allow configure of OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES

If network calls to retrieve ports and floating IPs take too long,
then the project > instances page cannot be loaded. This config
allows disabling the network calls when loading the page with
minor side-effects, as a workaround to avoid downtime while other
performance optimizations can be done on the side to allow
the page the load so the workaround is no longer needed.

Closes-bug: #2051003
Related-bug: #2045168
Change-Id: Iedad6ef48cbe0b776594f4ad8276d3d713cd360c
(cherry picked from commit 6b93e9dd87)
(cherry picked from commit 45a86be78a)
(cherry picked from commit 1ec179bb9d)
(cherry picked from commit 9e2ae8e65b)
(cherry picked from commit b2af81e75d)
(cherry picked from commit 7eb985778c)
(cherry picked from commit 560adf4ac3)
(cherry picked from commit 5d4080d351)
This commit is contained in:
Rodrigo Barbieri 2024-01-23 12:24:58 -03:00 committed by Rodrigo Barbieri
parent 0ffd740318
commit 46895dab0d
4 changed files with 35 additions and 1 deletions

View File

@ -428,6 +428,18 @@ options:
Openstack mostly defaults to using public endpoints for internal
communication between services. If set to True this option will
configure services to use internal endpoints where possible.
retrieve-network-data-when-listing-instances:
type: boolean
default: True
description: |
By setting this option to False, it can be used as a workaround to improve performance and
avoid downtime when the Project > Instances page is timing out due to the neutron requests
to retrieve ports and floating IPs taking too long. The side effect is that actions such
as adding/removing floating IPs or interfaces no longer immediately update the network
data in instance list, requiring a manual reload of the page. The default value for this
config is True. For more information see
https://docs.openstack.org/horizon/latest/configuration/settings.html#openstack-instance-retrieve-ip-addresses
and LP#2045168.
wsgi-socket-rotation:
type: boolean
default: True

View File

@ -257,6 +257,8 @@ class HorizonContext(OSContextGenerator):
config('disable-instance-snapshot')),
'disable_password_reveal': config('disable-password-reveal'),
'enforce_password_check': config('enforce-password-check'),
'retrieve_network_data_when_listing_instances':
config('retrieve-network-data-when-listing-instances'),
}
return ctxt

View File

@ -15,7 +15,7 @@ from openstack_dashboard.settings import HORIZON_CONFIG
DEBUG = {{ debug }}
TEMPLATE_DEBUG = DEBUG
OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES = {{ retrieve_network_data_when_listing_instances }}
# WEBROOT is the location relative to Webserver root
# should end with a slash.

View File

@ -126,6 +126,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -161,6 +162,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -197,6 +199,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": True,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -233,6 +236,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": False,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -268,6 +272,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -303,6 +308,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -339,6 +345,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -378,6 +385,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -413,6 +421,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -423,6 +432,8 @@ class TestHorizonContexts(CharmTestCase):
self.test_config.set('neutron-network-firewall', True)
self.test_config.set('neutron-network-vpn', True)
self.test_config.set('cinder-backup', True)
self.test_config.set(
'retrieve-network-data-when-listing-instances', False)
self.assertEqual(horizon_contexts.HorizonContext()(),
{'compress_offline': True, 'debug': False,
'customization_module': '',
@ -453,6 +464,8 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": (
False),
}
)
@ -488,6 +501,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -523,6 +537,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -559,6 +574,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -595,6 +611,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -631,6 +648,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -667,6 +685,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)
@ -703,6 +722,7 @@ class TestHorizonContexts(CharmTestCase):
"disable_instance_snapshot": False,
"disable_password_reveal": False,
"enforce_password_check": True,
"retrieve_network_data_when_listing_instances": True,
}
)