def clean_pg_and_relations_with_instance(self, instance): instance_id = instance.uuid _vmops = self._get_vmops_for_compute_node(instance['node']) vif_ids = self._get_vif_by_instanceid(instance_id) for id in vif_ids: vmwarevif.remove_neutron_relation_pg(_vmops._session, _vmops._cluster, self.pg_vlan_instance_map[id]) self._remove_pg_instance_vlan_relation( self.pg_vlan_instance_map[id], CONF.vmware.relation_files) self.available_pg_vlans.add(self.pg_vlan_instance_map[id].vlan) self.pg_vlan_instance_map.pop(id)
def unplug_vifs(self, instance, network_info, ovsport_info, pg_vlan_instance_map, ignore_errors): """Unplug VIFs from networks.""" for vif in network_info: if vif['id'] in pg_vlan_instance_map: self.unplug_ovs( instance, vif, ovsport_info, pg_vlan_instance_map[ vif['id']]) vmwarevif.remove_neutron_relation_pg( self._session, self._cluster, pg_vlan_instance_map[ vif['id']])
def clean_pg_and_relations_with_instance(self, instance): instance_id = instance.uuid _vmops = self._get_vmops_for_compute_node(instance['node']) vif_ids = self._get_vif_by_instanceid(instance_id) for id in vif_ids: vmwarevif.remove_neutron_relation_pg( _vmops._session, _vmops._cluster, self.pg_vlan_instance_map[id]) self._remove_pg_instance_vlan_relation( self.pg_vlan_instance_map[id], CONF.vmware.relation_files) self.available_pg_vlans.add( self.pg_vlan_instance_map[id].vlan) self.pg_vlan_instance_map.pop(id)