Commit Graph

1331 Commits

Author SHA1 Message Date
Rodrigo Barbieri da8e959298 Fix error on changing user password by admin
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
2024-03-14 15:58:43 -03:00
Tatiana Ovchinnikova 3acbf227a4 Add allocation ratios to Placement stats
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
2024-01-17 21:00:32 +00:00
Radomir Dopieralski ebdb19ab8c Use Placement API along with the hypervisor stats
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
2023-12-06 15:39:34 +00:00
Pedro Martins 1db1764749 Add NAT rules to the floating IP workflow
The floating IP workflow is now able to manage NAT
rules (portforwarding) if the floating IP is not
associated with any NICs (ports).

This patch is the one of a series of patches
to implement floating ip port forwarding with
port ranges.

The specification is defined in:
https://github.com/openstack/neutron-specs/blob/master/specs/wallaby/port-forwarding-port-ranges.rst

Implements: blueprint https://blueprints.launchpad.net/neutron/+spec/floatingips-portforwarding-ranges
Change-Id: Id715da6591124de45f41cc367bf39a6bfe190c9a
2023-03-01 10:38:16 -03:00
Heather Lemon c90c0b709c Fix instance table behavior after deleting an instance
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
2023-01-31 18:17:07 +00:00
Zuul 5307672367 Merge "Remove console_type parameter for server_mks_console function" 2023-01-25 15:28:16 +00:00
Takashi Kajinami 9fa98969e7 Use OPENSTACK_ENDPOINT_TYPE by default
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
2022-12-26 07:01:07 +09:00
Zuul 0add65eddc Merge "Add OPENSTACK_KEYSTONE_ENDPOINT_TYPE config opt" 2022-12-15 17:50:38 +00:00
Zuul 5fa4941310 Merge "Add the filter function in c-bak dashboard for both Project & Admin" 2022-12-14 17:35:23 +00:00
Alban Lecorps ee92961fe5 Remove console_type parameter for server_mks_console function
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
2022-11-02 11:03:20 +01:00
Zuul a4718409f5 Merge "Fix rescue of volume-based instances" 2022-10-25 21:21:34 +00:00
Rodrigo Barbieri 6eeaf98524 Fix app cred create without project_id for domain admins
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
2022-10-11 07:43:06 +00:00
Tobias Urdin b22a6d65f7 Add OPENSTACK_KEYSTONE_ENDPOINT_TYPE config opt
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
2022-09-29 13:23:59 +00:00
Zuul 34b2e82343 Merge "volume-backup add incremental flag" 2022-09-20 06:43:09 +00:00
Jan Hartkopf 05dd53a3cf Fix rescue of volume-based instances
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
2022-09-12 15:57:31 +02:00
Zuul 1a4d9e8025 Merge "Add cinder-user-facing messages for Backup" 2022-09-08 12:42:30 +00:00
Jesper Schmitz Mouridsen 20a571fdd2 Add cinder-user-facing messages for Backup
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
2022-09-06 07:29:40 +00:00
Jesper Schmitz Mouridsen 61df006f4a volume-backup add incremental flag
Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer>
Change-Id: Ia99d045eda9a138cb0466930ccedf865d7a6b54f
2022-09-02 08:56:39 +00:00
Andrey Kurilin 3a2e82ab75 Extend settings with OPENSTACK_SERVER_DEFAULT_USER_DATA
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
2022-09-01 19:23:00 +03:00
okozachenko 3020cf5e5c Add the filter function in c-bak dashboard for both Project & Admin
Change-Id: I09b0d12e489aad8da8e9ed3dee1b02a5abcb7355
2022-08-31 02:03:07 +10:00
Zuul 5de967fe2a Merge "Small cleanup of FIP code in api/neutron.py" 2022-07-06 19:09:21 +00:00
Tobias Urdin e4ac4550c9 Pass real client IP to keystoneauth original_ip
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
2022-04-21 12:19:30 +00:00
Akihiro Motoki 35a490f4ec Do not assume keystone admin endpoint
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
2022-03-25 20:06:49 +09:00
Zuul 1bb9092abf Merge "Address RemovedInDjango40Warning (7)" 2022-03-12 22:02:49 +00:00
Zuul 52a1025047 Merge "Address RemovedInDjango40Warning (4)" 2022-03-10 12:24:44 +00:00
Zuul cf9a30d39e Merge "Address RemovedInDjango40Warning (3)" 2022-03-10 12:23:11 +00:00
Zuul dd9e4c82b5 Merge "Address RemovedInDjango40Warning (2)" 2022-03-03 10:14:04 +00:00
Akihiro Motoki d26c50ea86 Small cleanup of FIP code in api/neutron.py
- 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
2022-02-25 16:21:07 +09:00
Zuul 3bc1458e60 Merge "Add Rules operation to Network QoS Policy" 2022-02-21 20:20:37 +00:00
zitptan aa83752f20 Add Rules operation to Network QoS Policy
Added create, edit, and delete rules operation to the
network qos policy.
Rules: Minimum-Bandwidth, DSCP-Marking, and
Bandwidth-Limit, Minimum-Packet-Rate

