diff options
author | Balazs Gibizer <gibi@redhat.com> | 2022-07-15 13:48:46 +0200 |
---|---|---|
committer | Balazs Gibizer <gibi@redhat.com> | 2022-09-08 09:19:16 +0200 |
commit | e43bf900dc8ca66578603bed333c56b215b1876e (patch) | |
tree | c23f6fc1af2445efcb0d0636d4788c89fa7c1f24 /nova/compute | |
parent | f8c91eb75fc5504a37fc3b4be1d65d33dbc9b511 (diff) | |
download | nova-e43bf900dc8ca66578603bed333c56b215b1876e.tar.gz |
Gracefully ERROR in _init_instance if vnic_type changed
If the vnic_type of a bound port changes from "direct" to "macvtap" and
then the compute service is restarted then during _init_instance nova
tries to plug the vif of the changed port. However as it now has macvtap
vnic_type nova tries to look up the netdev of the parent VF. Still that
VF is consumed by the instance so there is no such netdev on the host
OS. This error killed the compute service at startup due to unhandled
exception. This patch adds the exception handler, logs an ERROR and
continue initializing other instances on the host.
Also this patch adds a detailed ERROR log when nova detects that the
vnic_type changed during _heal_instance_info_cache periodic.
Closes-Bug: #1981813
Change-Id: I1719f8eda04e8d15a3b01f0612977164c4e55e85
Diffstat (limited to 'nova/compute')
-rw-r--r-- | nova/compute/manager.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 021c6f9d44..667455215c 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1247,6 +1247,20 @@ class ComputeManager(manager.Manager): 'updated.', instance=instance) self._set_instance_obj_error_state(instance) return + except exception.PciDeviceNotFoundById: + # This is bug 1981813 where the bound port vnic_type has changed + # from direct to macvtap. Nova does not support that and it + # already printed an ERROR when the change is detected during + # _heal_instance_info_cache. Now we print an ERROR again and skip + # plugging the vifs but let the service startup continue to init + # the other instances + LOG.exception( + 'Virtual interface plugging failed for instance. Probably the ' + 'vnic_type of the bound port has been changed. Nova does not ' + 'support such change.', + instance=instance + ) + return if instance.task_state == task_states.RESIZE_MIGRATING: # We crashed during resize/migration, so roll back for safety |