Commit Graph

50105 Commits

Author SHA1 Message Date
Dan Smith fd59fbd4d1 Make nova-manage db purge take --all-cells
This makes purge iterate over all cells if requested. This also makes our
post_test_hook.sh use the --all-cells variant with just the base config
file.

Related to blueprint purge-db

Change-Id: I7eb5ed05224838cdba18e96724162cc930f4422e
2018-03-08 09:26:49 -08:00
Dan Smith ff47787e11 Add --purge helper flag to archive_deleted_rows
Since many people will want to fully purge shadow table data after archiving,
this adds a --purge flag to archive_deleted_rows which will automatically do
a full db purge when complete.

Related to blueprint purge-db

Change-Id: Ibd824a77b32cbceb60973a89a93ce09fe6d1050d
2018-03-08 09:17:22 -08:00
Zuul 83caaae547 Merge "Add simple db purge command" 2018-03-08 17:15:22 +00:00
Zuul bac9855b1c Merge "Allow to configure amount of PCIe ports" 2018-03-08 15:17:26 +00:00
Zuul 2b9c7970fc Merge "Refactor WSGI apps and utils to limit imports" 2018-03-08 15:16:56 +00:00
Zuul aa1fbbb7cd Merge "[placement] use simple FaultWrapper" 2018-03-08 14:45:22 +00:00
Zuul 94eb5083f5 Merge "install-guide: Wrap long console command" 2018-03-08 14:45:13 +00:00
Zuul 59c20e0caa Merge "Handle IpAddressAlreadyAllocated exception" 2018-03-08 14:45:06 +00:00
Zuul d616c94983 Merge "Deprecate sparse LVs" 2018-03-08 14:29:13 +00:00
Zuul a4f926b8e1 Merge "Update the nova-manage db archive_deleted_rows description" 2018-03-08 11:13:16 +00:00
Marcin Juszkiewicz a234bbf80c Allow to configure amount of PCIe ports
On x86-64/q35 and aarch64/virt instances libvirt adds as many
pcie-root-port entries (aka virtual pcie slots) as it needs and adds one
free. If we want to hotplug network interfaces or storage devices then
we quickly run out of available pcie slots.

This patch allows to configure amount of PCIe slots in instance. Method
was discussed with upstream libvirt developers.

To have requested amount of pcie-root-port entries we have to create
whole PCIe structure starting with pcie-root/0 and then add as many
pcie-root-port/0 entries as we want slots. Too low value may get bumped
by libvirt to same as amount of inserted cards.

Systems not using new option will work same way as they did.

Implements: bp configure-amount-of-pcie-ports

Change-Id: Ic3c8761bcde3e842d1b8e1feff1d158630de59ae
2018-03-08 08:53:48 +01:00
Surya Seetharaman 00a0308d2a Update the nova-manage db archive_deleted_rows description
This patch adds the bit about removing the deleted rows from the
instance_mappings and request_specs tables as well permanently so
that the users are aware of this.

Change-Id: I183cc9f80b3feec6789332860b5aeb7591b710df
2018-03-08 00:29:39 +01:00
Zuul c7b54a80ac Merge "Run post-test archive against cell1" 2018-03-07 22:55:51 +00:00
Sylvain Bauza 0b11a09327 Deprecate sparse LVs
That feature was never tested in Nova and we had some bugs. Deprecating it.

Change-Id: I6f05bb32313de1d832fe080c00a74508224acd77
2018-03-07 22:51:40 +01:00
Zuul 51d752de29 Merge "Only attempt a rebuild claim for an evacuation to a new host" 2018-03-07 20:40:08 +00:00
Zuul 96fb50735c Merge "Allow 'network' in RequestContext service_catalog" 2018-03-07 19:23:04 +00:00
Dan Smith ae241cc68f Add simple db purge command
This adds a simple purge command to nova-manage. It either deletes all
shadow archived data, or data older than a date if provided.

This also adds a post-test hook to run purge after archive to validate
that it at least works on data generated by a gate run.

Related to blueprint purge-db

