Commit Graph

51744 Commits

Author SHA1 Message Date
Kevin_Zheng e8192177e8 Fix ServerMigrationSampleJsonTestsV2_24 to use its own sample file
The ServerMigrationSampleJsonTestsV2_24 functional tests set up
``self.api.microversion`` to 2.24 in its' setUp(), by doing this
it will not need to add its' own sample files, as there will be
no difference anyway. But this makes Tests that inherent from this
test class impossibe to run as the microversion will always been
overriden.

This patch fix it by change the tests to use self.microversion and
adds its' own sample files.

Part of blueprint abort-live-migration-in-queued-status

Change-Id: I07222efb8d566fa1dd395ef948eae6e6c4b13678
2018-07-16 13:57:11 -04:00
Kevin_Zheng d23794d25f Compute: add support to abort queued live migration
This patch modified compute manager and bumps the
nova-compute service version to be able to abort
live migration in ``queued`` and ``preparing`` status.
The following patch will modify the API part.

Part of blueprint abort-live-migration-in-queued-status

Change-Id: I3689dd6544c387676983be47cf925c3fd7ce72f1
2018-07-16 13:57:11 -04:00
Kevin_Zheng 79dac41fee Use ThreadPoolExecutor for max_concurrent_live_migrations
This changes the max_concurrent_live_migrations handling
to use a ThreadPoolExecutor so that we can control a bounded
pool of Futures in order to cancel queued live migrations
later in this series.

There is a slight functional difference in the unlimited
case since starting in python 3.5, ThreadPoolExecutor will
default to ncpu * 5 concurrently running threads. However,
max_concurrent_live_migrations defaults to 1 and assuming
compute hosts run with 32 physical CPUs on average, you'd
be looking at a maximum of 160 concurrently running live
migrations, which is probably way above what anyone would
consider sane.

Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>

Part of blueprint abort-live-migration-in-queued-status

Change-Id: Ia9ea1e164fb3b4a386405538eed58d94ad115172
2018-07-16 13:57:09 -04:00
Zuul b2dafb1ee8 Merge "z/VM Driver: Spawn and destroy function of z/VM driver" 2018-07-16 16:34:27 +00:00
Zuul 30b552da76 Merge "z/VM Driver: Initial change set of z/VM driver" 2018-07-16 16:34:00 +00:00
Zuul 529621bbb1 Merge "Transform instance.live_migration_force_complete notification" 2018-07-16 16:33:35 +00:00
Zuul d8319d8339 Merge "do not assume 1 consumer in AllocList.delete_all()" 2018-07-16 15:43:52 +00:00
Zuul ae40af621f Merge "Microversion 2.64 - Use new format policy in server group" 2018-07-16 15:41:57 +00:00
Matt Riedemann ef29499002 Update HostState.instances during _consume_selected_host
Change I4b67ec9dd4ce846a704d0f75ad64c41e693de0fb changed the
behavior of the ServerGroupAntiAffinityFilter to rely on
HostState.instances being accurate within the same request
so that it can compare the number of group members on the same
host for filtering. Previously the filter was just checking
InstanceGroup.hosts which was updated in the
FilterScheduler._consume_selected_host method for each instance
processed in a multi-create request.

This change updates _consume_selected_host such that if we have
an instance group and an instance_uuid (which should always be
the case unless conductor is running code older than Pike), then
we update HostState.instances with the instance_uuid so the
ServerGroupAntiAffinityFilter can properly compare the number of
group members against the instances on a given host in a multi-create
request.

Change-Id: Iacc636fa8a59a9e8670a8d683c10bdbb0dc8237b
Closes-Bug: #1781710
2018-07-16 11:29:57 -04:00
Zuul 16a2db6f23 Merge "Transform aggregate.update_prop notification" 2018-07-16 15:15:32 +00:00
Zuul 6ca30fd832 Merge "Resource_provider API handler does not return specific error codes" 2018-07-16 14:52:50 +00:00
Mike Perez c09fe87feb Replace support matrix ext with common library
The code to generate a support matrix has been pulled into a common
library. Using this instead of duplicating code in various projects that
need it.

Change-Id: If5c0bf2b0dcd7dbb7d316139ecb62a936fd15439
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
2018-07-16 15:04:00 +01:00
Balazs Gibizer 928746a7bb Add UUID validation for consumer_uuid
When an allocation is created with PUT /allocations/{consumer_uuid} the
consumer_uuid is not validated as UUID in the API and the DB schema only
checks that is fits into String(36). However the Consumer object stores
this value in a UUIDField oslo only raises a warning today.

