Commit Graph

9333 Commits

Author SHA1 Message Date
Zuul 818f0cd4a3 Merge "Remove nova.wsgi module" 2024-03-19 19:42:00 +00:00
Sylvain Bauza 6f199b6b0c doc: mark the maximum microversion for 2024.1 Caracal
We need it for this release.

Change-Id: I17fbd9523067b0c19982499e66c314d47e9ee4bb
2024-03-12 19:06:08 +01:00
Zuul 39de10777b Merge "Add support for showing requested az in output" 2024-03-01 20:39:00 +00:00
Rajesh Tailor c98c8d84ee Add support for showing requested az in output
As of now, the server show and server list --long output
shows the availability zone, that is, the AZ to which the
host of the instance belongs. There is no way to tell from
this information if the instance create request included an
AZ or not.

This change adds a new api microversion to add support for
including availability zone requested during instance create
in server show and server list --long responses.

Change-Id: If4cf09c1006a3f56d243b9c00712bb24d2a796d3
2024-03-01 21:39:04 +05:30
Ghanshyam Mann 3b4db6408e HyperV: Remove extra specs of HyperV driver
There are a few extra spec which are only applicable for HyperV driver,
therefore those are removed.

Change-Id: I9bd959fdf9938b2752c4927c5ff7daf89b5f0d38
2024-02-13 20:25:22 +00:00
Ghanshyam Mann 0c1e1ccf03 HyperV: Remove RDP console API
RDP console was only for HyperV driver so removing the
API. As API url stay same (because same used for other
console types API), RDP console API will return 400.

Cleaning up the related config options as well as moving its
API ref to obsolete seciton.

Keeping RPC method to avoid error when old controller is used
with new compute. It can be removed in next RPC version bump.

Change-Id: I8f5755009da4af0d12bda096d7a8e85fd41e1a8c
2024-02-13 12:24:38 -08:00
Ghanshyam Mann 3e47439a68 HyperV: Remove RDP console connection information API
The RDP console was only available for HyperV driver, therefore its
connection information via API ``os-console-auth-tokens`` will now return
HTTP ``400 (BadRequest)`` error.

Starting from 2.31 microversion, this API return connection info
for all other console type.

Change-Id: I94e590eb4cbe3b2d8eff7fe881f7b98af8979be2
2024-02-13 19:28:07 +00:00
Zuul d5726a81b8 Merge "Remove deprecated [api] use_forwarded_for" 2023-12-20 03:47:46 +00:00
Zuul d28a55959e Merge "Fixed an error when caching multiple images in aggregate" 2023-12-19 08:18:06 +00:00
Sean Mooney f4852f4c81 [codespell] fix final typos and enable ci
This chnage adds the pre-commit config and
tox targets to run codespell both indepenetly
and via the pep8 target.

This change correct all the final typos in the
codebase as detected by codespell.

Change-Id: Ic4fb5b3a5559bc3c43aca0a39edc0885da58eaa2
2023-12-15 12:32:42 +00:00
Takashi Kajinami a5f68d355c Remove deprecated [api] use_forwarded_for
This option was deprecated in favor of the HTTPProxyToWSGI middleware
in 26.0.0 release[1].

[1] cf906cdcc2

Related-Bug: #1967686
Change-Id: Iad8880127531dc2788d646f8a05b5c17fd9d0969
2023-12-14 14:41:00 +09:00
Zuul 8644855533 Merge "Use SDK for deprecated baremetal proxy API" 2023-12-14 00:07:25 +00:00
Zuul c7dba52e4e Merge "[codespell] start fixing all the typos" 2023-12-11 09:06:40 +00:00
Stephen Finucane 4e182a664e Remove nova.wsgi module
We want this module for use elsewhere. Given there's only a single
caller (nova.service) we can simply move the code to the caller.

Change-Id: I2c3887db8b3f6833bf24f5114fd955e1af590d03
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-06 09:50:58 +00:00
Stephen Finucane 259b646afa Use SDK for deprecated baremetal proxy API
We had indicated that we would never switch this over to SDK, however,
this is the sole remaining user of ironicclient which means users would
continue needing to install that just for this little API. Better to
switch this holdout over and finally delete all the things.

