When we put validation into the project_id in urls we had to expand
the default set of allowed values to include 'openstack' and
'fake'. This cleans up all the instances of 'openstack' in the
functional tests, and api samples, and instead uses a constant string
which looks like a real project_id.
We need a stable project_id and not a sentinel otherwise the samples
will be arbitrarily changes on every update.
Change-Id: I1099fd43d2374abd1658b0917765d5375c4b8d1d
This is os-migrateLive API changes:
* 2.25 - Make block_migration to support 'auto' value, remove
disk_over_commit.
Partially implements: blueprint making-live-migration-api-friendly
APIImpact
DocImpact
Change-Id: Ibb0d50f0f7444028ef9d0c294aea41edf0024b31
For example, When aggregate zone is updated, time is not getting updated
in updated_at field.
So, modified the code such that time gets updated in updated_at field
whenever the aggregate metadata content gets modified.
Change-Id: Icb65313ba85562fadeddbc1890ca5d463e74d3c2
Closes-Bug: #1538014
This change adds a DELETE call on the server-migrations object to cancel
a running live migration of a specific instance.
TO perform the cancellation the virtualization driver needs to support
it, in case that the feature is not supported we return an error.
We allow a cancellation of a migration only if the migration is
running at the moment of the request and if the migration type is equal
to 'live-migration'.
In this change we implement this feature for the libvirt driver.
When the cancellation of a live migration succeeded we rollback the live
migration and we set the state of the Migration object equals to
'cancelled'.
The implementation of this change is based on the work done by the
implementation of the feature called 'force live migration':
https://review.openstack.org/245921
DocImpact
ApiImpact
Implements blueprint: abort-live-migration
Change-Id: I1ff861e54997a069894b542bd764ac3ef1b3dbb2
This patch does two things:
1. Add two APIs /servers/migrations:index/show for server migrations.
Two new novaclient commands server-migration-list and
server-migration-show will also be added.
ref: I071198fa9ba0699383bdebf4fab54714a435e6c3
2. Add ref link for /os-migrations
The old top-level resource `/os-migrations` won't be extended anymore.
It is deprecated.
Adding migration_type for it, also add ref link to
/servers/{uuid}/migrations/{id} for it when the migration is an
in progress migration.
Partially implements blueprint live-migration-progress-report
Change-Id: Ia92ecbe3c99082e3a34adf4fd29041b1a95ef21e
Co-authored-by: ShaoHe Feng <shaohe.feng@intel.com>
This change adds manual knob to force ongoing live migration to
complete. It is implemented as a new server-migrations API.
DocImpact
ApiImpact
Implements: blueprint pause-vm-during-live-migration
Change-Id: I034b4041414a797f65ede52db2963107f2ef7456
Add a microversion change to the os-instance-actions API so that we
mutate the context to set 'read_deleted="yes"' when looking up the
instance.
Blueprint: os-instance-actions-read-deleted-instances
Change-Id: I607a28bbe06e20e17ee47a283e06b1d42b5c0e84
This change enables the attach and detach volume operations for
instances which are in shelve and shelved_offloaded state.
The code to manage the actual attach and detach is implemented by this
change: https://review.openstack.org/259528
New tempest tests are going to be written for testing the new feature.
APIImpact
DocImpact by this change we are allowing operations which were not
allowed before, we need to track this change in the documentation.
Partially implements blueprint: volume-ops-when-shelved
Change-Id: I43b67a50d998d43a6ff78c917093c513231b6ff2
I74b1a340c5ab98fdea2186e87dd13f42ce7c7661 introduced a malformed api
sample and the tox -e docs fails since then. This patch fixes the
sample file.
Closes-bug: #1539071
Change-Id: Ica76db8928fc98db1a09074fdc46439c920e93d8
As extensions options has been deprecated, API sample tests
should run against all extension enable.
This commit enables all extensions for server PUT API tests and
remove its specific extensions tests and sample files.
Adding a hack for other tests which are still running with specific
extensions. That is needed to avoid all tests updates in single commit.
Partially implements blueprint api-sample-tests-with-all-extensions
Change-Id: I9c44da3d9df39c1db0948194502be52f4f15acf2
This patches adds changes to the Nova REST API to allow
users to create a server with a description, rebuild
a server with a description, update the description,
and get the description in the server details.
Note: Future commits will be done to support the server
description in python-novaclient and openstack-client.
APIImpact
Implements blueprint: user-settable-server-description
Change-Id: I74b1a340c5ab98fdea2186e87dd13f42ce7c7661
This introduces microversion 2.18 which signals that the {project_id}
is no longer required in URLs.
It tests this with an additional scenario in api_samples which makes
all the requests without the project_id in the url (using a different
noauth middleware to accomplish this).
Update the link fixer in the ApiSamples matching code to also update
for optional project_id. This is the least worse approach here,
because if we set request_api_version, then we have to duplicate the
entire template tree as well, which we definitely don't want to do, as
it now correctly handles either url form.
This updates the auth tests to bifurcate with testscenarios instead of
the subclass model, which makes for more consistent tests.
In order to support adding routes without project_id we have to be
able to restrict project_id something that doesn't match any of our
top level routes.
The default for this is [0-9a-f\-]+ which will match all of the
following:
- keystone default generated project_ids [0-9a-f]{32}
- integer project_ids (\d+) - known in use by RAX
- uuids with dashes (no known users, but suspect there might be)
This can be overrided with the new (but already deprecated)
``project_id_regex`` config option.
NOTE: we used this feature to expand the regex to match 'fake' and
'openstack' as valid project ids in tests. Those concepts are deeply
embedded in our tests, and need to be unwound independently.
APIImpact
Implements bp:service-catalog-tng
Co-Authored-By: Augustina Ragwitz <auggy@cpan.org>
Change-Id: Id92251243d9e92f30e466419110fce5781304823
servers-detail-resp.json of microversion v2.16 contains some invalid
indents which are made with tabs instead of spaces.
This patch fixes them by replacing with spaces.
Change-Id: I1ee55e7b8ec78bde1d2e6097585b8d3db07d68f2
Change I9b649aafba011d537e3fe4eebef7a678ff6733e4 has added a
compute API to trigger crash dump in instance. This patch adds
the REST API to nova. It enables users to trigger crash dump in
an instance through REST API.
Change-Id: I6ed777ff637254b4b79417008f9055dd19fc7405
Implements: blueprint instance-crash-dump
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
When a compute service fails, the power states of the hosted VMs are not
updated. A normal user querying his or her VMs does not get any indication
about the failure. Also there is no indication about maintenance.
This change will expose new attribute host_status to user querying his
VMs. Attribute is only seen if policy allows.
DocImpact: This adds API microversion
Implements blueprint get-valid-server-state
APIImpact
Change-Id: I5abea08bdc27624a7f23a7db8964f8c2a7b0eaa7
This API samples test was not using testscenarios properly,
and it wasn't extending the correct test class, so it was:
1. Not actually running tests.
2. Not running tests at the correct microversion (v2.13).
This fixes the testscenarios setup for the subclass and the
API samples and templates (since it's not using subs for the
intended project_id that was in the samples).
Also fixes a typo in ApiSampleTestBaseV21.
Change-Id: I27e8fce5d456914d88098c6cfabe05fa8afbc8eb
Closes-Bug: #1534354
Allows soft-affinity and soft-anti-affinity to be used as a policy
for the server group api extension. Add soft policies
to the JSONSchema, which validates server group definitions.
Bump API microversion to 2.15.
Implements: blueprint soft-affinity-for-server-group
Change-Id: I376bdba7df1344d269aa126f4896610baf2e16a2
While the API allows for strings which happen to end in an ID for
flavorRef/imageRef, the common path is really just the ID itself, and
we should have the samples do this. The use of full urls in our
samples makes it seem like this is more meaningful than it really is,
and that you could pass a url to a remote system, for instance, which
won't work at all.
Change-Id: I669619b627f954232712d54498b3744353d25451
nova-cert is only needed for 1 API resource (os-certificates) and the
ec2 api. We don't need to run it on all the other functional
tests. Getting rid of a service start / stop on all of them shaves a
little time off each test, and means noise in logs.
Change-Id: I175b8913fe5d19c8b552c60c793565c042c6b874
The patch I4217bd00d8c253db522241885dba2847a26af6df made the
on_shared_storge flag optional in the compute api in Liberty.
This patch removes the corresponding onSharedStorage flag from the
REST API as nova can easily detect this information.
APIImpact
DocImpact
Implements: bp remove-shared-storage-flag-in-evacuate-api
Change-Id: I54bfa1275e188573c1b95d770d89160a86cdf52c
Instead of having cells service started for every api samples test,
whether or not it is used, only start it on test_cells. This saves
some setup / teardown time, and makes things a bit more explicit.
It also removes the cells service from service listing for a couple of
api samples (az and hosts). That's more indicative of what people will
see in real systems as cells is still a minority and experimental
deploy option.
Change-Id: Ie6d7e8978fd2b3441a141c69d4191266d76e7327
Currently get extension info test runs only for v2.1 and
v2 compatible mode. Because this tests get "os-create-backup"
extension info which does not exsist in v2 as separate extension.
This commit make that test to run to get 'os-agents' extension
info and run that for v2 also.
NOTE- Due to namespace link and updated date used in extension
detail info, we need to keep separate sample for v2 and v2.1
Change-Id: I643d278bf1916df6f5755c094a4ce7956551403e
Currently, command "nova server-group-list" and
"nova server-group-get" doesn't return groups'
project id and user id information. It is really
hard to identify which group belong to which
project/user when admin user use this command
with option "--all-projects".
This patch add project-id and user-id to the list.
All os-server-groups APIs will contain the above
mentioned data in the response data.
DocImpact: This adds API microversion
APIImpact: Project id information will be returned for
os-servers-group API
Change-Id: I0405ed6271c33981578841cfade220758615b1fd
Implements: blueprint add-project-id-and-user-id
Partial-bug: #1481210
Depends-On: I167141676ef4f597a1c022c1fd5dc96fd55d02ad
As extensions options has been deprecated, API sample tests
should run against all extension enable.
This commit enables all extensions for Image API tests and remove its specific
extensions tests and sample files.
Also adds some basic hack to merge all APIs tests for all extension.
Partially implements blueprint api-sample-tests-with-all-extensions
Change-Id: Ib603fbccfdc09b25d4c69c872d79e4cafc30fff5
There is difference in VIF list response for v2 and v2.1.
'net_id' attribute is not present in v2.1 VIF list response and
it was added as new microversion - Ic8b26df8d7e69bd71d23dfbc983fa3449c16fa7d
For v21 compatible mode we should have that attribute in response
to make v21 comp mode behaves same as v2.
Also VIF Extension "OS-EXT-VIF-NET" was removed from v2.1 ext list
in - Ic99ac1179d02d907422911fe1369b64479fd5f33
As we need to add 'OS-EXT-VIF-NET:net_id' in VIF
API response to make that same as v2 one. So ext list should have
"OS-EXT-VIF-NET" extension also to avoid any confusion for user whether
this extension is present for v21 comp mode or not.
This commit adds 'OS-EXT-VIF-NET:net_id' attribute in VIF list
response for v21 compatible mode.
Also adds VIF extension in ext list for v21 comp mode.
NOTE-There is no change in v2.1 API.
Closes-Bug #1496664
Change-Id: I4df76fbf85fbb1e79528a1690692b12a65f07835
This patch cleans up 'v3' in the comments, by replacing 'v3' with 'v2.1'.
Co-Authored-By: Ed Leafe <ed@leafe.com>
Partial-Bug: #1462901
Change-Id: Ia665115e4c8c94b8d7557060201469ea10673558
As sample tests have been merged betweeen v2 and v2.1, we do not need
separate sample files for those.
This commit removes samples files under doc/api_samples/servers_v21/.
This was somehow missed on I2f5a3dcc41e296c3baba6e4ea7e20079df48b43d
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: Iea82e29d3a731e4b8632bf10cc1a365fe511f619
Adds a new microversion to show virtual interface 'net-id' in
virtual interface list.
DocImpact - See nova/api/openstack/rest_api_version_history.rst
for details
APIImpact
Implements blueprint add-vif-net-id-in-vif-list
Change-Id: Ic8b26df8d7e69bd71d23dfbc983fa3449c16fa7d
There are many place where server POST request has been used to tests
other API behavior. There was issue of having duplicate
server POST req and resp sample files in each API sample directory.
we added logic to share those sample files from common place
('servers' sample dir)
As microversion tests also need to share such logic, This commit
extends that logic to work for microversion tests also.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: I3448e1934585c2dabed6c45216ea0513db258b27
All the v2 functional tests have been merged to v2.1. Functional tests
under functional/api_sample_tests/ runs for v2 and v2.1.
This commit removes the already merged tests and sample files which
are left on v2 tests directory.
Extended_ips & Extended_ips_mac tests
- Tested on servers tests as v2.1 contains those without extensions
(test_servers.py)
test_all_extensions_have_samples
- All v2 tests have been merged with v2.1 so this tests not needed
Removed Sample files -
os-extended-floating-ips - Tested with Floating_ips tests
os-extended-rescue-with-image - Tested with rescue tests
all_extensions - Tested with All_extensions tests
os-baremetal-ext-status(doc/ only) - Tested with baremetal node tests
All other supported files like legacy_v2/api_samples_test_base.py
have been removed.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: I47b8ba222eed4bdedca46a037a843a27f5bdc253
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit merges limits functional tests.
There was no functional tests for limits in v2.1
V2 implied RateLimitingMiddleware while V2.1 does not have that
so the response data is different between V2 and V2.1,
there are more info in "rate" section in V2 than V2.1.
We have to keep both of the template files.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: If4fbaaeaa1819083f7f4c460216023ae8f65021d
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit merges used_limits functional tests.
V2 implied RateLimitingMiddleware while V2.1 dropped that from
https://review.openstack.org/#/c/115893/, so the response data is
different between V2 and V2.1, there are more info in "rate" section in
V2 than V2.1. We have to keep both of the template files.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: I3192f550b57694ccb700eebcc0af55468a2f222f
This commit moves "versions" functional tests in v2.1 tests which are
under /v3 directory and run those for v2 and v2.1.
There was no tests for v2.1 version so this patch adds
tests for v2.1 version request.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: Ibd19c5f96679864db4c4c83b8981bac839feafd2
Version show request for both v2 and v2.1 (/v2 and /v2.1) does not
consider the CONF.osapi_compute_link_prefix for buidling links's href.
Above should prepare href using CONF.osapi_compute_link_prefix as done
for other links.
Previously functional tests of specific versions
were not present so it was not caught.
Closes-Bug: 1480009
Change-Id: I54a09d2c56efb0a05832e57313917177b770c8cb
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit merges flavor all_extensions functional tests.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: I1ca95ec4fc11294a8b8d484f54503df14726c2e4
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit merges virtual interface functional tests.
Previously there was no functional tests of virtual interface in v2.1.
There is difference between v2 and v2.1 as extension "OS-EXT-VIF-NET"
is missing in v2.1.
As v2,1 has been released in Kilo, it is too late to fix that difference
in v2.1 base. That fix will go with microversion -
I3caca80a6c010b86150909126f4545425ed99e11
Due to that sample files are different for v2 and v2.1.
In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled to run
merged functional tests for both v2 and v2.1.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: I7097483cb57ed785b01fddb4f832e453f71987fd
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit merges server list multi status functional tests.
There was no test for this in v2.1 so merging these test in test_servers.
In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled to run
merged functional tests for both v2 and v2.1.
Partially implements blueprint test-collapse-v2-and-v21
Change-Id: Ie3bc0f2dab96e642ac9b29a377bab7684a263819
Extension "OS-EXT-VIF-NET" is not ported to v2.1, due to that
there is difference between v2 and v2.1 as mentioned in bug#1470690.
But v2.1 extension-list has "OS-EXT-VIF-NET" extension which convey that
this extension is also loaded for v2.1 and user will get the expected response
according to "OS-EXT-VIF-NET" extension which is not true as this extension
is not actually ported to v2.1.
It is decided that fix for that difference should go in microversion not
in base v2.1 as it is already released.
This patch remove extension "OS-EXT-VIF-NET" from v2.1 extension-list which
will actually convey that this extension is missing in v2.1.
Partial-Bug: 1470690
Depends-On: I3caca80a6c010b86150909126f4545425ed99e11
Change-Id: Ic99ac1179d02d907422911fe1369b64479fd5f33
This patch move the all v2.1 api sample tests under
'functional/api_sample_tests'. Also move sample files under
'doc/api-samples'.
Co-Authored-By: Ed Leafe <ed@leafe.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Partial-Bug: #1462901
Change-Id: I2b924f2ad7687a23a018a9b658e8acd9e04d7963
This patch moves legacy v2 api sample tests under
'nova/tests/functional/api_sample_tests/legacy_v2'
Also create new API sample test base class for matching new
path in 'nova/tests/functional/api_sample_tests/legacy_v2/ -
api_samples_test_base.py'
Change-Id: Ib455d4fc9d1f9a2a7e9a744f7e63086b3cf49c5e
Partial-Bug: #1462901
Introducing new API call for changing the new flag state for forcing
nova-compute state. This is done via adding new forced_down field to the
Service objects and its check in timeout affected service groups drivers.
Blueprint mark-host-down
APIImpact
Change-Id: I39f1a84c100726f87a4dc464dd9922d66efdb53f