This patch adds a UUID validation for that URL path.

Change-Id: Idedd85ca9266f10ce09231c34cab7ca43029a56c
Closes-Bug: #1780238
2018-07-16 15:23:05 +02:00
Zuul f2b96588ef Merge "network: Always retrieve network information if available" 2018-07-16 12:18:53 +00:00
Yikun Jiang d1ccea4dd7 Address nits in server group policy series
Change-Id: I126b51892056e3241640bbf05acf16d7f72b4329
2018-07-16 17:28:46 +08:00
jichenjc 9602c431f3 Adjust log style and remove ocata support
we already passed Pike cycle and should require compute to have
Pike+ version, the backport to Ocata can be removed.

Change-Id: I39d93dbf8552605e34b9f146e3613e6af62a1774
2018-07-16 14:55:21 +08:00
Huang Rui 50906f150f z/VM Driver: add get console output
Implement get_console_output for zvm virt driver.

Change-Id: I2158d34a87ca9104076bd234134aa4cab9c4e882
blueprint: add-zvm-driver-rocky
2018-07-16 11:35:11 +08:00
Huang Rui cc06ee1766 z/VM Driver: add power actions
Implement power_on, power_off, pause, unpause and reboot methods for
zvm virt driver.

Change-Id: I4199ec0e52ef2c9bd1cce2c8bc30097aaa5d7b82
blueprint: add-zvm-driver-rocky
2018-07-16 11:35:11 +08:00
nafei yang c50a39f8c8 z/VM Driver: add snapshot function
This patch add snapshot function to z/VM driver, it will call
underlying zvmsdk to generate the image

Change-Id: I0409aba55487e92efa6370eed41936bf8a4ef25d
blueprint: add-zvm-driver-rocky
2018-07-16 11:35:11 +08:00
PanYaLian 3e1692b966 z/VM Driver: Spawn and destroy function of z/VM driver
It includes two main function, Spawn is used to deploy an
instance on the z/VM, and destroy is used to delete the instance

Change-Id: Ie3db769c5e62353b2fa39c1a7e1f025171ff4a4a
blueprint: add-zvm-driver-rocky
2018-07-16 11:35:11 +08:00
Huang Rui e5acf4f961 z/VM Driver: Initial change set of z/VM driver
This is the first change that implements basic virt.driver methods
to allow nova-compute process start successfully.

A set of subsequent changes will implement spawn, snapshot, destroy
and instance power actions.

Change-Id: Ica6117c2c64f7518b78b7fb02487622250638e88
blueprint: add-zvm-driver-rocky
2018-07-16 11:35:10 +08:00
Zuul 6ee633a971 Merge "Skip more rebuild tests for cells v1 job" 2018-07-15 15:17:21 +00:00
Gábor Antal 23efc549a1 Transform instance.live_migration_force_complete notification
The instance.live_migration_force_complete.start and
instance.live_migration_force_complete.end notifications have been
transformed to the versioned notification framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I2e9a474457a7597a9febc111b13a67ddcf45f29e
Implements: bp versioned-notification-transformation-rocky
2018-07-16 00:12:37 +09:00
Gábor Antal 6322cb6a18 Transform aggregate.update_prop notification
The aggregate.update_prop.start and aggregate.update_prop.end
notifications has been transformed to the versioned notification
framework.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I37b19573b6d0e1131c446fcec361f01fa2560f82
Implements: bp versioned-notification-transformation-rocky
2018-07-15 23:36:31 +09:00
Zuul 202c147f3c Merge "Transform instance.live_migration_rollback_dest notification" 2018-07-15 13:25:45 +00:00
Zuul 13dbe1a58d Merge "Transform instance.live_migration_post notification" 2018-07-15 13:14:54 +00:00
Zuul cb0bf8a5e1 Merge "ironic: Log an error when API version is not available" 2018-07-15 07:49:44 +00:00
Zuul 629dc4d008 Merge "virt/ironic: Implement rescue and unrescue" 2018-07-15 07:49:36 +00:00
Zuul f75fcc6ce5 Merge "ironic: provide facilities to gracefully navigate versions" 2018-07-15 01:19:13 +00:00
Zuul 039f7e055e Merge "Transform instance.rebuild_scheduled notification" 2018-07-14 17:20:16 +00:00
Matt Riedemann ee6e0c1e7e Handle HostMappingNotFound when deleting a compute service
If the compute service we're deleting has never been
discovered (mapped to a cell using discover_hosts) or the
host mapping was already deleted, we need to handle the
HostMappingNotFound error when deleting a compute service
so that we (1) don't 500 out of the API and (2) continue to
delete the compute service.