Change-Id: I880523935d73ca94c83e618f10c2e587362c53be
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-12-05 12:09:36 +00:00
Danylo Vodopianov eb8519d811 Packed virtqueue support was added.
1) Extend flavor/image extra spec.
2) New xml parameter for qemu command was added.
3) New request filter added for scheduler.
4) Unit and Functional tests were updated
5) Requirments was updated ( os-traits = 3.0.0 )
6) Releasnote was added

Nova spec: https://review.opendev.org/c/openstack/nova-specs/+/868377

Depends-On: https://review.opendev.org/c/openstack/os-traits/+/876069
Change-Id: I789eeae86947e9a3cbd7d5fcc58d2aabe3b8b84c
2023-11-29 16:06:33 +02:00
Sean Mooney 7402822f0b [codespell] start fixing all the typos
this is the inital patch of applying codespell to nova.
codespell is a programing focused spellchecker that
looks for common typos and corrects them.

i am breaking this into multiple commits to make it simpler
to read and will automate the execution of codespell
at the end of the series.

Change-Id: If24a6c0a890f713545faa2d44b069c352655274e
2023-10-03 00:51:35 +01:00
Zuul 11843f249c Merge "Fix pep8 errors with new hacking" 2023-09-22 17:34:40 +00:00
liwenjian aa500fbb31 Fixed an error when caching multiple images in aggregate
Because in the process of judging whether the image id is Duplicate,there is only deduplication without sorting, so no duplicate image error is judged as duplicate and an error "Duplicate images in request" is reported.

Now it is changed to sort after deduplication and then compare.

Two unit test cases were added to verify the fix

Related-Bug: #2034702
Change-Id: I300a3e29ba56584f4c99d534a6cf8ee7dc0ed4b7
2023-09-08 17:28:38 +08:00
Sylvain Bauza 515d9cbfa4 doc: mark the maximum microversion for 2023.2 Bobcat
We need it for this release.

Change-Id: Ic9aee508a72489ad0cc1948d1ccafad0bd09fb14
2023-09-05 16:20:13 +02:00
Dan Smith 8d0a0ec88e Avoid lazy-loads in resize
Change-Id: Ib8f8bb596fa58dde40c1a0b359435ef0a48f15b2
2023-08-21 08:53:19 -07:00
Dan Smith 9ae9d77b03 Remove a lazy load on every server show
Right now our server show operation ends up lazy-loading the fault
and service fields from the instance instead of querying them with
the instance itself. Fault generates a failure during query if we
don't have one (which we should fix) but at least we can avoid the
services load.

Change-Id: Ib551a778438e079e19e53510cabcfa4a57202ce3
2023-08-21 08:53:19 -07:00
Dan Smith 5ebf1fa206 Avoid lazy-loading in resize and rebuild/evacuate
Resize ends up lazy-loading three instance properties on every run.
Rebuild loads five. We should pre-query for these so we get them
initially when we know we're going to need them.

Change-Id: I30ab3c7a147e3ea5bb633a75f6f4a8962963e43a
2023-08-21 08:53:19 -07:00
Zuul 54de747c25 Merge "Add dest_compute_id to Migration object" 2023-07-26 02:04:49 +00:00
Zuul 7e25b672ef Merge "Add a new policy for cold-migrate with host" 2023-07-21 16:52:51 +00:00
Sylvain Bauza 2d320f9b00 Add a new policy for cold-migrate with host
We add a new specific policy when a host value is provided for cold-migrate,
but by default it will only be an admin-only rule in order to not change
the behaviour.

Change-Id: I128242d5f689fdd08d74b1dcba861177174753ff
Implements: blueprint cold-migrate-to-host-policy
2023-06-26 11:34:12 +02:00
Dan Smith 70516d4ff9 Add dest_compute_id to Migration object
This makes us store the compute_id of the destination node in the
Migration object. Since resize/cold-migration changes the node
affiliation of an instance *to* the destination node *from* the source
node, we need a positive record of the node id to be used. The
destination node set this to its own node when creating the migration,
and it is used by the source node when the switchover happens.

Because the migration may be backleveled for an older node involved
in that process and thus saved or passed without this field, this
adds a compatibility routine that falls back to looking up the node
by host/nodename.

Related to blueprint compute-object-ids

