Commit Graph

52650 Commits

Author SHA1 Message Date
ghanshyam 47befda147 Remove more code related to extensions and testing
This commit removes the more code relaetd to extensions
and its testing.

Also fixes the below nits as followup:
- https://review.openstack.org/#/c/583559/3/nova/api/openstack/compute/block_device_mapping.py@a32
- https://review.openstack.org/#/c/584590/11/nova/api/openstack/compute/views/servers.py@247
- https://review.openstack.org/#/c/584590/11/nova/api/openstack/compute/views/servers.py@205
- https://review.openstack.org/#/c/584590/11/nova/api/openstack/compute/views/servers.py@186
- https://review.openstack.org/#/c/606031/3/nova/tests/unit/api/openstack/compute/test_limits.py@457
- https://review.openstack.org/#/c/606031/3/nova/api/openstack/compute/routes.py@229

Partially implements: blueprint api-extensions-merge-stein

Change-Id: I39f4ac0f1e93b142470837b942425a037d73829a
2018-10-18 02:00:15 +00:00
ghanshyam d9237e159c Remove the caching the resource on Request object
All extensions are now merged into their main controller
view builder. Request object used to have the cache mechanism
to store the db resources for extensions to extend those.

Now those caching is not needed and this commit removes the caching
and get methods from Request object and their usage.

Partially implements: blueprint api-extensions-merge-stein

Change-Id: I444c2be539031a9ace0b3602c5c6f9f4132b6f23
2018-10-18 01:59:55 +00:00
ghanshyam 7c808fa702 Merge image_size extension response into image view builder
As nova extensions has been deprecated already and goal is to
merge all scattered code into main controller side.
Currently schema and request/response extended code are there
among all extensions.

This commit merges the image_size extension response into image
view builder.

Partially implements: blueprint api-extensions-merge-stein

Change-Id: Ifca9d9b766c87d4e1107e9be07223f8d4a0d6794
2018-10-18 01:59:34 +00:00
Zuul ce520ee789 Merge "Ignore uuid if already set in ComputeNode.update_from_virt_driver" 2018-10-17 23:19:49 +00:00
Zuul a534ccc5a7 Merge "Merge used_limits extension response into limit view builder" 2018-10-17 20:05:46 +00:00
Zuul 9c5d4eb200 Merge "Fix NoneType error in _notify_volume_usage_detach" 2018-10-17 13:54:39 +00:00
Zuul ca6c32f279 Merge "Fix formatting non-templated cell URLs with no config" 2018-10-17 13:05:01 +00:00
Zuul da1bc8e39f Merge "Use unique consumer_id when doing online data migration" 2018-10-17 12:18:20 +00:00
Zuul 572bf35269 Merge "Add recreate test for bug 1798163" 2018-10-17 10:38:46 +00:00
Zuul 0c5feb21b3 Merge "Handle online_data_migrations exceptions" 2018-10-17 07:07:06 +00:00
Zuul 2c322454ba Merge "Increment versioning with pbr instruction" 2018-10-17 03:52:35 +00:00
Zuul f57453befa Merge "Handle volume API failure in _post_live_migration" 2018-10-17 03:52:28 +00:00
Zuul d3686890c1 Merge "Transform volume.usage notification" 2018-10-16 21:42:04 +00:00
Matt Riedemann 498413074d Ignore uuid if already set in ComputeNode.update_from_virt_driver
Change Ia69fabce8e7fd7de101e291fe133c6f5f5f7056a sets the
ComputeNode.uuid to whatever the virt driver reports if the
virt driver reports a uuid, like in the case of ironic.

However, that breaks upgrades for any pre-existing compute
node records which have a random uuid since ComputeNode.uuid
is a read-only field once set.

This change simply ignores the uuid from the virt driver
resources dict if the ComputeNode.uuid is already set.

The bug actually shows up in the ironic grenade CI job
logs in stable/rocky but didn't fail the nova-compute startup
because ComputeManager._update_available_resource_for_node()
catches and just logs the error, but it doesn't kill the service.