Change-Id: I6f87cf03d49be6bfad2c5e6f0c8accf0fab4e6ee
2018-03-07 10:35:32 -08:00
Dan Smith 64635ba18d Run post-test archive against cell1
Change-Id: I4af326fe66f0cf24ede8a8b7a8ce0e528c4f437c
2018-03-07 10:35:32 -08:00
Zuul 9d5757c6e1 Merge "Handle not found error on taking snapshot" 2018-03-07 17:53:37 +00:00
Zuul ab97b28d1d Merge "Fix version cap when no nova-compute started" 2018-03-07 17:26:48 +00:00
Zuul febb1d1171 Merge "hyper-v: Logs tips on PortBindingFailed" 2018-03-07 16:29:24 +00:00
Zuul 489a8f5bf3 Merge "Add a nova-caching-scheduler job to the experimental queue" 2018-03-07 14:55:55 +00:00
Zuul 450be218da Merge "Return 400 when compute host is not found" 2018-03-07 13:42:56 +00:00
Zuul 130777ab0e Merge "Move db MAX constants to own file" 2018-03-07 06:03:44 +00:00
Zuul c1716490cd Merge "Save admin password to sysmeta in libvirt driver" 2018-03-07 01:55:32 +00:00
Zuul f6d4c46c33 Merge "Add more functional test for placement.aggregates" 2018-03-07 00:55:36 +00:00
Zuul 1f2e702ca6 Merge "Remove MigrationPreCheckClientException" 2018-03-06 23:40:04 +00:00
Hongbin Lu 0098dbf2f1 Handle IpAddressAlreadyAllocated exception
Change-Id: I5bee9ae18764b6f285ecc5e8d7148a1019c74701
Closes-Bug: #1744103
2018-03-06 23:35:32 +00:00
Hongbin Lu 9ef56fa866 Handle not found error on taking snapshot
If there is a request to create a snapshot of an instance and
another request to delete the instance at the same time, the
snapshot task might fail with libvirt error and this error
is not handled correctly by compute manager. As a result,
tracestack was printed in the compute log.

This patch fixes it by handling libvirt exception during live
snapshot and raise instance not found exception if the libvirt
exception is raised due to domain not found.

Change-Id: I585b7b03753ed1d28a313ce443e6918687d76a8b
Closes-Bug: #1722571
2018-03-06 22:57:48 +00:00
Zuul 52c705cd7b Merge "Fix the notification devref location in exception" 2018-03-06 22:53:08 +00:00
melanie witt 715a3cadb0 Save admin password to sysmeta in libvirt driver
We have an API for setting the admin password for an already created
instance and we have a metadata API for retrieving the encrypted
password. In the libvirt driver, when a request to set the admin
password is received, it is indeed set in the guest but the instance
system metadata is never updated with the encrypted password, so
attempts to retrieve the password via the metadata service API result
in an empty string returned instead of the encrypted password.

This has been broken in the libvirt driver since the set admin password
password feature was added, as far as I can tell. The xen api driver,
however, handles the same thing correctly and this adds similar logic
to the libvirt driver to fix the problem.

Closes-Bug: #1748544

Change-Id: Icf44c4c94529cb75232abe1f3ecc5a4d3646b0cc
2018-03-06 17:34:24 -05:00
Zuul 8fe035f761 Merge "Check for multiattach before removing connections" 2018-03-06 22:13:54 +00:00
Zuul 13588bb8ab Merge "Pass user context to virt driver when detaching volume" 2018-03-06 22:13:45 +00:00
Chris Dent ef6f4e4c8e Refactor WSGI apps and utils to limit imports
The file nova/api/openstack/__init__.py had imported a lot of
modules, notably nova.utils. This means that any code which
runs within that package, notably the placement service, imports
all those modules, even if it is not going to use them. This
results in scripts/binaries that are heavier than they need
to be and in some cases including modules, like eventlet, that
it would feel safe to not have in the stack.

Unfortunately we cannot sinply rename nova/api/openstack/__init__.py
to another name because it contains FaultWrapper and FaultWrapper
is referred to, by package path, from the paste.ini file and that
file is out there in config land, and something we prefer not to
change. Therefore alternate methods of cleaning up were explored
and this has led to some useful changes:

Fault wrapper is the only consumer of walk_class_hierarchy so
there is no reason for it it to be in nova.utils.

nova.wsgi contains a mismash of WSGI middleware and applications,
which need only a small number of imports, and Server classes
which are more complex and not required by the WSGI wares.

Therefore nova.wsgi was split into nova.wsgi and nova.api.wsgi.
The name choices may not be ideal, but they were chosen to limit
the cascades of changes that are needed across code and tests.

Where utils.utf8 was used it has been replaced with the similar (but not
exactly equivalient) method from oslo_utils.encodeutils.

Change-Id: I297f30aa6eb01fe3b53fd8c9b7853949be31156d
Partial-Bug: #1743120
2018-03-06 22:05:12 +00:00
jichenjc a6d456f954 Add more functional test for placement.aggregates
Add more test cases for placement.aggregates to cover some edge case.

