diff options
author | Dan Smith <dansmith@redhat.com> | 2014-02-19 12:02:45 -0800 |
---|---|---|
committer | Dan Smith <dansmith@redhat.com> | 2014-03-10 12:58:02 -0700 |
commit | 2390857d7ae625dcd18a72b2980f2d862b776623 (patch) | |
tree | f2a0b021f91181d53d64ce231f2fe7f690b6b481 /nova/virt/driver.py | |
parent | 7611173937625023d90c131e3ce4dac05b206c58 (diff) | |
download | nova-2390857d7ae625dcd18a72b2980f2d862b776623.tar.gz |
Make libvirt wait for neutron to confirm plugging before boot
This makes the libvirt driver use the instance event mechanism to
wait for neutron to confirm that VIF plugging is complete before
actually starting the VM.
Here we introduce a new configuration option of vif_plugging_is_fatal
which allows us to control whether a failure to hear back from
neutron is something that should kill the current operation. In
cases where consoles are not provided for the guest, failing is
the only reasonable action, but if consoles *are* provided, it may
be advantageous to still allow the guest to boot and be accessed
out of band.
In order to properly reflect the neutron failure in the instance's
fault property, this also extends manager to catch and re-raise
the VirtualInterfaceCreateException during spawn(). Also, since
the oslo.messaging merge, we weren't declaring expected exceptions
for run_instance() which this also fixes.
DocImpact: This requires a neutron that is aware of these events
when using nova with neutron, or a configuration that
causes nova not to expect/wait for these events.
Related to blueprint admin-event-callback-api
Change-Id: I2f771d8bade513d2e54d98a176069011950830aa
Diffstat (limited to 'nova/virt/driver.py')
-rw-r--r-- | nova/virt/driver.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/virt/driver.py b/nova/virt/driver.py index 5ed9974a7d..4dd1f222d6 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -48,6 +48,16 @@ driver_opts = [ cfg.BoolOpt('use_cow_images', default=True, help='Whether to use cow images'), + cfg.BoolOpt('vif_plugging_is_fatal', + default=True, + help="Fail instance boot if vif plugging fails"), + cfg.IntOpt('vif_plugging_timeout', + default=300, + help='Number of seconds to wait for neutron vif plugging ' + 'events to arrive before continuing or failing (see ' + 'vif_plugging_is_fatal). If this is set to zero and ' + 'vif_plugging_is_fatal is False, events should not ' + 'be expected to arrive at all.'), ] CONF = cfg.CONF |