Previous change I8438bedaf7cead452fc499e484d23690b48894d9
attempted to address bug LP#1728031 by improving upon
patch https://review.opendev.org/854005 but missed the
line that allows the keystone client to properly
authenticate a cloud admin user that IS NOT in the
default domain.
Without this 1-line fix, a cloud admin that is not
in the default domain will face an "incorrect admin
password" error in the UI (despite the admin password
being correct) and an authentication error in the logs,
regardless of the endpoint type used (adminURL,
internalURL or publicURL).
Closes-bug: #1728031
Change-Id: I018e7d9cb84fd6ce8635c9054e15052ded7e9368
All the Placement API stats "total" show the actual amount of the
resource that the provider can accommodate. Using allocation ratio
it is possible to exceed physical constraints.
This patch uses allocation ratios to display the diagrams properly
and adds the data to the stats table.
Closes-Bug: #1974470
Closes-Bug: #1397917
Change-Id: Iab0ce21ae63f4cc26d3ec5684615189b8ab35231
Hypervisor stats do not reflect accurate VCPUs and PCPUs usage, so
to have a correct picture we need to use Placement API along with
hypervisors.
We add VCPUs and PCPUs usage diagrams and Resource Provider tab
to display correct stats.
Since there is no python client for the Placement API, and the
OpenStack SDK doesn't support the endpoints we need, we call the
endpoints directly.
Related-Bug: #1974470
Related-Bug: #1397917
Change-Id: If41cea0edeec8c95717229eb017e32898417a891
After deleting a VM from the instances table,
all VMs above it in the table list disappear from the
UI until the page is refreshed.
Partial-Bug: #1859851
Change-Id: Icae04fd0f0c3f3fa5127309b64fc1b15e3bbc677
This is follow-up of I8438bedaf7cead452fc499e484d23690b48894d9 and
ensures the OPENSTACK_ENDPOINT_TYPE parameter is used when
OPENSTACK_KEYSTONE_ENDPOINT_TYPE is not set. This avoids backward-
incompatible change which affects deployments with endpoint type set
to non-default values.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I94d2d3e31fc0103773fb5d3ed2f5f792e8851f78
The "get_mks_console" use "console_type" as param, but causes an issue on Nova.
In horizon logs we have "Recoverable error: No available console found." and in the dashboard we have "Unable to load console. Please reload page to try again." when we load the console.
There is no need to call the function with this parameter, as it's already defined automatically since microversion 2.53.
Change-Id: I776b19f053ca74c699ca069e04553740f1e83b3e
Users with domain admin role that are not cloud admins are
not able to get scoped context and create an application
credential with project_id, so this change forces the
scoped context in that particular case.
Closes-bug: #1827120
Change-Id: I076a97a6f943ab74a2db8bc5179a7db194009db4
The [1] changed the previous behavior of Horizon by
changing the hardcoded internal endpoint type to using
OPENSTACK_ENDPOINT_TYPE so it's no longer possible to use
internal endpoint type for Keystone but public for others.
This adds the OPENSTACK_KEYSTONE_ENDPOINT_TYPE config opt
to set the endpoint type for Keystone when grabbing it from
the service catalog.
[1] https://review.opendev.org/c/openstack/horizon/+/730781
Change-Id: I8438bedaf7cead452fc499e484d23690b48894d9
Rescue of volume-based instances is supported since Nova
microversion 2.87.
However, Horizon does not use this microversion when requesting
rescue of any instances, causing a Nova exception for volume-
based ones.
The patch fixes this by explicitly setting the required
microversion.
Closes-Bug: #1941744
Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
Change-Id: Ic0cdfd326475882f839fd218cd7b4bfa62a2a76b
This patch adds a tab for cinder user messages for volume backups.
Cinder user messages show error details for cinder resources like if we
are unable to create a volume backup due to some failure in cinder it
will show us the reason for failure.
It also updates project and admin SnapshotDetailsTabs to use
DetailTabsGroup instead of TabGroup to improve top padding.
Also adds the fail_reason in the detail view, if backup errored.
Related-Bug https://bugs.launchpad.net/cinder/+bug/1978729
Change-Id: I4e639211043270e814fac489f915588af03f966a
The new setting should allow an administrator to specify default user_data
for new VMs. The default user_data can be a string template that accepts
request object which has info about the user, so the default user_data can
be personalized.
Change-Id: I86ac21bf82c1667135abd4f20fb4514da0899450
The original_ip parameter for the keystoneauth plugin
sets the Forwarded header sent to Keystone but right now
it just sends the IP address of Horizon instead of the client's
IP when Horizon is proxied and should use X-Forwarded-For.
Change-Id: Ic994b7f36d4c6459bbd00c810e3b454c6b1201a6
keystone does not distinguish public and admin endpoints since
Train [1], so there is no need to use a separate endpoint for
keystone admin operations. admin endpoint still can be configured
but there is no functional difference anymore from other endpoints.
We do not need to require admin endpoint and can use an endpoint
specified by OPENSTACK_ENDPOINT_TYPE for all API operations.
This commit reverts commit f9bab3fe19
as we no longer need the workaround.
[1] https://review.opendev.org/c/openstack/keystone/+/664246
Closes-Bug: #1950659
Change-Id: I2660fd2df8081e1d2d9c84626037f94bd9d137a5
- FloatingIpManager.get_target_by_instance was dropped in [1],
but it remains in a docstring.
- "label" argument of FloatingIpTarget.__init__ can be None [2]
and it is an expected behavior in the initial design.
From the maintenance perspective, it would clarifies the meaning
if it is marked as optional.
[1] commit cd9a14d293
[2] a05b326e42/openstack_dashboard/api/neutron.py (L740)
Change-Id: I813041a60d211164cdc3fa17e2b0e768d1ffd080
Added pagination support to the networks page under
Project and Admin Dashboard.
To accomplish so, the method network_list_for_tenant
in api/neutron.py that is used for listing networks under
the Project Dashboard was refactored to merge the different
requests for shared, non-shared and external networks while
tracking the pagination for each of those requests, so for
instance when all the shared networks are listed and paginated
then the non-shared networks are queried and so on.
For the Admin dashboard all network types are retrieved under
a single request so it is a simpler pagination logic.
Partial-Bug: #1746184
Change-Id: I96a2d6cabed47c89bdc02ec922d7f9451e5ec025
HttpRequest.is_ajax() was marked as deprecated since Django 3.1 and will be
removed in Django 4.0 [1].
While the current implementation of is_ajax() relies on a jQuery-specific way
of signifying AJAX as noted in the Django relnotes, horizon works with this.
Thus this commit copies the existing logic of HttpRequest.is_ajax() to the
horizon repo (as horizon.utils.http.is_ajax()) and consumes it.
https: //docs.djangoproject.com/en/4.0/releases/3.1/#features-deprecated-in-3-1
Change-Id: I3def53033524985818a891a1b9d4659fad4ba2ba
In Django 3.0, django.utils.http.urlquote(), urlquote_plus(),
urlunquote(), and urlunquote_plus() are deprecated in favor of
the functions that they’re aliases for: urllib.parse.quote(),
quote_plus(), unquote(), and unquote_plus().
https: //docs.djangoproject.com/en/4.0/releases/3.0/
Change-Id: I37fcd917cbf87b4d3141cfbdd2675aa38f33f2a4
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().
https://docs.djangoproject.com/en/4.0/releases/3.0/#id3
Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
We're using Swift over UWSGI, with the correct UWSGI parameters. That is:
plugins = python3,transformation_chunked
http-auto-chunked = true
http-chunked-input = true
http-raw-body = true
route = .* addheader:Date: ${httptime[]}
route-run = chunked:
wsgi-manage-chunked-input = true
In this mode, the Content-Length: header may not be present, and
instead, swift provides a Transfer-Encoding: chunked. This isn't what
Horizon expects, and this leads to Django crashing with a Content-Length
set to None.
This very simple patch skips populating Content-Length if the swift
object has its obj.bytes set to None.
Change-Id: I602709b8eaf2368dbdb1a9ce6ed84b031c5b0b4d
Get the RBAC shared security groups in the dashboard by making
an additional Neutron API call to filter by the shared field. Currently,
the dashboard only shows SGs owned by the tenant.
Depends-On: https://review.opendev.org/c/openstack/neutron/+/811242
Closes-Bug: #1907843
Change-Id: Ifa1acb3f0f6a33d0b4dc3761674e561a8d24c5c2
Admin-Compute-Instances dashboard shows "-" as image name for every
instance. Despite, Project-Compute-Instances dashboard displays image
name correctly. Admin dashboard just lacks code to resolve image name
Also, reverted commit deb55b8 which functionality is not needed anymore
Closes-Bug: #1932341
Change-Id: Ieb19e66dc51165d9935424b2e9ab5cdae757b07f
Enabled Network QoS panel and added a button for
creating a new network qos policy with parameters
name(string), description(maxlen-255), and
shared(checkbox)
Partially-Implements: https://blueprints.launchpad.net/horizon/+spec/create-network-qos-policy
Change-Id: Ifabfac7553ddbb65fe387187da5dd2fafad31351
Cinder v2 API is deprecated since pike release. Along with the removal
of cinder v2 API support in cinderclient (change I335db5c1799e drops
v2 support), this commit drops cinder v2 support in horizon.
The next release of python-cinderclient drops v2 support,
so horizon needs to use v3 classes.
Includes a workaround in unit tests for two cinderclient.v3 classes
that are missing in the cinderclient releases prior to 8.0.0. The
workaround can be removed once cinderclient change I335db5c1799edb2
is merged and released.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Iab0f097fab6696462572dc6ea53767c91e5411b1
If we try to create a new server from a bootable volume that
supports multiattach, it will fail to create with an error
message that ``multiattach volumes are only supported starting
with compute API version 2.60``. This patch fixes the issue.
Closes-Bug: #1931440
Change-Id: Ic8330b947b1a733f70c3bdad8b3493f20a2f26fb
Keystone role names are case-insensistive and
Horizon should handle role names in a case-insensitive manner.
For example, when keystone bootstraps default roles,
it creates “admin”, “member”, and “reader”.
If another role, “Member” (note the upper case ‘M’) is created,
keystone will return a 409 Conflict since it considers the name “Member” equivalent to “member”.
Note that case is preserved in this event.
https://docs.openstack.org/keystone/latest/admin/case-insensitive.html#roles
Also whatever is written in defaults can be overridden in settings by the operator -
especially these days when actually the default should be 'member'
(one of the default roles created by Keystone during the bootstrap),
not _member_ which is there for legacy reasons I presume.
Change-Id: Ibfb80a47a8aaed8f33e4e1dcfb428e70c829f0dd
This function is only used in the Container get
method which retrieves details about a container.
It's not used for listing data in the container
even though with_data was True doing a GET instead
of a HEAD on the container.
This indirectly also fixes the Ceph bug [1] in the
Swift API implementation that doesn't expose metadata
correctly for a GET but does for a HEAD.
[1] https://tracker.ceph.com/issues/47861
Change-Id: Iba4215b2e3a414d1794faa05be31bf69e0e48bec
This commit allows admin to list/show cinder volume backups
using horizon dashboard and the user can perform the
following table action :
1. backup-restore
2. backup-delete
3. update backup-state
4. backup force-delete
Implements https://blueprints.launchpad.net/horizon/+spec/add-volume-backups-support-for-admin-panel
Change-Id: I2fea140a972eb4bd4f18ad1c83cfa4df58c23f6c
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
The previous code does not handle a case where admin-specific attributes
do not exist. This leads to AttributeError in the project instance detail
page as these attributes are not included in the response from nova API.
Change-Id: I4c2942960259782d47c6777394dec6888959e26c
Closes-Bug: #1905024