Remove six.PY2 and six.PY3.
Subsequent patches will replace other six usages.
Change-Id: Iccce0ab50eee515e533ab36c8e7adc10cb3f7019
Implements: blueprint six-removal
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
In a future change, we'll want access to this so that it's possible to
retrieve vTPM data during the unrescue operation. While we're here, it
seems nothing is using the 'network_info' argument anymore, presumably
since the demise of nova-network, and this can and should be dropped.
Resolve both issues in one go, adding the 'context' parameter, dropping
the 'network_info' one, and updating the various callers and tests for
same.
Maintainers of out-of-tree drivers have been notified of these changes
[1].
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-July/015824.html
Part of blueprint add-emulated-virtual-tpm
Change-Id: Id5e4b0f26d5a2a93db6a7d96555a2cff29d9a2cf
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We neither need nor want these translated so remove them. A couple of
logs with unnecessary brackets or weird indentation were identified in
the process, and these are also modified. Note that exceptions must
still be translated. Refer to [1] for more details.
[1] https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html
Change-Id: I4573a7c5f3a7b5716a15fbd15ad9336807843a03
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The inject_file call was removed from the compute RPC at 3.18.
As we have RCP 5.x now it is safe to remove the manager method
handing that call. This removes the last user of the inject_file virt
diver method so that is deleted too.
Change-Id: If257fa301e8c12bb0c5e4d396ccc2c7277b25233
Some features like vGPUs require to have allocations to be checked locally
by the virt driver but resize (and cold migrate) was not passing them.
This change just gives the allocations to the target node when the resize
is done by adding the allocations to the finish_migration() interface.
Related-Bug: #1778563
Change-Id: Ifd76289964d513e9544544e5787f5f8999589475
This change adds block_device_info as an argument to the rescue method
signature for all virt divers currently implementing instance rescue.
This will allow future changes to provide all disks during a stable
device rescue attempt.
Change-Id: I9c2d9013d741774e521021913ec04f37b310e9d4
. Do not delete accelerator requests in stop code paths.
. In the start code path, get the list of accelerator requests from
Cyborg in the compute manager 'power_on'.
. Pass accel_info (said list) to the virt driver power_on.
. In libvirt driver, pass that accel_info to driver power_on.
Change-Id: I8c94504b87aa4450d163fe2b33f6aa0eb5dae5ff
Blueprint: nova-cyborg-interaction
Update the signature of the spawn() API for each virt driver
to include accel_info, which is a list of accelerator requests.
Change-Id: I4aac66c125a162bf35991a7d0c2638c7475ec0e7
Blueprint: nova-cyborg-interaction
This doesn't exist for 'nova.volume' and no longer exists for
'nova.network'. There's only one image backend we support, so do like
we've done elsewhere and just use 'nova.image.glance'.
Change-Id: I7ca7d8a92dfbc7c8d0ee2f9e660eabaa7e220e2a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Firewall support is not needed with neutron, which supports both
security groups for per-port filtering and FWaaS for per-network
filtering. Remove both the generic firewalls and the hypervisor-specific
implementations.
This part focuses on removing the firewall drivers themselves, which are
now unused. It also updates the release note to note the two additional
config options that are removed here, '[DEFAULT] firewall_driver' and
'[DEFAULT] allow_same_net_traffic'.
Change-Id: I2dccf1610d6cbbb076fda393f1ef695d0be84b13
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Firewall support is not needed with neutron, which supports both
security groups for per-port filtering and FWaaS for per-network
filtering. Remove both the generic firewalls and the hypervisor-specific
implementations.
This change focuses on removing the firewall-related API calls from the
various virt drivers. The firewall drivers themselves are removed
separately.
Change-Id: I5a9e5532c46a5f7064441ae644125d21efe5fda1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
I suspect there is more to be removed here, but this is all I could spot
for the moment.
Change-Id: Ifb8dc7de5d4845dd639fba71b853d38cdb851c7d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We want to make sure people who have both pinned and unpinned instances
on a host (yes, it's dumb, but it happens) won't do a straightforward
'vcpu_pin_set' -> '[compute] cpu_dedicated_set' or '[compute]
cpu_shared_set' transition, breaking their ability to restart or rebuild
instances. We add a new 'supports_pcpus' driver capability to avoid
needing to do this on drivers that don't support PCPUs and CPU pinning
in general.
Change-Id: Ia1b3ab0b66fdaf569f6c7a09510f208ee28725b2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
After three months since the quality warning change merged [1]
there has still been no progress in finding a maintainer for
the xenapi driver or someone to get the third party CI running
again - which has been off/broken for more than a release.
This change formally deprecates the driver, logging a warning
on startup along with providing a release note and warnings
in the docs and [xenserver] config group help.
Note that this does not mean the driver will absolutely be
removed in the Ussuri release, but it leaves the option open
to do so if the nova team decides that should happen.
This was discussed at the 2019-09-05 nova meeting [2] and
also at the Train PTG.
[1] I7f8eb7d5c5a9b1cb0a8d5e607d719b49a22675d3
[2] http://eavesdrop.openstack.org/meetings/nova/2019/nova.2019-09-05-14.01.log.html#l-227
Change-Id: Ie7e66ff64185d9fd4be2265e040e1afc45b95174
The following methods have not been used any more
since the following change IDs or a commit.
* _add_vif_extension
I56d859beb675199b209587bfe0a23cd9b75233ad
* _node_dict
Ia76e41a8a3b7230701872ae7a1975edc3d9ea847
* _bdms_from_legacy and _bdms_to_legacy
I01c108ceb539bb99491ed542c683e36fbf0c2bbe
* _create_block_device_mapping
Ib0e0b708c46e4330e51f8f8fdfbb02d45aaf0f44
* _get_folder
If734e22af223836b424561e8e9ca65e6c39fe5c2
* _details_map
This method has not been used since the commit
that added the method (initial commit).
e7562217ed
Change-Id: Ica00c013961366d044f5a4ad3ed24568d60288b3
For a cross-cell resize, the equivalent of the "finish_resize"
method on the destination compute is going to call the
driver spawn() method rather than the finish_migration()
method and needs to pass through the power_on value, similar
to finish_migration, so that when resizing a stopped server
it remains stopped once it is resized.
The finish_migration method in the driver behaves very similar
to spawn so the semantics are the same.
This change updates the spawn method signature for all in-tree
compute drivers but only implements the logic for the libvirt
driver as that is the only driver (currently) which supports
cross-cell resize (note the can_connect_volume method is also
necessary for cross-cell resize implementation in the driver).
Part of blueprint cross-cell-resize
Change-Id: I6929c588dd2e0e805f2e30b2e30d29967469d756
Rules are fetched, edited, and set. Keep the edit logic in nova/network,
but move the bits requiring elevated permissions to privsep.
Change-Id: I1f8382c450b95d261f68ec8bae2a2077f9361fe0
With the removal of the Core, Ram and Disk filters in change
I8a0d332877fbb9794700081e7954f2501b7e7c09, there's now only a single
caller for the 'estimate_instance_overhead' function. This call results
in the 'memory_mb_used', 'local_gb_used', 'vcpus_used', 'free_ram_mb'
and 'free_disk_gb' fields of a compute nodes 'ComputeNode' object being
modified when calculating usage as part of the resource tracker to
include driver-specific overhead. However, these fields are no longer
used for for anything except logging and the 'os-hypervisors' API. Since
overhead is not reflected in placement (and therefore the scheduler),
reporting them as part of the various usage values for both logging and
that API is actually a bit of a lie and is likely to cause confusion
among users. Remove the whole thing and make our logs and the
'os-hypervisors' API better match what's stored in placement.
Change-Id: I033e8269194de54432079cbc970431e3dcea7ce5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
In order to obtain plug-time events, the libvirt driver needs to pass
a Migration object to the network model. Previously [1], this object
was obtained with a database lookup. This was done to avoid modifying
the virt driver interface, thus making the fix backportable. This
patch makes the compute manager pass the migration object to the virt
driver in order to avoid a needless database query.
[1] https://review.opendev.org/#/c/667177/
Change-Id: I9095c1be65b127d40f5bbe7af5d63fefedb73d33
This replaces get_inventory with update_provider_tree
in the xenapi driver. Since the driver is not reporting
traits there is nothing to do with traits in upt. The
VCPU, MEMORY_MB, DISK_GB and VGPU inventory is reported
the same as before, i.e. no support for nested providers
or reshaping allocations. The only additional change is
the need to provide the allocation_ratio and reserved
inventory values for VCPU, MEMORY_MB and DISK_GB since
ResourceTracker._normalize_inventory_from_cn_obj is not
called when the driver implements update_provider_tree.
Change-Id: Ie7bc0b3d3c3d5b1cdea124f6415aa0e87ac8b757
This one's actually important since it will be an error in future
versions of Python.
Change-Id: Ib9f735216773224f91ac7f49fbe2eee119670872
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
When we had cellsv1, we had two different sets of
[Host|InstanceAction|ComputeCells]API. Now that cellsv1 is gone, we only
need nova.compute.api.API, .HostAPI, and .InstanceActionAPI. This patch
removes the dynamic loader shims from nova/compute/__init__.py and swaps
out all references to directly access the classes in nova.compute.api.
Note that there are a couple of ways we could have done this. One way
would have been to replace
from nova import compute
with
from nova.compute import api
and then change
self.compute_api = compute.API()
to
self.compute_api = api.API()
However, the current approach was preferred because
- smaller delta
- the code reads better as compute.API(), which is more important than
the import being pretty
cleanup for blueprint remove-cells-v1
Change-Id: I84d9692efa3a131d6392dbd1011dfc43e4ac0b53
The xenapi driver has not had working third party CI
for several months. As a result, this change logs a
warning on startup of the service in the init_host
method indicating the lack of testing and the possibility
that the driver may be deprecated in the future if the
situation does not change.
This was discussed at the 2019-05-30 nova meeting [1] and
also at the Train PTG.
[1] http://eavesdrop.openstack.org/meetings/nova/2019/nova.2019-05-30-14.00.log.html
Change-Id: I7f8eb7d5c5a9b1cb0a8d5e607d719b49a22675d3
This is a static list, so a test is fairly pointless.
Related to blueprint bp/request-filter-image-types
Change-Id: Ic946b56906a3cc88fa9ebd042f56f0f81e3bcb84
Prior to this patch, if the openssl command returned a zero exit code
and wrote details to stderr, nova would raise a RuntimeError exception.
This patch changes the behavior to only raise a RuntimeError exception
when openssl returns a non-zero exit code. Regardless of the exit code
a warning will always be logged with stderr details if stderr is not
None. Note that processutils.execute will now raise a
processutils.ProcessExecutionError exception for any non-zero exit code
since we are passing check_exit_code=True, which we convert to a
Runtime error.
Thanks to Dimitri John Ledkov <xnox@ubuntu.com> and Eric Fried
<openstack@fried.cc> for helping with this patch.
Change-Id: I212ac2b5ccd93e00adb7b9fe102fcb70857c6073
Partial-Bug: #1771506
We return cached data to sync_power_state to avoid pummeling the ironic
API. However, this can lead to a race condition where an instance is
powered on, but nova thinks it should be off and calls stop(). Check
again without the cache when this happens to make sure we don't
unnecessarily kill an instance.
Closes-Bug: #1815791
Change-Id: I907b69eb689cf6c169a4869cfc7889308ca419d5
With the extraction of placement we ended up with resource class names
being duplicated between nova and placement. To address that, the
os-resource-classes library [1] was created to provide a single
authority for standard resource classes and the format of custom
classes.
This patch changes nova to use it, removing the use of the rc_fields
module which used to have the information. A method left in it
(normalize_name) has been moved to utils.py, renamed as
normalize_rc_name, and callers and tests updated accordingly.
Because the placement code is being kept in nova for the time being,
that code's use of rc_fields is maintained, and the module too.
A note is added in the module explain that. Backporting the changes
from extracted-placement to placement-in-nova was considered but
because we no longer have placement tests in nova, that didn't seem
like the right thing to do.
requirements and lower-constraints have been updated.
os-resource-classes is already in global requirements.
For reference the related placement change is at [2].
[1] https://docs.openstack.org/os-resource-classes
[2] https://review.openstack.org/#/c/623556/
Change-Id: I8e579920c0eaca81b563a87429c930b21b3d4dc5
Introduce an I/O semaphore to limit the number of concurrent
disk-IO-intensive operations. This could reduce disk contention from
image operations like image download, image format conversion, snapshot
extraction, etc.
The new config option max_concurrent_disk_ops can be set in nova.conf
per compute host and would be virt-driver-agnostic. It is default to 0
which means no limit.
blueprint: io-semaphore-for-concurrent-disk-ops
Change-Id: I897999e8a4601694213f068367eae9608cdc7bbb
Signed-off-by: Jack Ding <jack.ding@windriver.com>
A couple places in the Xen code have been using syntax that is
python2-specific. This replaces those instances with code that will
work in both python2 and python3.
PEP 3108 [1] moves urllib.urlopen to urllib.request.urlopen. The six
module is used in order to work in both python2 and python3 [2].
PEP 3110 [3] changed the grammar for except clauses, such that the
'as' keyword is now required in place of a comma when specifying an
exception variable.
[1] https://www.python.org/dev/peps/pep-3108/
[2] https://pythonhosted.org/six/#module-six.moves.urllib.request
[3] https://www.python.org/dev/peps/pep-3110/
Change-Id: I1235d767718a4207f4cef3e5b140319d003ad7b0