Change-Id: I0d7644db3537a67b94e75972b3c4fce25a623763
Closes-Bug: #1780727
2018-07-13 15:42:03 -04:00
Zuul 21a368e1a6 Merge "Heal allocations with incomplete consumer information" 2018-07-13 19:26:59 +00:00
Matt Riedemann 4a1b08365c Skip more rebuild tests for cells v1 job
This skips a couple more tempest rebuild tests for
latent intermittent rebuild race failures
due to status sync delays with cells v1.

Change-Id: Ib2dcbba7f447f54c36877a4e7c29d1b6839a0a80
Related-Bug: #1709985
2018-07-13 15:53:11 +00:00
Matt Riedemann 6b6d81cf2b Heal allocations with incomplete consumer information
Allocations created before microversion 1.8 didn't have project_id
/ user_id consumer information. In Rocky those will be migrated
to have consumer records, but using configurable sentinel values.

As part of heal_allocations, we can detect this and heal the
allocations using the instance.project_id/user_id information.

This is something we'd need if we ever use Placement allocation
information counting quotas.

Note that we should be using Placement API version 1.28 with
consumer_generation when updating the allocations, but since
people might backport this change the usage of consumer
generations is left for a follow up patch.

Related to blueprint add-consumer-generation

Change-Id: Idba40838b7b1d5389ab308f2ea40e28911aecffa
2018-07-13 11:29:54 -04:00
Chen 0ef4ed96d1 fix cellv2 delete_host
When trying to delete host that can be found in host_mappings
but not in compute_nodes, current cellv2 delete_host will throw
an exception but does not really handle it.

This patch tries to handle this exception and allow the delete
operation to continue since it shows the host has gone anyway.

Change-Id: I99bd79fb45777edc0e33d846ba478b0a94a1191e
Closes-Bug: #1781391
2018-07-13 23:16:40 +08:00
Zuul 706257d20b Merge "Adapt _validate_instance_group_policy to new policy model" 2018-07-13 13:30:59 +00:00
OpenStack Proposal Bot 9b5d1d9ae8 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I3a294bcbbedea827d4cc98419c9ffb5dbc3f7f97
2018-07-13 06:58:20 +00:00
Hironori Shiina 1db9f80a29 ironic: Log an error when API version is not available
This patch adds logging when ironic doesn't support a required API
version for rescuing and unrescuing.

Change-Id: Ibabfc439e9d426aeabd54877a82e27f02f6ddb5a
Implements: blueprint ironic-rescue-mode
2018-07-13 15:41:48 +09:00
Zuul 00fa50c8da Merge "Change the ServerGroupAntiAffinityFilter to adapt to new policy" 2018-07-13 02:59:44 +00:00
Zuul e13db24c48 Merge "Add policy field to ServerGroup notification object" 2018-07-13 02:45:55 +00:00
Zuul 63bc42f6b9 Merge "Follow up for Ie49d605c66062d2548241d7e04f5a2a6b98c011e" 2018-07-13 02:45:44 +00:00
Yikun Jiang 5cdb1ce26b Microversion 2.64 - Use new format policy in server group
Enable users to define the policy rules on server group policy
to meet more advanced policy requirement. This microversion
brings the following changes in server group APIs:

* Add  ``policy`` and ``rules`` fields in the request of POST
  ``/os-server-groups``.
* The ``policy`` and ``rules`` fields will be
  returned in response body of POST, GET ``/os-server-groups``
  API and GET ``/os-server-groups/{server_group_id}`` API.
* The ``policies`` and ``metadata`` fields have been removed
  from the response body of POST, GET ``/os-server-groups`` API
  and GET ``/os-server-groups/{server_group_id}`` API.

Part of blueprint: complex-anti-affinity-policies