Change-Id: I362a40403d1094be36412f5f7afba00da8af8301
2023-05-31 07:13:16 -07:00
melanie witt 6f79d6321e Enforce quota usage from placement when unshelving
When [quota]count_usage_from_placement = true or
[quota]driver = nova.quota.UnifiedLimitsDriver, cores and ram quota
usage are counted from placement. When an instance is SHELVED_OFFLOADED,
it will not have allocations in placement, so its cores and ram should
not count against quota during that time.

This means however that when an instance is unshelved, there is a
possibility of going over quota if the cores and ram it needs were
allocated by some other instance(s) while it was SHELVED_OFFLOADED.

This fixes a bug where quota was not being properly enforced during
unshelve of a SHELVED_OFFLOADED instance when quota usage is counted
from placement. Test coverage is also added for the "recheck" quota
cases.

Closes-Bug: #2003991

Change-Id: I4ab97626c10052c7af9934a80ff8db9ddab82738
2023-05-23 01:02:05 +00:00
Zuul 105afb338b Merge "Revert "Debug Nova APIs call failures"" 2023-05-09 23:54:04 +00:00
Sylvain Bauza 6833695e70 Revert "Debug Nova APIs call failures"
This reverts commit afb0f77484.

Reason for revert: 

We unfortunately leak the token in the logs which is considered a security flaw, even if only provided on DEBUG level.

Change-Id: I52b52e65b689dadbdb08122c94652c491f850de6
Closes-Bug: #2012993
2023-05-02 15:51:28 +00:00
Artom Lifshitz faa1e64e5b Fix pep8 errors with new hacking
Hacking has bumped the version of flake8 that it's using to 5.0 in its
6.0.1 release. This turns up quite a few pep8 errors lurking in our
code. Fix them.

Needed-by: https://review.opendev.org/c/openstack/hacking/+/874516
Change-Id: I3b9c7f9f5de757f818ec358c992ffb0e5f3e310f
2023-04-28 08:34:52 -04:00
Takashi Natsume d82fa9f2f7 doc: mark the max microversion for 2023.1 Antelope
Just follows the pattern that we do every release.

Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Change-Id: Iaba463eedf8ec24303a18d5ba63087cd26ca16d3
2023-02-19 01:56:26 +00:00
Sahid Orentino Ferdjaoui 1d707a72fc fup: support evacuate target state
This fix minors comments that have been noticed.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: Iee6c224aa0f26d8550b38a8f69b28d8648b1da70
2023-02-06 14:25:33 +01:00
Sahid Orentino Ferdjaoui d732ee38a1 api: extend evacuate instance to support target state
Start to v2.95 any evacuated instances will be stopped a destination

Implements: bp/allowing-target-state-for-evacuate
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: I141b6f057cc4eb9c541c2bc6eddae27270ede08d
2023-01-31 18:16:00 +01:00
Rajesh Tailor ec40d5aee3 Handle InstanceInvalidState exception
When instance task state is 'deleting' or 'migrating', then
get_vnc_console throws 500 error, as InstanceInvalidState
exception is not handled there.

This change handles InstanceInvalidState in api layer in
get_vnc_console call.

Closes-Bug: #1968618
Change-Id: Ia738a0972b050f549f446c85171d3f33e60ada4f
2023-01-23 16:36:26 +05:30
Artom Lifshitz 9980b9ad52 Microversion 2.94: FQDN in hostname
Extend microversion 2.90 to allow FQDNs in the hostname parameter.
Multi-create with --hostname continues to be refused, returning error
400 to the user. This simplifies the code by not needing to handle any
sort of suffix or prefix mangling of the FQDN to handle multiple
instances. No other changes are made - not Neutron integration,
metadata API changes (the FQDN will appear as-is in places where the
hostname currently appears), etc.

Change-Id: I47e397dc6da8263762479cc8ae4f8777a6d9d811
Implements: bp/fqdn-in-hostname
2023-01-17 10:59:37 -05:00
Zuul 922f5f6da4 Merge "Remove deleted projects from flavor access list" 2023-01-12 18:50:49 +00:00
Zuul afc2ebacac Merge "[doc] Fix BFV Rescue trait name in microversion" 2022-12-21 16:52:24 +00:00
Zuul e40ac0c798 Merge "Support multiple config file with mod_wsgi" 2022-12-12 15:16:14 +00:00
Sean Mooney 73fe84fa0e Support multiple config file with mod_wsgi
Unlike uwsgi, apache mod_wsgi does not support passing
commandline arguments to the python wsgi script it invokes.

