'Discover resources to monitor.
instance_get_all will return all instances if last_run is None,
and will return only the instances changed since the last_run time.'

def discover(self, manager, param=None):

    try:
        instances = self.nova_cli.instance_get_all(self.last_run)
    except Exception:
        return []
    for instance in instances:
        if (getattr(instance, 'OS-EXT-STS:vm_state', None) in ['deleted', 'error']):
            self.instances.pop(instance.id, None)
        else:
            self.instances[instance.id] = instance
    self.last_run = timeutils.utcnow(True).isoformat()
    resources = []
    for instance in self.instances.values():
        addresses = instance.addresses.get(self.conf.hardware.tripleo_network_name)
        if (addresses is None):
            continue
        try:
            ip_address = addresses[0].get('addr')
            final_address = self._make_resource_url(ip_address)
            resource = {'resource_id': instance.id, 'resource_url': final_address, 'mac_addr': addresses[0].get('OS-EXT-IPS-MAC:mac_addr'), 'image_id': instance.image['id'], 'flavor_id': instance.flavor['id']}
            resources.append(resource)
        except KeyError:
            LOG.error(("Couldn't    obtain    IP    address    of    instance    %s" % instance.id))
    return resources
