Matt Riedemann [Wed, 23 Nov 2016 01:44:53 +0000 (20:44 -0500)]
Add TODO for returning a 202 from the volume attach API
Attaching a volume is an RPC cast from the API node to the
compute node, so we should return a 202 instead of a 200
in the response. Making that change would break Tempest though
which expects a 200 response code, and we have several other
APIs with similar response code issues:
http://paste.openstack.org/show/590154/
So this just adds a TODO for the same bucket of issues which
we'll probably need to handle in a single microversion.
Dan Smith [Thu, 3 Nov 2016 17:50:26 +0000 (10:50 -0700)]
Refactor two nearly useless secgroup tests
There are two tests that masquerade as "compute api tests" to
validate some instance security group associations. However, those
are just there because it's a convenient place to create instances
with a full complement of things. They depend on behaviors we're
about to move, and are also slated to be irrelevant when we remove
nova-network. In the meantime, move them closer to the other tests
for the bits they are exercising to get them out of the way of
the following patch.
Gábor Antal [Mon, 10 Oct 2016 16:14:52 +0000 (18:14 +0200)]
Transform instance.create notification
We don't need image_name as an extra usage information, because
in the versioned notification, we have image_uuid which can be used
to get the name of the image from glance, if needed.
Change-Id: I1f3ea8d74a2e59049447c3045a293ce0babfb427
Implements: bp versioned-notification-transformation-ocata
int32bit [Fri, 18 Nov 2016 16:08:12 +0000 (00:08 +0800)]
Add index on instances table across project_id and updated_at
We should have an index on the instances.updated_at table because
that's what's used to filter instances when using the --changes-since
filter parameter with nova list.
Use byte string or utf8 depending on python version for wsgi
A recent change to the wsgi code broke deployments running over
httpd/mod_wsgi. This is because for py2.X mod_wsgi accepts byte
strings and breaks with utf8. However, for py3.X, utf8 is
accepted. So this acts accordingly.
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.
Claudiu Belu [Thu, 17 Nov 2016 11:10:06 +0000 (13:10 +0200)]
hyper-v: wait for neutron vif plug events
During spawn, the Hyper-V driver should wait for the Neutron
VIF plug events before starting the instance, in order to ensure
that the VIFs are already bound and the guest will be able to
send DHCP requests.
The configuration option "vif_plugging_timeout" will determine
the maximum amount of time to wait for the Neutron events.
Setting the configuration option "vif_plugging_is_fatal" to True
will cause an exception to be raised during spawn, if the Hyper-V
driver did not receive needed Neutron port bound events.
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.
Dan Smith [Mon, 7 Nov 2016 18:39:16 +0000 (10:39 -0800)]
Store security groups in RequestSpec
This adds a security_groups field to the RequestSpec object so
that we can communicate those as part of the request to other
services. Historically this has been a formal RPC parameter to
compute (and later conductor), which was a list of string names.
Putting it here in the request spec means that we can easily
pass a list of real objects, and that we can persist them with
the request spec for later reconstruction of the original request
when appropriate, such as for a rebuild operation.
_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.