Change-Id: Id02f501feefca358d36f39b24d426537685e425c
Closes-Bug: #1798172
2018-10-16 16:23:54 -04:00
Dan Smith 133d6b3bcc Fix formatting non-templated cell URLs with no config
If transport_url or connection are unset in config, we will fail to format
even non-templated cell mapping URLs due to an overly specific check in the
format routines. This fixes it by always bailing on templating if the config
is unset, and keeping the error message if we were unable to format a
template as a result.

Change-Id: I760580b8e6594be2bee99a5b825a690b07ab9deb
Closes-Bug: #1798158
2018-10-16 16:11:17 -04:00
Mohammed Naser 730936e535 Use unique consumer_id when doing online data migration
If there are multiple consumers having allocations to the same
resource provider, with different classes, it will attempt
multiple INSERTs with the same consumer_id which is not allowed
because of the database constraints.

This patch adds a simple GROUP BY in order to ensure that the
database server only provides us with unique values to avoid
trying to INSERT duplicate values.

Change-Id: I1acba5e65cd562472f29e354c6077f82844fa87d
Closes-Bug: #1798163
2018-10-16 15:30:38 -04:00
Matt Riedemann 618b47627d Add recreate test for bug 1798163
Change Icae5038190ab8c7bbdb38d54ae909fcbf9048912 in Rocky
attempts to online migrate missing consumers table records
when listing allocations for a given resource provider. The
problem is when it's doing an insert-from-select, it's not
handling multiple allocations on the same provider for the
same consumer, like you'd have with a compute instance that
has VCPU, MEMORY_MB and DISK_GB allocations against a single
compute node resource provider. As a result, the insert
statement has duplicate consumer IDs in it which results in
a unique constraint violation.

The existing tests never caught this because they tested with
3 unique consumers with a single allocation each.

The functional test added here hits both online data migration
routines: via the API when listing allocations for a resource
provider and the direct online data migration CLI.

Change-Id: Iba56aa6b227b6455d2437e4fabcd296b1b0f06ee
Related-Bug: #1798163
2018-10-16 15:21:35 -04:00
imacdonn 3eea37b85b Handle online_data_migrations exceptions
When online_data_migrations raise exceptions, nova/cinder-manage catches
the exceptions, prints fairly useless "something didn't work" messages,
and moves on. Two issues:

1) The user(/admin) has no way to see what actually failed (exception
   detail is not logged)

2) The command returns exit status 0, as if all possible migrations have
   been completed successfully - this can cause failures to get missed,
   especially if automated

This change adds logging of the exceptions, and introduces a new exit
status of 2, which indicates that no updates took effect in the last
batch attempt, but some are (still) failing, which requires intervention.

Change-Id: Ib684091af0b19e62396f6becc78c656c49a60504
Closes-Bug: #1796192
2018-10-16 15:49:51 +00:00
Zuul a53e46a759 Merge "Use tempest-pg-full" 2018-10-16 14:22:03 +00:00
Zuul 8fadc806f4 Merge "doc: update metadata service doc" 2018-10-16 10:30:03 +00:00
Artom Lifshitz 5513f48dea Handle volume API failure in _post_live_migration
Previously, if the call to Cinder in _post_live_migration failed, the
exception went unhandled and prevented us from calling
post_live_migration_at_destination - which is where we set instance
host and task state. This left the system in an inconsistent state,
with the instance actually running on the destination, but
with instance.host still set to the source. This patch simply wraps
the Cinder API calls in a try/except, and logs the exception instead
of blowing up. While "dumb", this has the virtue of being simple and
minimizing potential side effects. A comprehensive refactoring of
when, where and how we set instance host and task state to try to
guarantee consistency is left as a TODO.

Partial-bug: 1628606
Change-Id: Icb0bdaf454935b3713c35339394d260b33520de5
2018-10-15 19:47:51 -04:00
Zuul f8727c4112 Merge "Add some more docs for upgrade checkers" 2018-10-15 18:49:34 +00:00
Zuul b641eb00be Merge "Add microversion 2.67 to rest api version history" 2018-10-15 17:42:30 +00:00
Zuul 5e8af9fc09 Merge "Use nova-consoleauth only if workaround enabled" 2018-10-15 17:36:29 +00:00
Matt Riedemann 2a25a13ea9 Add some more docs for upgrade checkers
This adds a few more things to the upgrade checks
reference docs after getting questions about it
during the Stein release goal implementation from
other project teams:

1. Notes the high level set of steps for upgrading
   nova in grenade and where nova-status fits into
   that sequence.

2. Links to the oslo.upgradecheck library which
   didn't exist when the original document was
   written.

3. Adds a FAQs section with Q&A for several things
   that have come up during the Stein release goal.

Change-Id: I990e5dbe563fa342f7481c3720445b924447ad54
Story: 2003657
2018-10-15 15:37:11 +00:00
zhangbailin 25d87004ef Add microversion 2.67 to rest api version history
Add microversion 2.67 to REST API Version History, it is used as an
index by novaclient's release note, and rename the "test_block_device"
test case
"test_from_api_invalid_oneof_image_id_or_destination_local_mapping" to
"test_from_api_invalid_image_to_destination_local_mapping", mentioned by
melwitt.

Depends-On: https://review.openstack.org/#/c/606398/

Part of blueprint boot-instance-specific-storage-backend

Change-Id: Ic6d562947f445c6f6cabd69484bc85b7aea88e48
2018-10-15 13:25:31 +00:00
Chen 1142f64ba2 doc: update metadata service doc
1 update to the latest metadata version in the examples
2 fix a typo
3 update a url

Change-Id: I5a78088413ba3e15d3f3c19392effa898205f502
2018-10-15 11:47:39 +08:00
Zuul 396156eb13 Merge "Add microversion 2.67 to support volume_type" 2018-10-13 18:46:09 +00:00
Zuul 12fcfc5e2b Merge "Skip _remove_deleted_instances_allocations if compute is new" 2018-10-12 21:47:02 +00:00
Matt Riedemann 4da54c0786 Fix NoneType error in _notify_volume_usage_detach
If the driver.block_stats() method returns None, like the
libvirt driver will if the guest is gone during an evacuate,
we'll get a NoneType error trying to unpack the return value
from the driver. Instead, simply return as if the driver
raised NotImplementedError.

Since handling None is changing the contract on the virt
driver API, the docstring is updated to explain the acceptable
return values of the driver method.

Change-Id: I98a2785c07f7af02ad83650c72d9e1868290ece4
Closes-Bug: #1796981
2018-10-12 17:38:25 -04:00
Sean McGinnis 531c2c4476 Increment versioning with pbr instruction
With moving away from required milestone releases, the version numbers
calculated by PBR on the master branch will not work for those testing
upgrades from the last stable release. More details can be found in the
mailing list post here:

    http://lists.openstack.org/pipermail/openstack-dev/2018-October/135706.html

This is an empty commit that will cause PBR to increment its calculated
version to get around this.

PBR will see the following which will cause it to increment the version:

Sem-Ver: feature

Please merge this patch as soon as possible to support those testing
upgrades.

Change-Id: I3ef10a9afe61c95d4622cbc4713b455525fbd952
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-12 13:10:07 -05:00
Andreas Jaeger 01a08a8cba Use tempest-pg-full
The legacy job legacy-tempest-dsvm-neutron-pg-full is now named
tempest-pg-full - using the new tempest and Zuul v3 frameworks.

Change experimental job to use new job.

Change-Id: I10865188e4a43b2399f647124dfff8ade40b875c
Depends-On: https://review.openstack.org/609530
2018-10-12 10:07:19 +02:00
zhangbailin c7f4190af2 Add microversion 2.67 to support volume_type
Add a new microversion 2.67 to support specify ``volume_type``
when boot instances.

Part of bp boot-instance-specific-storage-backend
Change-Id: I13102243f7ce36a5d44c1790f3a633703373ebf7
2018-10-12 02:57:58 -04:00
Zuul 20bc0136d0 Merge "Add compute API validation for when a volume_type is requested" 2018-10-12 05:56:48 +00:00
Zuul 67ac57b325 Merge "Add compute version 36 to support `volume_type`" 2018-10-12 05:54:37 +00:00
Zuul 6d9e5c7768 Merge "Replace openSUSE experimental check with newer version" 2018-10-12 05:54:30 +00:00
Zuul 01c33c584f Merge "Add volume_type field to BlockDeviceMapping object" 2018-10-12 05:54:20 +00:00
Zuul 9660371747 Merge "fix "you" typo" 2018-10-11 22:10:14 +00:00
Zuul e4af489f19 Merge "Handle IndexError in _populate_neutron_binding_profile" 2018-10-11 22:09:58 +00:00
Zuul e1749f2897 Merge "Add scatter-gather-single-cell utility" 2018-10-11 22:09:51 +00:00
zhangbailin 686dbc3640 Add compute API validation for when a volume_type is requested
This adds validation in the compute API for when a
block_device_mapping_v2 request specifies a volume_type. Note that
this is all noop code right now since users cannot specify that field in
the API until the microversion is added which enables that feature.
In other words, this is just plumbing.

