'Retrieve the preexisting ports associated with the given instance.
These ports were not created by nova and hence should not be
deallocated upon instance deletion.'

def _get_preexisting_port_ids(self, instance):

    net_info = instance.get_network_info()
    if (not net_info):
        LOG.debug('Instance    cache    missing    network    info.', instance=instance)
    return [vif['id'] for vif in net_info if vif.get('preserve_on_delete')]
