diff options
| author | Rick Harris <rconradharris@gmail.com> | 2012-02-08 06:52:14 +0000 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2012-02-09 09:34:17 -0500 |
| commit | f33de5c9ad6217a9daa1bafd8f1d3e71f618dda2 (patch) | |
| tree | ee87897a6e8b2b6b1c045505eb4bce3ab51de20e /nova/virt | |
| parent | 1815aaf13af1c5d6d4225fa0f8f4adb2b10548e6 (diff) | |
Fix confirm_resize policy handling
Fixes bug 928649
markwash:
- fixed pep8 violation
Change-Id: Ie1c3136256dac0e350e430ac7c69eba4cb98b158
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 30d77369b..bdbd7d101 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -1372,8 +1372,22 @@ class VMOps(object): "older than %(confirm_window)d seconds") % migrations_info) for migration in migrations: - LOG.info(_("Automatically confirming migration %d"), migration.id) - self.compute_api.confirm_resize(ctxt, migration.instance_uuid) + LOG.info(_("Automatically confirming migration %d"), + migration['id']) + try: + instance = self.compute_api.get(ctxt, migration.instance_uuid) + except exception.InstanceNotFound: + LOG.warn(_("Instance for migration %d not found, skipping"), + migration.id) + + # NOTE(sirp): setting to error so we don't keep trying to auto + # confirm this resize + db.migration_update( + ctxt, migration['id'], {'status': 'error'}) + + continue + else: + self.compute_api.confirm_resize(ctxt, instance) def get_info(self, instance): """Return data about VM instance.""" |
