Dan Smith [Thu, 17 Nov 2016 17:59:32 +0000 (09:59 -0800)]
Fix detach_interface() call from external event handler
The signature for VirtDriver.detach_interface() changed recently in 41591c9456fd4eb91407551b9b9898e8f4974050, but the call from the
external event handler was not updated. This does that.
Matt Riedemann [Thu, 17 Nov 2016 16:51:00 +0000 (11:51 -0500)]
Log a warning when starting nova-net in non-cellsv1 deployments
We're going to make nova-network fail to start except in cellsv1
deployments before we release Ocata, so log a warning when starting
the service outside of cellsv1. The current plan is to make this
fatal after the o-2 milestone, essentially redoing commit c07046edeee562142c90aa3cadd4bdc47b0a15da.
Trove's CI jobs don't currently work with Neutron due to
bug 1629133 so this is a temporary revert until the Trove CI/infra
networking situation gets sorted out. We have agreement from
the Trove PTL to revert this revert after the o-2 milestone on
2016/12/15.
dineshbhor [Tue, 21 Jun 2016 14:41:13 +0000 (20:11 +0530)]
[PY3] byte/string conversions and enable PY3 test
* The dict.items()[0] will raise a TypeError in PY3,
as dict.items() doesn't return a list any more in PY3
but a view of list.
* Webob response body should be bytes not strings so used
oslo_utils.encodeutils.safe_decode to decode it.
int32bit [Sun, 13 Nov 2016 09:37:14 +0000 (17:37 +0800)]
Fix mock arg list order in test_driver.py
When we use nest patch decorators the mocks, they are passed in to the
decorated function in the same order they applied, this means should be
from the bottom up. Though We have never use these arguments in this
function and the order may not very important, it's a little misleading.
So I think we should fix it.
Dan Smith [Tue, 1 Nov 2016 17:00:07 +0000 (10:00 -0700)]
Make n-net refuse to start unless using CellsV1
At the Barcenlona summit, we discussed disabling n-net everywhere as a
precursor to removal. The only exception for using n-net is as required
for CellsV1 users, which require it as the only out-of-the-box supported
networking option.
We will remove this check and n-net entirely when those users have a
migration path to neutron and cellsv2.
_check_graphics_addresses_can_live_migrate was added to check
whether we can live migrate a VM with VNC/SPICE enabled when:
* libvirt did not allow to change and migrate guest XML with
updated graphics listen addresses. Right now we always can update
VNC/SPICE listen address.
* Destination node was running old-code that does not set the fields.
Currently when live migrating between two versions of OpenStack
(N and N-1) the fields are always set.
Therefore this check is redundant and can be removed.
Going deeper in this code - graphics_listen_addr_vnc and
graphics_listen_addr_spice in libvirt migrate data object are of
type IPAddressField. It means that both need to contain valid IP address.
By default in nova.conf it is 127.0.0.1. It can't be set to None because
IP address is taken from nova.conf and even if set to None it will be
passed as a string 'None' and will fail IPAddressField validation.
graphics_listen_addrs in migration.py currently always returns a dict
which contains IP addresses of both VNC and spice graphics consoles.
This means that:
* check 'if listen_addrs' is always True
* check 'if not listen_addrs' is always False
So we really never passed through 'if not listen_addrs' since
migrate_data is objectified as those addresses are always there.
However, serial_listen_addr is handled different way. The type of
this field in libvirt migrate data object is StringField that might
be set to None or empty string through nova.conf. So we still need
to validate whether serial console can be migrated so that we will
be sure that particular live migration will not break serial console
in case when serial listen address is not configured at destination.
Kevin_Zheng [Fri, 11 Nov 2016 07:05:09 +0000 (15:05 +0800)]
Add microversion cap information
Currently we only publish the master branch of api-ref to:
http://developer.openstack.org/api-ref/compute
and we have microversion caps for different releases.
It will be better for user to understand if we add
also microversion caps information to the doc.
Matt Riedemann [Thu, 10 Nov 2016 23:49:41 +0000 (18:49 -0500)]
neutron: actually populate list in populate_security_groups
We're going to store the list of requested security group objects
in the request spec so the neutron security group driver code
needs to actually populate that list now for use in the compute API.
As the nova-network and neutron security group API code is basically
the same for populating that list, the backend-specific implementations
are removed and pulled up into the base security group driver API class.
Since we don't want to actually try and persist this list with the
instance object in the nova database we need to add a check in the
compute API to store an empty list, like the old behavior, when
creating the instance. A later change will use the populated list
to store in the RequestSpec.
Chris Dent [Tue, 15 Nov 2016 17:14:57 +0000 (17:14 +0000)]
Clarify the approval process of specless blueprints
Add a paragraph which clarifies that a specless blueprint needs to
be approved and the normal process for doing so, with links to
additional information.
Matt Riedemann [Thu, 10 Nov 2016 23:22:37 +0000 (18:22 -0500)]
Add uuid field to SecurityGroup object
We're going to store requested security group objects in the
request spec. nova-network security groups are unique by name
and tenant. Neutron security groups, however, are not unique
by name within a tenant, they are unique by uuid. So to uniquely
store the requested security groups in the request spec we need
to store the neutron-specific id value (which is a uuid) in the
SecurityGroup.uuid field added here.
Since we don't store this in the nova database the uuid value
must be popped during a save() and ignored when creating an
object from a DB primitive.
Matt Riedemann [Mon, 14 Nov 2016 22:33:52 +0000 (17:33 -0500)]
api-ref: body verification for list server migrations
This completes the body verification for listing server
migrations.
Note that the code currently filters such that only in-progress
live migration records are returned. This was also only available
with microversion >= 2.23.
Matt Riedemann [Mon, 14 Nov 2016 21:12:29 +0000 (16:12 -0500)]
api-ref: method verification for server-migrations
We don't have any api-ref for server-migrations. os-migrations
is frozen and server-migrations replaces it, but we don't
have any docs for it, so this is a start.
Chris Dent [Wed, 2 Nov 2016 18:42:21 +0000 (18:42 +0000)]
[placement] Enforce min_unit, max_unit and step_size
Add support for checking min_unit, max_unit and step_size when
making allocations to the placement API. When the constraints are
violated a new exception InvalidAllocationConstraintsViolated is
raised.
Karen Bradshaw [Mon, 10 Oct 2016 18:50:17 +0000 (14:50 -0400)]
API Ref: update server_id params
- Update server_id params to be of type path.
- Cleaned up os-getConsoleOutput action string.
- Made empty response body description more consistent.
Review and change as needed.
Matt Riedemann [Wed, 9 Nov 2016 18:04:34 +0000 (13:04 -0500)]
Transform requested secgroup names to uuids
We currently don't store requested security groups with the instance
(or build request) when using neutron, but we plan on doing that as
part of the cells v2 scheduling interaction and moving the instance
create to conductor. The plan is to store the SecurityGroupList
in the request spec so we can lookup the requested security groups
again later.
In order to avoid a situation where the name changes on a security
group in neutron, we need to store the uuid which is immutable. So
this change transforms any requested security group names to uuids
when using neutron as if the user had only requested uuids.
Nothing is using this yet as populate_security_groups in the
neutron security group driver is basically a no-op, but later
changes will rely on this when storing the security groups in the
request spec.
Matthew Booth [Tue, 19 Jul 2016 09:56:59 +0000 (10:56 +0100)]
libvirt: Cleanup spawn tests
test_spawn_with_network_info:
Convert mox to mock, with the exception of the call to
create_fake_libvirt_mock, which is widely used throughout the
module.
Use ImageBackendFixture.
Replace manual cleanup of created files with tmpdir().
Not entirely sure what this test was testing: it was just executing
the code without asserting very much. The new one is just a
functional replacement.
test_spawn_from_volume_calls_cache:
Split into 3 separate tests.
Convert mox to mock.
Use ImageBackendFixture.
Additionally assert the creation of the ephemeral disk.