Commit Graph

43231 Commits

Author SHA1 Message Date
Dan Smith c8e3cbc4d1 Prevent us from sleeping during DB retry tests
Unit tests should never *actually* sleep. Some of the DB API tests
that poke the retry wrapper in oslo.db trigger situations that would
call time.sleep(). This is part of a desirable exponential backoff
timer in oslo.db, but there's no reason to actually wait to call
the next mock in a unit test. So, mock out sleep for those tests.
Before this, the single-thread time to run test_db_api was 289s,
and afterwards it is 133s.

Change-Id: I0492b497000585f079691ae863b2b2ebf078795d
2016-09-30 11:49:17 -07:00
Jenkins d98712d76a Merge "Report actual request_spec when MaxRetriesExceeded raised" 2016-09-30 11:41:35 +00:00
Jenkins 0705a796ad Merge "Remove stale pyc files when running the cover job" 2016-09-30 10:17:26 +00:00
Jenkins 56097b2792 Merge "conf: Improve consistency in scheduler opts" 2016-09-30 10:12:37 +00:00
Wenzhi Yu 1a80c8899d Report actual request_spec when MaxRetriesExceeded raised
If a MaxRetriesExceeded exception is raised by
scheduler_utils.populate_retry then request_spec will be empty in the
exception handler[1], then _set_vm_state_and_notify method will just
put a empty dict as request_spec into the payload of notification[2].
It would make more sense if we report the actual value of request_spec
in the notification.

[1]https://github.com/openstack/nova/blob/13.0.0.0rc3/nova/conductor/manager.py#L382
[2]https://github.com/openstack/nova/blob/13.0.0.0rc3/nova/scheduler/utils.py#L109

Simply moving the initialization of request_spec up one line before the
call to populate_retry should fix the issue.

Change-Id: I7c51f635d52f368c8df549f62024cbdf64a032b3
Closes-Bug: #1575998
2016-09-30 09:59:19 +08:00
Jenkins da7c5059a6 Merge "VMware: deprecate wsdl_location conf option" 2016-09-29 23:50:11 +00:00
Jenkins 3d6d719d14 Merge "Use gabbi inner_fixtures for better error capture" 2016-09-29 22:25:07 +00:00
Jenkins d5f113de34 Merge "libvirt: ignore conflict when defining network filters" 2016-09-29 14:18:17 +00:00
Jenkins 33dd4d827b Merge "Remove deprecated flag in neutron.py" 2016-09-29 12:50:51 +00:00
Jenkins 99d0b9f183 Merge "conf: Cleanup of glance.py" 2016-09-29 12:05:03 +00:00
Chris Dent f6b72255a6 Use gabbi inner_fixtures for better error capture
Upgrade to gabbi 1.26.1 to use the new inner_fixtures feature to
capture log and stdout/stderr per individual test request. The
existing nova fixtures are used for the capture.

Depends-On: Ic13dc14f62334aefbcced93872ec564cab157898
Change-Id: Ic6f5a50df37b4680a60c4aa94f7587aec232c367
2016-09-29 11:53:18 +00:00
Jenkins 61af70a734 Merge "Improve help text for glance options" 2016-09-29 09:50:19 +00:00
Stephen Finucane 62555e2632 conf: Cleanup of glance.py
- Fix indentation
- Add 'min' parameter to 'num_retries' configuration option. Users have
  been warned about this since 2014

Change-Id: Icf1bdc2b9331cfb2f5a699f626c25ebb6d7648b2
2016-09-29 09:11:51 +00:00
Jenkins a997c96670 Merge "Updated from global requirements" 2016-09-29 03:10:07 +00:00
Jenkins cf842fb638 Merge "Ignore BuildRequest during an instance reschedule" 2016-09-29 03:09:24 +00:00
Jenkins 5dc9b6b3a5 Merge "libvirt: support user password settings in virtuozzo" 2016-09-29 00:26:53 +00:00
OpenStack Proposal Bot cd997580f8 Updated from global requirements
Change-Id: I76fbd2fd7164ad837fa782161a3e9a8f84ac0e79
2016-09-29 00:08:21 +00:00
Jenkins 00b349ba09 Merge "libvirt: Use the recreated disk.config.rescue during a rescue" 2016-09-28 23:15:51 +00:00
Mikhail Feoktistov 4445d48471 libvirt: support user password settings in virtuozzo
Libvirt has "domainSetUserPassword" callback and virtuozzo driver
has an implementation for it. So in this patch we allow to use this
functionality for virtuozzo hypervisor.

Change-Id: Ia398afadfd9fd9544c5d843338ab25c0930d9f74
Implements: blueprint virtuozzo-instance-admin-password
2016-09-28 18:46:26 +00:00
Jenkins 1fe03feb49 Merge "Let schema validate image metadata type and key lengths" 2016-09-28 17:44:34 +00:00
Jenkins b722632bb7 Merge "Stop overwriting thread local context in ClientRouter" 2016-09-28 16:51:24 +00:00
Andrew Laski 9b090aeb7e Ignore BuildRequest during an instance reschedule
When booting an instance there is logic in the conductor to check if a
delete has been issued. This is done by looking for a BuildRequest
object and discontinuing the build if it's not found. However the
conductor then deletes the BuildRequest so a reschedule attempt will not
find the BuildRequest object. This incorrectly stops the reschedule.