blueprint placement-test-enhancement

Change-Id: Ia18de50f3265b358e64523229140ce9a6e70dbbb
2018-03-06 21:46:27 +00:00
git-harry b81a66b3b0 Fix version cap when no nova-compute started
When a zero service version is returned, it means that we have no
services running for the requested binary. In that case, we should
assume the latest version available until told otherwise. This usually
happens in first-start cases, where everything is likely to be up to
date anyway.

This change addresses an issue where the version returned had been
hard-coded to 4.11 (mitaka).

Change-Id: I696a8ea8adbe9481e11407ecafd5e47b2bd29804
Closes-bug: 1753443
2018-03-06 20:14:42 +00:00
John Griffith 139426d514 Check for multiattach before removing connections
With the addition of multiattach we need to ensure that we
don't make brick calls to remove connections on detach volume
if that volume is attached to another Instance on the same
node.

This patch adds a new helper method (_should_disconnect_target)
to the virt driver that will inform the caller if the specified
volume is attached multiple times to the current host.

The general strategy for this call is to fetch a current reference
of the specified volume and then:
1. Check if that volume has >1 active attachments
2. Fetch the attachments for the volume and extract the server_uuids
   for each of the attachments.
3. Check the server_uuids against a list of all known server_uuids
   on the current host.  Increment a connection_count for each item
   found.

If the connection_count is >1 we return `False` indicating that the
volume is being used by more than one attachment on the host and
we therefore should NOT destroy the connection.

*NOTE*
This scenario is very different than the `shared_targets`
case (for which we supply a property on the Volume object).  The
`shared_targets` scenario is specifically for Volume backends that
present >1 Volumes using a single Target.  This mechanism is meant
to provide a signal to consumers that locking is required for the
creation and deletion of initiator/target sessions.

Closes-Bug: #1752115

Change-Id: Idc5cecffa9129d600c36e332c97f01f1e5ff1f9f
2018-03-06 12:04:04 -05:00
OpenStack Proposal Bot 01333a7f18 Updated from global requirements
Change-Id: I788f833403d39d07c338d16b7002657eda22b801
2018-03-06 12:57:20 +00:00
Balazs Gibizer d5f49eda5c Fix the notification devref location in exception
When the doc structure was changed the location of the notification
devref also changed. This patch updates the reference to this doc in
the AssertionError emited in the test if new legacy notification is
introduced.

Change-Id: Iff30752bac64801ad8950eea5861d2b230f30fdf
2018-03-05 17:38:52 +01:00
OpenStack Proposal Bot 35414701c1 Updated from global requirements
Change-Id: I04c27a2a5b5c85861a84c4aed92d056e4d915399
2018-03-05 06:55:05 +00:00
OpenStack Proposal Bot 5d2add7453 Updated from global requirements
Change-Id: Ia9254dd3d6c8d174c7d943430601c9121001c811
2018-03-04 10:16:00 +00:00
Matt Riedemann d2941bfd16 Pass user context to virt driver when detaching volume
We need this in a later change to pull volume attachment
information from cinder for the volume being detached so
that we can do some attachment counting for multiattach
volumes being detached from instances on the same host.

Change-Id: I751fcb7532679905c4279744919c6cce84a11eb4
Related-Bug: #1752115
2018-03-03 06:11:12 -05:00
Zuul fa50107c14 Merge "Updated from global requirements" 2018-03-02 18:46:56 +00:00
Zuul 1848fa318a Merge "Remove compute nodes arg from ProviderTree init" 2018-03-02 17:03:40 +00:00
OpenStack Proposal Bot 5799f5f6df Updated from global requirements
Change-Id: I91e47a7c3c099f70303843a742474bae12133447
2018-03-02 15:15:34 +00:00
Zuul a6edacd66c Merge "Move makefs to privsep" 2018-03-01 21:43:39 +00:00
Zuul aef1961f4c Merge "Convert users of tune2fs to privsep." 2018-03-01 21:43:32 +00:00
Zuul ec5144ce06 Merge "Use dict.get() when accessing capabilities dict" 2018-03-01 18:12:39 +00:00
Zuul f48457cf6d Merge "Enable native mode for ScaleIO volumes" 2018-03-01 13:09:34 +00:00
Zuul 04eb8f2aea Merge "[placement] api-ref: Fix a missing response code" 2018-03-01 12:56:21 +00:00