~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/scheduler/driver.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-08-09 10:12:27 UTC
  • mto: This revision was merged to the branch mainline in revision 107.
  • Revision ID: package-import@ubuntu.com-20130809101227-flqfubhwpot76pob
Tags: upstream-2013.1.3
ImportĀ upstreamĀ versionĀ 2013.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
        # If dest is not specified, have scheduler pick one.
259
259
        if dest is None:
260
260
            instance_type = instance_types.extract_instance_type(instance_ref)
261
 
            if not instance_ref['image_ref']:
262
 
                image = None
263
 
            else:
 
261
            request_spec = {'instance_properties': instance_ref,
 
262
                            'instance_type': instance_type,
 
263
                            'instance_uuids': [instance_ref['uuid']]}
 
264
            if instance_ref['image_ref']:
264
265
                image = self.image_service.show(context,
265
266
                                                instance_ref['image_ref'])
266
 
            request_spec = {'instance_properties': instance_ref,
267
 
                            'instance_type': instance_type,
268
 
                            'instance_uuids': [instance_ref['uuid']],
269
 
                            'image': image}
 
267
                request_spec['image'] = image
270
268
            filter_properties = {'ignore_hosts': ignore_hosts}
271
269
            return self.select_hosts(context, request_spec,
272
270
                                     filter_properties)[0]
339
337
            reason = _("Unable to migrate %(instance_uuid)s to %(dest)s: "
340
338
                       "Lack of memory(host:%(avail)s <= "
341
339
                       "instance:%(mem_inst)s)")
342
 
            raise exception.MigrationError(reason=reason % locals())
 
340
            raise exception.MigrationPreCheckError(reason=reason % locals())
343
341
 
344
342
    def _get_compute_info(self, context, host):
345
343
        """get compute node's information specified by key