Since the refactor of the device detach logic in nova libvirt virt driver[1] detaching a port that is backed by a PF hostdev is not possible.
Probably [1] missed extending the LibvirtConfigGuestHostdevPCI class with an alias field.
[1] https://review.opendev.org/q/topic:bug/1882521
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server [None req-08fdb8e4-94e6-4cdd-98a4-736715cbc2b1 admin admin] Exception during message handling: AttributeError: 'LibvirtConfigGuestHostdevPCI' object has no attribute 'alias'
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/exception_wrapper.py", line 71, in wrapped
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server _emit_versioned_exception_notification(
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self.force_reraise()
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server raise self.value
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/exception_wrapper.py", line 63, in wrapped
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server return f(self, context, *args, **kw)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/utils.py", line 1433, in decorated_function
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server return function(self, context, *args, **kwargs)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/manager.py", line 211, in decorated_function
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server compute_utils.add_instance_fault_from_exc(context,
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self.force_reraise()
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server raise self.value
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/manager.py", line 200, in decorated_function
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server return function(self, context, *args, **kwargs)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/manager.py", line 7893, in detach_interface
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server do_detach_interface(context, instance, port_id)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_concurrency/lockutils.py", line 360, in inner
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server return f(*args, **kwargs)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/manager.py", line 7891, in do_detach_interface
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self._detach_interface(context, instance, port_id)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/compute/manager.py", line 7934, in _detach_interface
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self.driver.detach_interface(context, instance, condemned)
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2793, in detach_interface
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self._detach_with_retry(
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2334, in _detach_with_retry
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server self._detach_from_live_with_retry(
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2387, in _detach_from_live_with_retry
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server attempt + 1, max_attempts, device_name, live_dev.alias,
Sep 01 14:26:40 master0 nova-compute[3382639]: ERROR oslo_messaging.rpc.server AttributeError: 'LibvirtConfigGuestHostdevPCI' object has no attribute 'alias'
Fix proposed to branch: master /review. opendev. org/c/openstack /nova/+ /806943
Review: https:/