The filter_properties dict is updated with the number of scheduling
attempts for each reschedule so by looking at the value found there we
know if a reschedule is being attempted. If that's the case then bypass
the logic that checks for, and deletes, the BuildRequest object.

Change-Id: Ibf28d1d8f54703b465ccc497281419356cd0136e
Closes-Bug: 1628530
2016-09-28 12:13:35 -04:00
Jenkins 99dfd75eeb Merge "Add a post-test-hook to run the archive command" 2016-09-28 15:42:20 +00:00
Matt Riedemann 4f6f239efd Remove stale pyc files when running the cover job
The cover job runs the unit tests and having stale
pycs can skew those results, so remove the pyc files
before running the tests with --coverage.

Change-Id: I7393d2df36e715dbf53ba9ae6a077bdc8e79b5a5
2016-09-28 11:27:38 -04:00
Jenkins c95b012887 Merge "test:Remove unused method _test_get_test_network_info" 2016-09-28 15:02:27 +00:00
Jenkins 02576d0237 Merge "libvirt: fixes python 3 related unit tests" 2016-09-28 13:59:08 +00:00
Jenkins baab09c4b5 Merge "Fix CONTAINER_FORMATS_ALL to have ova insteadk of vmdk" 2016-09-28 13:45:07 +00:00
Dan Smith 6f988105ac Add a post-test-hook to run the archive command
The archive_deleted_rows command in nova-manage is often-broken and
not well tested by us. We can test it to some degree in functional tests,
but running it against a real database with real deleted stuff in it
is a good idea. This adds a post-test hook and runs the archive so that
after a full test run in the gate, we'll see the output. Later, we should
make a failed run of this fatal, but for now, just run it so we can see
how close we are to being able to gate on it.

Change-Id: I16b2e00eede6af455cb74ca4e6ca951d56fdbcbc
2016-09-28 13:28:55 +00:00
Jenkins d115b896ea Merge "Fix database poison warnings, part 14" 2016-09-28 13:20:39 +00:00
Jenkins 12ac2e76c2 Merge "Fix database poison warnings, part 15" 2016-09-28 13:19:55 +00:00
Jenkins 1426f15217 Merge "use proper context in libvirt driver unit test" 2016-09-28 13:19:11 +00:00
Jenkins ebb3b93fb2 Merge "Fix a few typos in API reference" 2016-09-28 12:05:47 +00:00
Jenkins 78eb5efd35 Merge "Fix database poison warnings, part 18" 2016-09-28 12:01:24 +00:00
Jenkins f34b1c911a Merge "Fix database poison warnings, part 17" 2016-09-28 11:58:46 +00:00
Jenkins e727b0ee80 Merge "Fix database poison warnings, part 16" 2016-09-28 11:51:12 +00:00
Jenkins 25be6a1e13 Merge "libvirt: pick future min libvirt/qemu versions" 2016-09-28 11:49:27 +00:00
Hironori Shiina 935bea2045 Fix a few typos in API reference
Change-Id: Ib90100f4ec6b4b03f27ed39166caeb9bdf5bc24c
2016-09-28 14:34:23 +09:00
Jenkins de82d98333 Merge "Hyper-V: Adds Hyper-V UEFI Secure Boot" 2016-09-27 21:51:42 +00:00
Matt Riedemann c5915eb0cd Let schema validate image metadata type and key lengths
The check_img_metadata_properties_quota validation method not
only checks quota for image metadata but also the type of the
metadata object in the request (dict) and the key length of
the metadata items in the dict - such that they were between length
1 and 255.

The metadata schema property handles all of that validation for
us so we don't need to do it in python, which was probably a carry
over from the legacy v2 API which didn't use json schema validation.

Now that the legacy v2 API code is gone, we can remove the explicit
python code checks in check_img_metadata_properties_quota and just
let the schema validator do it's job.

Change-Id: Ibec92e278887cd06e91687ca91e75f9b7b28098c
2016-09-27 17:41:15 -04:00
Dan Smith ceaf853894 Archive instance-related rows when the parent instance is deleted
This is something I expect has been very broken for a long time. We
have rows in tables such as instance_extra, instance_faults, etc that
pertain to a single instance, and thus have a foreign key on their
instance_uuid column that points to the instance. If any of those
records exist, an instance can not be archived out of the main
instances table.

The archive routine currently "handles" this by skipping over said
instances, and eventually iterating over all the tables to pull out
any records that point to that instance, thus freeing up the instance
itself for archival. The problem is, this only happens if those extra
records are actually marked as deleted themselves. If we fail during
a cleanup routine and leave some of them not marked as deleted, but
where the instance they reference *is* marked as deleted, we will
never archive them.

