コード例 #1
0
ファイル: vif.py プロジェクト: YLTiny/nova
 def unplug_ib_hostdev(self, instance, vif):
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id'])
     vnic_mac = vif['address']
     try:
         nova.privsep.libvirt.unplug_infiniband_vif(fabric, vnic_mac)
     except Exception:
         LOG.exception("Failed while unplugging ib hostdev vif")
コード例 #2
0
 def unplug_mlnx_direct(self, instance, vif):
     vnic_mac = vif['address']
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id'])
     try:
         utils.execute('ebrctl', 'del-port', fabric,
                       vnic_mac, run_as_root=True)
     except processutils.ProcessExecutionError:
         LOG.exception(_LE("Failed while unplugging vif"),
                       instance=instance)
コード例 #3
0
ファイル: vif.py プロジェクト: tuitang00/nova
 def unplug_ib_hostdev(self, instance, vif):
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id']
         )
     vnic_mac = vif['address']
     try:
         utils.execute('ebrctl', 'del-port', fabric, vnic_mac,
                       run_as_root=True)
     except Exception:
         LOG.exception(_("Failed while unplugging ib hostdev vif"))
コード例 #4
0
 def plug_mlnx_direct(self, instance, vif):
     vnic_mac = vif['address']
     device_id = instance.uuid
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id'])
     dev_name = self.get_vif_devname_with_prefix(vif, DEV_PREFIX_ETH)
     try:
         utils.execute('ebrctl', 'add-port', vnic_mac, device_id, fabric,
                       network_model.VIF_TYPE_MLNX_DIRECT, dev_name,
                       run_as_root=True)
     except processutils.ProcessExecutionError:
         LOG.exception(_LE("Failed while plugging vif"), instance=instance)
コード例 #5
0
ファイル: vif.py プロジェクト: YLTiny/nova
 def plug_ib_hostdev(self, instance, vif):
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id'])
     pci_slot = vif['profile']['pci_slot']
     device_id = instance['uuid']
     vnic_mac = vif['address']
     try:
         nova.privsep.libvirt.plug_infiniband_vif(
             vnic_mac, device_id, fabric, network_model.VIF_TYPE_IB_HOSTDEV,
             pci_slot)
     except processutils.ProcessExecutionError:
         LOG.exception("Failed while plugging ib hostdev vif",
                       instance=instance)
コード例 #6
0
ファイル: vif.py プロジェクト: tuitang00/nova
 def plug_ib_hostdev(self, instance, vif):
     fabric = vif.get_physical_network()
     if not fabric:
         raise exception.NetworkMissingPhysicalNetwork(
             network_uuid=vif['network']['id']
         )
     pci_slot = vif['profile']['pci_slot']
     device_id = instance['uuid']
     vnic_mac = vif['address']
     try:
         utils.execute('ebrctl', 'add-port', vnic_mac, device_id,
                       fabric, network_model.VIF_TYPE_IB_HOSTDEV,
                       pci_slot, run_as_root=True)
     except processutils.ProcessExecutionError:
         LOG.exception(_("Failed while plugging ib hostdev vif"),
                       instance=instance)