Example #1
0
 def unplug_ivs_ethernet(self, instance, vif):
     """Unplug the VIF by deleting the port from the bridge."""
     try:
         linux_net.delete_ivs_vif_port(self.get_vif_devname(vif))
     except processutils.ProcessExecutionError:
         LOG.exception(_LE("Failed while unplugging vif"),
                       instance=instance)
Example #2
0
 def unplug_ivs_ethernet(self, instance, vif):
     """Unplug the VIF by deleting the port from the bridge."""
     try:
         linux_net.delete_ivs_vif_port(self.get_vif_devname(vif))
     except processutils.ProcessExecutionError:
         LOG.exception(_LE("Failed while unplugging vif"),
                       instance=instance)
Example #3
0
    def unplug_ivs_hybrid(self, instance, vif):
        """UnPlug using hybrid strategy (same as OVS)

        Unhook port from IVS, unhook port from bridge, delete
        bridge, and delete both veth devices.
        """
        try:
            br_name = self.get_br_name(vif['id'])
            v1_name, v2_name = self.get_veth_pair_names(vif['id'])

            utils.execute('brctl', 'delif', br_name, v1_name, run_as_root=True)
            utils.execute('ip', 'link', 'set', br_name, 'down',
                          run_as_root=True)
            utils.execute('brctl', 'delbr', br_name, run_as_root=True)
            linux_net.delete_ivs_vif_port(v2_name)
        except processutils.ProcessExecutionError:
            LOG.exception(_LE("Failed while unplugging vif"),
                          instance=instance)
Example #4
0
    def unplug_ivs_hybrid(self, instance, vif):
        """UnPlug using hybrid strategy (same as OVS)

        Unhook port from IVS, unhook port from bridge, delete
        bridge, and delete both veth devices.
        """
        try:
            br_name = self.get_br_name(vif['id'])
            v1_name, v2_name = self.get_veth_pair_names(vif['id'])

            utils.execute('brctl', 'delif', br_name, v1_name, run_as_root=True)
            utils.execute('ip',
                          'link',
                          'set',
                          br_name,
                          'down',
                          run_as_root=True)
            utils.execute('brctl', 'delbr', br_name, run_as_root=True)
            linux_net.delete_ivs_vif_port(v2_name)
        except processutils.ProcessExecutionError:
            LOG.exception(_LE("Failed while unplugging vif"),
                          instance=instance)