Part of bp boot-instance-specific-storage-backend
Change-Id: I45bd42908d44a0f05e1231febab926b23232b57b
2018-10-11 16:04:53 -04:00
zhangbailin 88766d33a3 Add compute version 36 to support `volume_type`
Add support specifying ``volume_type`` to storage backend
when booting instance in compute version 36.

bp: boot-instance-specific-storage-backend
Change-Id: Icc301230fe7c8e3ebbbcc7f4a807e562db7f93e3
2018-10-11 16:00:48 -04:00
melanie witt b49209cc29 Use nova-consoleauth only if workaround enabled
In Rocky, we deprecated the nova-consoleauth service but there were
unconditional calls to nova-consoleauth in the compute/api, which
made it impossible to avoid running the nova-consoleauth service.

This adds conditional checks to call nova-consoleauth only if the
[workarounds]enable_consoleauth configuration option is True. The
option defaults to False because the default console token auth TTL
is 10 minutes and only operators who have configured much longer TTL
or otherwise wish to avoid resetting all consoles at upgrade time
need to use the option.

This also updates the /os-console-auth-tokens/{console_token} API to
use nova-consoleauth only if the [workarounds] option is enabled. This
had to be done in the same change because the conditional checks in
the compute/api code caused the /os-console-auth-tokens API functional
tests to fail to find token authorizations in nova-consoleauth.

Closes-Bug: #1788470
Closes-Bug: #1795982

Change-Id: Iff6020f1a10afc476864f979faf251ef5a1a6184
2018-10-11 18:23:02 +00:00
Adam Spiers f619d5447e fix "you" typo
Saving the world, one typo at a time ...

Change-Id: I6bb98849ee26abee13e35e12d2c748a902964ac7
2018-10-11 19:03:58 +01:00
ghanshyam 56707ba941 Merge used_limits extension response into limit view builder
As nova extensions has been deprecated already and goal is to
merge all scattered code into main controller side.
Currently schema and request/response extended code are there
among all extensions.

This commit merge the used_limits extension resposne into limit
view builder.

Partially implements: blueprint api-extensions-merge-stein

Change-Id: I76e02214e958a55b6de8033243b46b259949e5ac
2018-10-11 10:00:31 +00:00
Zuul 7a5d7db7fc Merge "remove commented-out code" 2018-10-11 03:03:38 +00:00
Zuul b1779c8497 Merge "Remove useless TODO section" 2018-10-11 01:52:27 +00:00
Zuul 941d30739d Merge "api-ref: Remove a description in servers-actions.inc" 2018-10-11 01:52:19 +00:00
Matt Riedemann 418fc93a10 Skip _remove_deleted_instances_allocations if compute is new
If this is the first start of the compute service and the compute node
record does not exist, the resource provider won't exist either. So when
the ResourceTracker._remove_deleted_instances_allocations method is called
it's going to log an ERROR because get_allocations_for_resource_provider
will raise an error since the resource provider doesn't yet exist (that
happens later during RT._update() on the new compute node record).

We can avoid calling _remove_deleted_instances_allocations if we know the
compute node is newly created, so this adds handling for that case.

Tests are updated and an unnecessary mock is removed along the way.

Change-Id: I37e8ad5b14262d801702411c2c87e73550adda70
Closes-Bug: #1789998
2018-10-10 18:59:50 -04:00
Andreas Jaeger ad2ed8b149 Replace openSUSE experimental check with newer version
We're migrating now to openSUSE 15.0 (yes, 15.0 is newer than 42.3),
remove legacy job and replace with native Zuul v3 job running python3.

Change-Id: Ib0b49fead613d06001df348831c022edfe8d0fd1
Depends-On: https://review.openstack.org/609359
2018-10-10 18:00:48 +02:00