This patch allows to run 'isolated' and 'non isolated'
images on isolated hosts by adding a flag
'restrict_isolated_hosts_to_isolated_images'.
If the flag is set to True then 'non isolated' images
can't be run on isolated hosts (same behaviour as the
current filter) otherwise they can be run on isolated
hosts.
DocImpact
blueprint improve-isolatedhostsfilter
Change-Id: I8c092caf32c05be88a547a7e8cb0530cc4925080
The search filter should have the form:
[{'foo'}: ['bar'], {'baz'}: ['quux']]
The underlying code accidentally and unfortunately allows filters that look like
[{'foo'}: 'bar', {'baz'}: 'quux'], but that is not guaranteed to work in the future.
Change-Id: Ic28612c8c843194e2f4f6918166177813fd5dee3
The code in the servers API did not pass the context when retrieving
flavor details. That means it would use an admin context instead,
bypassing all flavor access control checks.
This patch includes the fix, and the corresponding unit test, for both
the v2 and v3 APIs.
Closes-bug: #1212179
Change-Id: I681ae9965e19767df22fa74c3315e4e03a459d3b
This patch makes rpc calls that are the result of booting an instance
propagate the new block device mapping format.
The way this is done is by adding a 'legacy_bdm' flag to the conductor
(task) API. Since both the scheduler and the compute service propagate
the block device mapping as part of the request_spec field, a flag named
legacy_bdm_in_spec to indicate that was introduced in their respective
APIs.
Currently block_device_mapping is not used by any of the in-tree filters
in the scheduler, so it is assumed that scheduler's boot functionality
has now transitioned to the new format.
This patch also bumps RPC versions of the task, scheduler and compute
manager classes.
Finally this patch propagates the legacy_bdm_in_spec through the
run_instance callback of the compute manager so that, in case of error -
the instance is re-scheduled with the proper flag set.
blueprint: improve-block-device-handling
Change-Id: I5f25ddd4d586dda91061f065c1796be726b0ede3
This patch makes the API part of the instance boot process rely on the
new BDM format. It adds additional validations that are enabled due to
using the new format.
Since the new format will allow to specify devices that will be created
as images on the hypervisor (if the hypervisor enables it), in order
to prevent a DOS, a new config option 'max_local_block_devices' was
added. This option allows the operator to set a limit on the number of
destination_type='local' block devices a user can specify per VM.
This patch also refactors and simplifies how block devices are handled
during boot, and makes sure that validation errors are caught and
transformed to expected HTTP errors.
Change-Id: I62e0807fcff0a284ff72555d107cac1c9864e46d
blueprint: improve-block-device-handling
In review I5bf7795fca21627566ef4f688d45dc83bb953d1b (commit 3349417) we
passed an rpc_connection argument to pre_start_hook() so that we could
create additional queues.
See review Idf12c418a8ce1bc873e7ad6f702351e95d31aca3 for how this was
intended to be used. With oslo.messaging, we'd support doing something
like this by adding support for multiple targets to RPCServer since the
concept of a messaging connection isn't really exposed by the API in
quite the same way.
In any case, this rpc_connection parameter has never been used since it
was introduced, so let's remove it. Let's also move the invocation of
this hook back to where it originally was.
blueprint: oslo-messaging
Change-Id: I9181a3567a1b5a8a6077e78c85f4d28660f275a6
Fixes bug 1202042
A new utility method, is_neutron, is added. This returns True
if Neutron/Quantum is used by the network_api_class.
Change-Id: Id1d1f29a02e906b98853670ea2ad589f04eba595
The project_user_quotas_user_id_deleted_idx index in the 203 migration
for the project_user_quotas table was using the wrong column, it should
be using user_id instead of project_id since there is already an index
for the project_id column (defined directly above it).
Fixes bug 1205693
Change-Id: I6899afe5b57432345f69b4ee91ef947a4b9ef5c9
There are few ForeignKeys that had been skipped in migrations
and declared in models.
This patch adds these relationships into db by new migration.
bp: db-sync-models-with-migrations
Change-Id: I63e6a853ec16b80ea52b1c0e8a94f8f60819312c
This moves some conductor compute task tests into the test class that
only tests the manager side. It also removes testing of
scheduler_utils's set_vm_state_and_notify method as that is already
tested separately.
Change-Id: I30bd3897311870b10c8ec65182c81d341a904485
They were missing... although there is some testing via some conductor
tests that are not completely unit-y. Those will be adjusted next.
Change-Id: I696dd8ff264fffb3ae015c3ae653c0799c60cecf
The tests for the admin_actions API extension (or v3 plugin) are
stubbing out conductor methods, which creates a lot of pain when
compute_api internals are changed. Convert these tests to unit tests,
checking only that the appropriate compute_api methods are called with
the correct arguments.
Change-Id: I16634efa2397b36afa15b90712bfd678325bc049
Move resize related compute API tests to test_compute_api and make them
unit tests. This makes test changes easier when converting to objects.
This also caught a couple things where the cells compute api class was
not in sync that don't really end up being bugs, but need to match for
tests to pass.
Change-Id: I194310beb5e821e4a8262310d1bb80e0747e1c43
Fix bug 1212648
When boot multiple instances in one request, the launch_index
was not increased.
The fix was increase the launch_index one by one for each instances
in one request.
Change-Id: I27dde8cfae52853d33277c3d8e0e65c91bc6280b
Previously, processutils.execute always logged what commands were
run at DEBUG level. This is usually fine, but sometimes the caller
wants to log particularly important commands at INFO level instead,
and oslo should allow that.
This is oslo-incubator aa5b65882. No other significant changes had
been made to processutils in oslo since the last sync.
Change-Id: I09dad3759bf2f759b297ee19205cf0460b9a6baa
This was deprecated in Grizzly, and the TODO said remove for Havana.
fixed_range was deprecated in I4ec111079f7a1d253190e6a6008048f992a53f68
DocImpact: Remove deprecated config option
Change-Id: I1f429de7a7091adbd3a178d287b3a90e02664450
Refactors the integrated test classes so they can be used
for both V2 and V3 API testing. No actual V3 testing is
added in this changeset.
Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification
Change-Id: Ic7d7b513c3bc19ac1962c0a8489b55e9685fb7c0