Change-Id: I6911e97bd7f8df92511e90518dba21c127e106a5
2018-07-13 10:43:42 +08:00
Taku Izumi a07b68ea92 virt/ironic: Implement rescue and unrescue
This patch adds implementation of rescue and unrescue for ironic virt
driver.

Implements: blueprint ironic-rescue-mode

Change-Id: I7c20a0c5f566c3255350fd494d1a2cde84a99440
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
2018-07-13 01:56:13 +00:00
Julia Kreger 4acbf4fee3 ironic: provide facilities to gracefully navigate versions
For quite some time, the nova virt driver has invoked the ironic
python client library with a static microversion pin which causes
operators to have a failed nova-compute process upon out of order
upgrades, as well as causes ironic's grenade CI jobs to break every
cycle when the pin is changed to a version released in the current
cycle due to established community agreement as well as the grenade
testing framework limitations.

In order to gracefully navigate this, python-ironicclient has
accepted a list of possible versions to negotiate since 2.2.0.

This patch provies a mechanism to validate if we are able to
send a request that was added at a specific version, allowing for
minimal code changes and for logic to only be centered around newer
features being added.

Change-Id: I440689a246538fbc8200687e40480d837b87eb7b
Closes-Bug: #1739440
2018-07-12 18:53:36 -07:00
Zuul fff9335bed Merge "Handle rebuild of instances with image traits" 2018-07-13 00:43:12 +00:00
Zuul 3dc4e61f6e Merge "Update process doc to be more generic about point of contact" 2018-07-13 00:30:18 +00:00
Jay Pipes 11c29ae470 do not assume 1 consumer in AllocList.delete_all()
Ever since we introduced support for setting multiple consumers in a
single POST /allocations, the AllocationList.delete_all() method has
been housing a latent bad assumption and bug.

The AllocationList.delete_all() method used to assume that the
AllocationList's Allocation objects were only ever for a single
consumer, and took a shortcut in deleting the allocation by deleting all
allocations with the "first" Allocation's consumer UUID:

```python
    def delete_all(self):
        # Allocations can only have a single consumer, so take advantage of
        # that fact and do an efficient batch delete
        consumer_uuid = self.objects[0].consumer.uuid
        _delete_allocations_for_consumer(self._context, consumer_uuid)
        consumer_obj.delete_consumers_if_no_allocations(
            self._context, [consumer_uuid])
```

The problem with the above is that if you get all the allocations for a
single resource provider, using
AllocationList.get_all_by_resource_provider() and there are more than
one consumer allocating resources against that provider, then calling
AllocationList.delete_all() will only delete *some* of the resource
provider's allocations, not all of them.

Luckily, the handler code has never used AllocationList.delete_all()
after calling AllocationList.get_all_by_resource_provider(), and so
we've not hit this latent bug in production.

However, in the next patch in this series (the reshaper DB work), we
*do* call AllocationList.delete_all() for allocation lists for each
provider involved in the reshape operation, which is why this fix is
important to get done correctly.

Note that this patch renames AllocationList.create_all() to
AllocationList.replace_all() to make it absolutely clear that all of
the allocations for all consumers in the list are first *deleted* by the
codebase and then re-created. We also remove the check in
AllocationList.create_all() that the Allocation objects in the list must
not have an 'id' field set. The reason for that is because in order to
properly implement AllocationList.delete_all() to call DELETE FROM
allocations WHERE id IN (<...>) we need the list of allocation record
internal IDs. These id field values are now properly set on the
Allocation objects when AllocationList.get_all_by_resource_provider()
and AllocationList.get_all_by_consumer_id() are called. This allows that
returned object to have delete_all() called on it and the DELETE
statement to work properly.

Change-Id: I12393b033054683bcc3e6f20da14e6243b4d5577
Closes-bug: #1781430
2018-07-12 16:57:31 -04:00
Zuul 536e5fa57f Merge "Mention osc-placement for managing traits in docs" 2018-07-12 18:49:06 +00:00
Zuul 45c58c0b70 Merge "Revert "docs: Disable smartquotes"" 2018-07-12 18:43:22 +00:00
melanie witt d76c54a70e Update process doc to be more generic about point of contact
The docs currently name a past PTL by IRC nick -- update it to be
more generic so we don't have to update it every time the PTL
changes.

Change-Id: I31dbf0ee4f7650389e824c25c3aea7529d63eaa0
2018-07-12 17:23:03 +00:00