Do not live migrate instance with non-NIC PCI device

Nova does not support live migration for an instance with a
non-NIC PCI device. Updating the VIM to avoid triggering live
migrations for these instances - the pci_passthrough:alias
extra spec indicates that there is a non-NIC PCI device.

Change-Id: Ieb0d4b4537c9fca8498b4c40af28183494fa03c7
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Bart Wensley 2018-05-17 07:36:41 -05:00 committed by Al Bailey
parent 49ddf1710d
commit e64b5fe7cb
2 changed files with 12 additions and 1 deletions

View File

@ -1 +1 @@
TIS_PATCH_VER=74
TIS_PATCH_VER=75

View File

@ -288,6 +288,9 @@ def instance_supports_live_migration(instance_data):
"""
Determine if the instance supports live-migration
"""
# Live migration is not supported if there is a pci-passthrough or
# pci-sriov NIC.
nics = instance_data.get('wrs-if:nics', [])
for nic in nics:
nic_name, nic_data = six.next(six.iteritems(nic))
@ -295,6 +298,14 @@ def instance_supports_live_migration(instance_data):
if vif_model in ['pci-passthrough', 'pci-sriov']:
return False
# Live migration is not supported if there is an attached pci passthrough
# device.
flavor = instance_data['flavor']
flavor_data_extra = flavor.get('extra_specs', None)
if flavor_data_extra is not None:
if 'pci_passthrough:alias' in flavor_data_extra:
return False
return True