diff options
| author | Rick Harris <rconradharris@gmail.com> | 2011-09-21 03:33:55 +0000 |
|---|---|---|
| committer | Rick Harris <rconradharris@gmail.com> | 2011-09-21 03:33:55 +0000 |
| commit | 9e1f1f91c3c66febcb2d624d32d2a3639f0d0598 (patch) | |
| tree | c599e9e42876e893d7674e61902c1b3e71b26010 /nova/compute | |
| parent | 827d3593452c2892d5076fb0d2548b73a39ab262 (diff) | |
| parent | 67420a537ba6bdf19aaada3ca25be30559965742 (diff) | |
Merging trunk
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 14 | ||||
| -rw-r--r-- | nova/compute/manager.py | 16 |
2 files changed, 27 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index d8657d403..76e1e7a60 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -905,7 +905,7 @@ class API(base.Base): if 'reservation_id' in filters: recurse_zones = True - instances = self.db.instance_get_all_by_filters(context, filters) + instances = self._get_instances_by_filters(context, filters) if not recurse_zones: return instances @@ -930,6 +930,18 @@ class API(base.Base): return instances + def _get_instances_by_filters(self, context, filters): + ids = None + if 'ip6' in filters or 'ip' in filters: + res = self.network_api.get_instance_uuids_by_ip_filter(context, + filters) + # NOTE(jkoelker) It is possible that we will get the same + # instance uuid twice (one for ipv4 and ipv6) + uuids = set([r['instance_uuid'] for r in res]) + filters['uuid'] = uuids + + return self.db.instance_get_all_by_filters(context, filters) + def _cast_compute_message(self, method, context, instance_id, host=None, params=None): """Generic handler for RPC casts to compute. diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 46c643aee..cb5d10f83 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -79,6 +79,9 @@ flags.DEFINE_integer('live_migration_retry_count', 30, flags.DEFINE_integer("rescue_timeout", 0, "Automatically unrescue an instance after N seconds." " Set to 0 to disable.") +flags.DEFINE_integer("resize_confirm_window", 0, + "Automatically confirm resizes after N seconds." + " Set to 0 to disable.") flags.DEFINE_integer('host_state_interval', 120, 'Interval in seconds for querying the host status') @@ -1648,14 +1651,23 @@ class ComputeManager(manager.SchedulerDependentManager): self.driver.poll_rescued_instances(FLAGS.rescue_timeout) except Exception as ex: LOG.warning(_("Error during poll_rescued_instances: %s"), - unicode(ex)) + unicode(ex)) + error_list.append(ex) + + try: + if FLAGS.resize_confirm_window > 0: + self.driver.poll_unconfirmed_resizes( + FLAGS.resize_confirm_window) + except Exception as ex: + LOG.warning(_("Error during poll_unconfirmed_resizes: %s"), + unicode(ex)) error_list.append(ex) try: self._report_driver_status() except Exception as ex: LOG.warning(_("Error during report_driver_status(): %s"), - unicode(ex)) + unicode(ex)) error_list.append(ex) try: |
