As of now, in most of the test cases, uuidsentinel is used for
generating a UUID except at some places where uuid4() is used.
In order to maintain consistency, we propose to use uuidsentinel
module for generating UUIDs throughout the test cases.
There are some cases where unique UUIDs are required. For such
cases, generate_uuid() from oslo_utils.uuidutils is used.
As of now, in most of the test cases, uuidsentinel is used for
generating a UUID except at some places where uuid4() is used.
In order to maintain consistency, we propose to use uuidsentinel
module for generating UUIDs throughout the test cases.
There are some cases where unique UUIDs are required. For such
cases, generate_uuid() from oslo_utils.uuidutils is used.
As of now, in most of the test cases, uuidsentinel is used for
generating a UUID except at some places where uuid4() is used.
In order to maintain consistency, we propose to use uuidsentinel
module for generating UUIDs throughout the test cases.
There are some cases where unique UUIDs are required. For such
cases, generate_uuid() from oslo_utils.uuidutils is used.
Dan Smith [Mon, 28 Nov 2016 15:24:21 +0000 (07:24 -0800)]
Check deleted flag in Instance.create()
An attempt to create an instance with the deleted flag set will
not work as intended, especially from instance.create(), which
can't properly pass the yet-to-be-determined deleted=id protocol.
This makes Instance.create() throw an error like the one for
being already created, and fixes the one test where we depend
on this working.
Markus Zoeller [Tue, 22 Nov 2016 16:08:14 +0000 (17:08 +0100)]
libvirt: Acquire TCP ports for console during live migration
During a live migration process we reserve serial ports on
destination host and update domain XML during migration to
use the new reserved ports from destination.
If the migration succeeds we release ports on the source host.
If the migration fails we release reserved ports on the
destination host.
Roman Podoliaka [Thu, 3 Nov 2016 10:51:48 +0000 (12:51 +0200)]
vif: allow for creation of multiqueue taps in vrouter
This extends the work done in libvirt-virtio-net-multiqueue bp to
allow for enabling multiqueue mode for vrouter VIFs (OpenContrail).
In case of vrouter mechanism is slightly different and a tap device
created by nova-compute must already be in the multiqueue mode,
when it's passed to vrouter.
Implements blueprint vif-vrouter-multiqueue
Co-Authored-By: Michal Dubiel <md@semihalf.com>
Change-Id: I7b20650c8a772fdaa05707e0dfe27ad32481a2d3
In virtuozzo 7 we have changed disk bus from sata to scsi.
Sata is not supported in virtuozzo 7.
We don't need to support sata bus for virtuozzo in nova.
Virtuozzo 6 may work with python 2.6 only and
it's not possible to run upstream nova on virtuozzo 6.
We always use this patch in our internal infrastructure
to run openstack on virtuozzo 7.
Also in this patch we have changed tests for hypervisor version.
We don't need to check libvirt version in case of Virtuozzo hypervisor.
Because Virtuozzo 7 always has libvirt with
support of 'parallels' virt type.
Host.get_connection() does 2 types of job when initialising a new
connection:
1. Register event handling callbacks on the connection itself.
2. Call the _set_host_enabled in the driver to enable/disable the
compute service.
The first is essential to run before the connection is used for
anything. The second needs only to run eventually once the connection
is established.
This patch creates a new helper thread which runs connection up/down
callbacks asynchronously to the caller. This means that the caller of
get_connection() returns as soon as the connection is usable, and the
driver callback happens concurrently. This is a minor improvement
currently, but will be more useful when we add additional work to the
connection up/down event. It also means that the callback runs without
holding _wrapped_conn_lock, which it doesn't need. This means the
callback itself can call get_connection() without deadlocking, and use
the connection which was just initialised.
In updating the callback logic, we also fix a minor bug: previously we
would not generate down/up events if we detected a failed connection
and succeeded creating a new one on the first attempt. This is
currently only of limited importance, as we are only marking the
service down or up for the scheduler, but could be more significant
when we add additional work to the callback.
This patch is preparation step to move the instance creation to
the conductor. The goal is to move out the instance.create call from
the _provision_instances method.
The _provision_instances method return value is changed
from list of instances to the tuple containing a list of build_requests
and RequestSpec object. We also return the instance_mapping list so
that we can properly clean up residue if we fail to create in the caller.
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Implements: bp cells-scheduling-interaction
Change-Id: I60abcd4f27dc877c4e420071be77c9fdb697ad99
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 [Tue, 15 Nov 2016 12:22:31 +0000 (13:22 +0100)]
Transform instance.create.error notification
Along with the transformation changes, I modified notify_about_instance_action
method so it can handle errors now. (It wraps the exception object into an
ExceptionPayload.)
Implements: bp versioned-notification-transformation-ocata
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
Markus Zoeller [Tue, 22 Nov 2016 15:58:57 +0000 (16:58 +0100)]
libvirt: prepare domain XML update for serial ports
The serial console feature uses "ports" on a compute node to enable
a websocket connection. On a host, one port can only be used by one
single instance. If another instance gets live-migrated to that host,
an update of the ports in the domain XML is needed. Otherwise we will
get an exception from libvirt/qemu which states:
Failed to bind socket: Cannot assign requested address
This change here *prepares* the update of the domain XML. Another change
is necessary which actually provides the ports to use for this update
function within the LibvirtLiveMigrateData object.
This change is a preparation for the fix of bug 1455252.
Chris Dent [Thu, 10 Nov 2016 18:00:35 +0000 (18:00 +0000)]
[placement] increase gabbi coverage of handlers.allocation
A case where a non-existent resource provider in an allocation PUT
request could raise a 400 was not covered. Now it is.
This still leave a ConcurrentUpdateDetected exception (which can
lead to 409) not covered. There's no simple way to cause such a
thing from a gabbi test.
libvirt: do not return serial address if disabled on destination
During live migration, the check on the destination host is returning
the address of serial proxy even if disabled. However, the absence of
this serial address is the signal the source node needs to know to
determine if the target node supports the serial console feature.
The absence of the serial_listen_addr is specified by the value None.
This makes it also necessary to *not* do a string conversion of None,
as this (maybe surprisingly) results in the string 'None'. The string
'None' however is *not* a valid serial_listen_addr value, as this
must be a valid IP address. The reason for this is, that this value
is used to update the domain XML of the libvirt guest.
This change is also a preparation for the fix of bug 1455252.
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.
Matt Riedemann [Tue, 8 Nov 2016 16:22:42 +0000 (11:22 -0500)]
libvirt: handle os-brick InvalidConnectorProtocol on init
On init the LibvirtDriver imports it's volume drivers into
a registry for later access during volume operations. Several
of the libvirt volume drivers are using os-brick for the connector.
os-brick can raise an exception when loading a connector class
under certain conditions, e.g. s390x + ISER is not a supported
mapping in os-brick. This in turn causes the LibvirtDriver to
fail to load which causes nova-compute to crash.
This change handles the os-brick specific InvalidConnectorProtocol
exception when importing volume drivers, logs a debug message but
doesn't fail to init the LibvirtDriver.
As part of this change the driver_dict_from_config helper method
is integrated with the _get_volume_drivers method as that was
the only thing using it, and it's cleaner if those are just a
single method.
Jay Pipes [Mon, 31 Oct 2016 12:58:38 +0000 (08:58 -0400)]
placement: adds ResourceClass.get_by_name()
The next patch in this series adds the ability to delete a custom
resource class. In order to implement that, we need a method to return a
single objects.ResourceClass object by string name. This patch adds that
method, implemented by using the resource class cache in a transparent
manner.
Jay Pipes [Fri, 14 Oct 2016 22:21:17 +0000 (18:21 -0400)]
placement: adds ResourceClass.create()
Adds in the implementation of objects.ResourceClass.create() with checks
that the custom resource class being added doesn't overlap with any
standard (or previously-added custom) resource classes. The
implementation uses a hard-coded number 10000 to mark the start of
custom resource class integer identifiers to make it easy to
differentiate custom resource classes. Note that we do NOT increment the
object version here because nothing as-yet calls the ResourceClass
object.
Also note that this patch adds a required "CUSTOM_" namespace prefix to
all custom resource classes. Followup patches will also place this
constraint into the JSONSchema for POST /resource_classes. The CUSTOM_
namespace is required in order to ensure that custom resource class
names never conflict with future standard resource class additions.
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.