This patch adds another phase of the archival process for any table
that has an "instance_uuid" column, which attempts to archive records
that point to these deleted instances. With this, using a very large
real world sample database, I was able to archive my way down to
zero deleted, un-archivable instances (from north of 100k).

Closes-Bug: #1622545
Change-Id: I77255c77780f0c2b99d59a9c20adecc85335bb18
2016-09-27 12:08:21 -07:00
Diana Clarke e71f706e56 Fix database poison warnings, part 18
The following warning appears in the unit test logs a number of times.

    "UserWarning: This test uses methods that set internal oslo_db
state, but it does not claim to use the database. This will conflict
with the setup of tests that do use the database and cause failures
later."

This patch fixes all the warnings from:

    nova.tests.unit.api.openstack.compute.test_instance_actions.py

Note that this warning is only emitted once per unit test worker, so new
offenders will show up in the logs each time you fix a test until they
are all gone.

Change-Id: I4ed976cac15de31fe975b7a15496bf2f2faea40b
Related-Bug: #1568414
2016-09-27 14:06:40 -04:00
Daniel P. Berrange 9dc07a23ea libvirt: pick future min libvirt/qemu versions
The libvirt driver currently requires libvirt 1.2.1
and QEMU 1.5.3. In the Newton cycle we did not
announce any version bump for Ocata, so that will
not change.

This patch announces a version bump that will be
done in the Pike release, with predicted min versions
setting libvirt to 1.2.9 and QEMU to 2.1.0. These
are the versions present in Debian Jessie.

Out of the major distros currently supported, this
would eliminate support for:

 - Ubuntu Trusty. Workaround: enable the "Cloud Archive"
   the addon repository
 - SLES 12. Workaround: upgrade to 12SP1
 - RHEL 7.1. Workaround: upgrade to 7.2 or newer

Change-Id: I4a644aabf193d79c81e8fdae46e5def3526f78d4
2016-09-27 18:10:32 +01:00
Jenkins 7b2cb0dc03 Merge "Add functional regression test for bug 1595962" 2016-09-27 16:47:28 +00:00
Maciej Szankin 6832a417c9 conf: Improve consistency in scheduler opts
* Updated header flags
* Moved opts to lists
* Improved indentation
* Removed not needed sections
* Updated unit tests

Change-Id: Icdcf839b6d28893694bfa1355e9dbe8dbb5ea8c3
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Blueprint centralize-config-options-ocata
2016-09-27 14:35:05 +00:00
Diana Clarke 8c753e9a84 Fix database poison warnings, part 17
The following warning appears in the unit test logs a number of times.

    "UserWarning: This test uses methods that set internal oslo_db
state, but it does not claim to use the database. This will conflict
with the setup of tests that do use the database and cause failures
later."

This patch fixes all the warnings from:

    nova.tests.unit.api.openstack.compute.test_serversV21.py

Note that this warning is only emitted once per unit test worker, so new
offenders will show up in the logs each time you fix a test until they
are all gone.

Change-Id: I88264e54fd135e56612ae3066e1c160f6643f9c4
Related-Bug: #1568414
2016-09-27 10:14:06 -04:00
Jenkins 69784047ea Merge "Updated from global requirements" 2016-09-27 12:53:49 +00:00
Jenkins d15e6b35d6 Merge "Fix typo in docsting in test_migrations.py" 2016-09-27 11:27:51 +00:00
OpenStack Proposal Bot c5c24f16c9 Updated from global requirements
Change-Id: I791c1957289f9a934661ba13f9d6c4ad657074a3
2016-09-27 10:04:27 +00:00
Diana Clarke 2f670bf40c Fix database poison warnings, part 16
The following warning appears in the unit test logs a number of times.

    "UserWarning: This test uses methods that set internal oslo_db
state, but it does not claim to use the database. This will conflict
with the setup of tests that do use the database and cause failures
later."

This patch fixes all the warnings from:

    nova.tests.unit.api.openstack.compute.test_shelve.py

Note that this warning is only emitted once per unit test worker, so new
offenders will show up in the logs each time you fix a test until they
are all gone.

Change-Id: I39cca6587f99cfe6f980b6d8fe857618fac6bb5a
Related-Bug: #1568414
2016-09-26 21:22:47 -04:00
Matt Riedemann 29dab997b4 Hyper-V: Adds Hyper-V UEFI Secure Boot
Hyper-V supports UEFI SecureBoot since the 2012 R2 version
for Windows guests and this has been extended to Linux
guests as well with the upcoming release. This blueprint
implements UEFI SecureBoot for Linux guests.

DocImpact: The nova flavor extra specs docs needs to be updated
to include 'os:secure_boot' and its possible values. The
image metadata property docs needs to be updated to include
"os_secure_boot" property and its possible values.

Co-Authored-By: Claudiu Belu <cbelu@cloudbasesolutions.com>

Implements: blueprint hyper-v-uefi-secureboot

Change-Id: I1ea96930018d997820df2b7b4640fe1f241ee8d6
2016-09-26 20:14:43 -04:00