diff options
| author | Josh Kearney <josh@jk0.org> | 2011-03-24 04:10:57 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-03-24 04:10:57 +0000 |
| commit | af22892a2b1dc413f7d11c2f6efe2f820e3257ed (patch) | |
| tree | dd7d9530d5dd80ddb7584a3f6e75d90266f06bf0 /nova/compute | |
| parent | 20d77ea69bde623cf50531647d9d20ffc7e4bc88 (diff) | |
| parent | 10e61af8a23c126c15fcfcf25156d32facf19ec2 (diff) | |
Offers the ability to run a periodic_task that sweeps through rescued instances older than 24 hours and forcibly unrescues them.
Flag added: rescue_timeout (default is 0 - disabled)
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index ac63f68ea..432270467 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -65,8 +65,11 @@ flags.DEFINE_string('console_host', socket.gethostname(), 'Console proxy host to use to connect to instances on' 'this host.') flags.DEFINE_integer('live_migration_retry_count', 30, - ("Retry count needed in live_migration." - " sleep 1 sec for each count")) + "Retry count needed in live_migration." + " sleep 1 sec for each count") +flags.DEFINE_integer("rescue_timeout", 0, + "Automatically unrescue an instance after N seconds." + " Set to 0 to disable.") LOG = logging.getLogger('nova.compute.manager') @@ -132,6 +135,12 @@ class ComputeManager(manager.Manager): """ self.driver.init_host(host=self.host) + def periodic_tasks(self, context=None): + """Tasks to be run at a periodic interval.""" + super(ComputeManager, self).periodic_tasks(context) + if FLAGS.rescue_timeout > 0: + self.driver.poll_rescued_instances(FLAGS.rescue_timeout) + def _update_state(self, context, instance_id): """Update the state of an instance from the driver info.""" # FIXME(ja): include other fields from state? |