As a result while you can pass --config-file when hosting the
api and metadata wsgi applications with uwsgi there is no
way to use multiple config files with mod_wsgi.

This change mirrors how this is supported in keystone today
by intoducing a new OS_NOVA_CONFIG_FILES env var to allow
operators to optional pass a ';' delimited list of config
files to load.

This change also add docs for this env var and the existing
undocumented OS_NOVA_CONFIG_DIR.

Closes-Bug: 1994056
Change-Id: I8e3ccd75cbb7f2e132b403cb38022787c2c0a37b
2022-12-07 12:36:32 +01:00
Amit Uniyal c8d5397b0a Adds check for VM snapshot fail while quiesce
Added check if quiesce fails because libvirt fails to connect with
qemu guest agent inside instance

Closes-Bug: #1980720
Change-Id: I134a4060ace2678f76ae3606bf117c07194a8d92
2022-11-29 14:09:53 +00:00
Alexey Stupnikov 8c6daaacbe Remove deleted projects from flavor access list
Previously Nova was unable to remove deleted projects from flavor's
access lists. This patch lifts described limitation and improves
logic of nova/api/openstack/identity.py library by introducing two
separate kinds of exceptions:

- webob.exc.HTTPInternalServerError is raised when Keystone identity
  service version 3.0 was not found.
- webob.exc.HTTPBadRequest is raised when specified project is not
  found.

Closes-bug: #1980845
Change-Id: Icbf3bdd944f9a6c38f25ddea0b521ca48ee87a7f
2022-10-06 15:42:32 +02:00
Takashi Natsume 966dd8b25a doc: mark the max microversion for zed
Just follows the pattern that we do every release.

Change-Id: I6ce6d536290d0126006413aa4b15ba89162d5761
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-03 10:34:20 +09:00
Zuul 457806e206 Merge "libvirt: Add vIOMMU device to guest" 2022-09-01 19:56:09 +00:00
Stephen Finucane 14e3b352c2 libvirt: Add vIOMMU device to guest
Implementation for BP/libvirt-viommu-device.
With provide `hw:viommu_model` property to extra_specs or
`hw_viommu_model` to image property. will enable viommu to libvirt
guest.

[1] https://www.berrange.com/posts/2017/02/16/setting-up-a-nested-kvm-guest-for-developing-testing-pci-device-assignment-with-numa/
[2] https://review.opendev.org/c/openstack/nova-specs/+/840310

Implements: blueprint libvirt-viommu-device
Change-Id: Ief9c550292788160433a28a7a1c36ba38a6bc849
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-09-01 04:50:16 +08:00
Dan Smith 45c5b80fd0 Add API support for rebuilding BFV instances
This adds a microversion and API support for triggering a rebuild
of volume-backed instances by leveraging cinder functionality to
do so.

Implements: blueprint volume-backed-server-rebuild
Closes-Bug: #1482040

Co-Authored-By: Rajat Dhasmana <rajatdhasmana@gmail.com>

Change-Id: I211ad6b8aa7856eb94bfd40e4fdb7376a7f5c358
2022-08-31 18:05:03 +05:30
Sean Mooney 572c2b18e2 Add locked_memory extra spec and image property
This change adds a new hw:locked_memory extra spec and hw_locked_memory
image property to contol preventing guest memory from swapping.

This change adds docs and extend the flavor
validators for the new extra spec.
Also add new image property.

Blueprint: libvirt-viommu-device
Change-Id: Id3779594f0078a5045031aded2ed68ee4301abbd
2022-08-24 21:47:32 +08:00
Zuul 4d130cb9c5 Merge "Unify placement client singleton implementations" 2022-08-19 02:48:33 +00:00
Dan Smith c178d93606 Unify placement client singleton implementations
We have many places where we implement singleton behavior for the
placement client. This unifies them into a single place and
implementation. Not only does this DRY things up, but may cause us
to initialize it fewer times and also allows for emitting a common
set of error messages about expected failures for better
troubleshooting.

Change-Id: Iab8a791f64323f996e1d6e6d5a7e7a7c34eb4fb3
Related-Bug: #1846820
2022-08-18 07:22:37 -07:00
Zuul 3af84811c8 Merge "compute: Update bdms with ephemeral encryption details when requested" 2022-08-18 12:31:45 +00:00