Handle unbound vif plug errors on compute restart
As with change Ia963a093a1b26d90b4de2e8fc623031cf175aece, we can sometimes cache failed port binding information which we'll see on startup. Long term, the fix for both issues is to figure out how this is being cached and stop that happening but for now we simply need to allow the service to start up. To this end, we copy the approach in the aforementioned change and implement a translation function in os_vif_util for unbound which will make the plug_vifs code raise VirtualInterfacePlugException which is what the _init_instance code in ComputeManager is already handling. This has the same caveats as that change, namely that there may be smarter ways to do this that we should explore. However, that change also included a note which goes someway to explaining this. Change-Id: Iaec1f6fd12dba8b11991b7a7595593d5c8b1db50 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Related-bug: #1784579 Closes-bug: #1809136 (cherry picked from commit1def76a1c4
) (cherry picked from commitbc0a5d0355
)
This commit is contained in:
parent
4827cedbc5
commit
79a90d3702
@ -962,11 +962,11 @@ class ComputeManager(manager.Manager):
|
|||||||
LOG.debug(e, instance=instance)
|
LOG.debug(e, instance=instance)
|
||||||
except exception.VirtualInterfacePlugException:
|
except exception.VirtualInterfacePlugException:
|
||||||
# NOTE(mriedem): If we get here, it could be because the vif_type
|
# NOTE(mriedem): If we get here, it could be because the vif_type
|
||||||
# in the cache is "binding_failed". The only way to fix that is to
|
# in the cache is "binding_failed" or "unbound". The only way to
|
||||||
# try and bind the ports again, which would be expensive here on
|
# fix this is to try and bind the ports again, which would be
|
||||||
# host startup. We could add a check to _heal_instance_info_cache
|
# expensive here on host startup. We could add a check to
|
||||||
# to handle this, but probably only if the instance task_state is
|
# _heal_instance_info_cache to handle this, but probably only if
|
||||||
# None.
|
# the instance task_state is None.
|
||||||
LOG.exception('Virtual interface plugging failed for instance. '
|
LOG.exception('Virtual interface plugging failed for instance. '
|
||||||
'The port binding:host_id may need to be manually '
|
'The port binding:host_id may need to be manually '
|
||||||
'updated.', instance=instance)
|
'updated.', instance=instance)
|
||||||
|
@ -482,6 +482,18 @@ def _nova_to_osvif_vif_binding_failed(vif):
|
|||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
|
# VIF_TYPE_UNBOUND = 'unbound'
|
||||||
|
def _nova_to_osvif_vif_unbound(vif):
|
||||||
|
"""Special handler for the "unbound" vif type.
|
||||||
|
|
||||||
|
The "unbound" vif type indicates a port has not been hooked up to backend
|
||||||
|
network driver (OVS, linux bridge, ...). We raise NotImplementedError to
|
||||||
|
indicate to the caller that we cannot handle this type of vif rather than
|
||||||
|
the generic "Unsupported VIF type" error in nova_to_osvif_vif.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
def nova_to_osvif_vif(vif):
|
def nova_to_osvif_vif(vif):
|
||||||
"""Convert a Nova VIF model to an os-vif object
|
"""Convert a Nova VIF model to an os-vif object
|
||||||
|
|
||||||
|
@ -1004,6 +1004,17 @@ class OSVIFUtilTestCase(test.NoDBTestCase):
|
|||||||
subnets=[]),)
|
subnets=[]),)
|
||||||
self.assertIsNone(os_vif_util.nova_to_osvif_vif(vif))
|
self.assertIsNone(os_vif_util.nova_to_osvif_vif(vif))
|
||||||
|
|
||||||
|
def test_nova_to_osvif_vif_unbound(self):
|
||||||
|
vif = model.VIF(
|
||||||
|
id="dc065497-3c8d-4f44-8fb4-e1d33c16a536",
|
||||||
|
type="unbound",
|
||||||
|
address="22:52:25:62:e2:aa",
|
||||||
|
network=model.Network(
|
||||||
|
id="b82c1929-051e-481d-8110-4669916c7915",
|
||||||
|
label="Demo Net",
|
||||||
|
subnets=[]),)
|
||||||
|
self.assertIsNone(os_vif_util.nova_to_osvif_vif(vif))
|
||||||
|
|
||||||
def test_nova_to_osvif_vhostuser_vrouter(self):
|
def test_nova_to_osvif_vhostuser_vrouter(self):
|
||||||
vif = model.VIF(
|
vif = model.VIF(
|
||||||
id="dc065497-3c8d-4f44-8fb4-e1d33c16a536",
|
id="dc065497-3c8d-4f44-8fb4-e1d33c16a536",
|
||||||
|
Loading…
Reference in New Issue
Block a user