Partially-Implements: https://blueprints.launchpad.net/horizon/+spec/create-network-qos-policy

Change-Id: I49058036f1d78ef022d966f6b375cdc984755813
2022-02-17 13:40:39 +01:00
Rodrigo Barbieri 196de449b6 Implement pagination in admin/proj network tab
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
2022-02-16 18:15:48 -03:00
Akihiro Motoki 7052b7f065 Address RemovedInDjango40Warning (7)
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
2022-02-04 16:27:32 +09:00
Akihiro Motoki e4444e6979 Address RemovedInDjango40Warning (4)
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
2022-02-04 16:27:18 +09:00
Akihiro Motoki d9266fd82c Address RemovedInDjango40Warning (3)
In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path().

https://docs.djangoproject.com/en/4.0/releases/3.1/#id2

Change-Id: I484694f8718f61c022126a1935cf28fce075894b
2022-02-04 16:26:54 +09:00
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
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
2022-02-04 16:22:07 +09:00
Thomas Goirand e34e0ea73f fix ValueError: invalid content length with swift over UWSGI
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
2022-01-31 15:39:12 +01:00
Hang Yang c7ea66bc3e Support RBAC security groups in dashboard
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
2021-10-18 15:27:35 -05:00
Akihiro Motoki 6dfcb90131 Support Django 3.0 and 3.1 support (1)
* Django 3.0 dropped django.utils.decorators.available_attrs()
  in favor of functools.WRAPPER_ASSIGNMENTS.
* Django 3.0 dropped django.utils.functional.curry()
  in favor of functools.partial() or functools.partialmethod().

https://docs.djangoproject.com/en/3.1/releases/3.0/#removed-private-python-2-compatibility-apis

Change-Id: I4ab0e720a8ffe13a08f5e607a59e39f252338b90
2021-09-14 12:54:01 +00:00
Zuul 465d164919 Merge "Show image names at Admin-Instances dashboard" 2021-09-09 10:19:22 +00:00
Vadym Markov 4a2a1db145 Show image names at Admin-Instances dashboard
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
2021-08-11 18:12:09 +03:00
zitptan 1800750804 Add Create QoS operation to Network QoS Panel
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
2021-08-09 13:12:02 +00:00
Zuul a97253bda7 Merge "Fix Unable to use multiattach volume as boot for new server" 2021-07-28 16:14:49 +00:00
Brian Rosmaita b58ac2894b Drop cinder v2 API support
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
2021-07-19 08:00:58 -04:00
manchandavishal 64fe0abb65 Fix Unable to use multiattach volume as boot for new server
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
2021-06-30 22:48:56 +05:30
Mitya_Eremeev 3aaeadf895 Default role checker should be case-insensitive.
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
2021-05-21 21:03:09 +03:00
Tobias Urdin c87f0e7a90 Change with_data=False for swift_get_container
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
2021-04-07 16:26:37 +02:00
manchandavishal 1d39ac761f Add Volume backups support for admin panel
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
2021-03-05 00:15:08 +00:00
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
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
2021-02-12 13:05:27 -06:00
Zuul 491de164b6 Merge "Fix create/update_port with python3" 2020-11-25 15:58:23 +00:00
Akihiro Motoki a20a275ef5 Fix AttributeError in the project instance detail view
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
2020-11-20 20:57:28 +09:00