~soren/nova/lp658257

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Tarmac
  • Author(s): Michael Gundlach
  • Date: 2010-10-05 18:58:37 UTC
  • mfrom: (295.1.22 servers_api)
  • Revision ID: hudson@openstack.org-20101005185837-wb2sq7zy5swxa9q7
Replace model.Instance.ec2_id with an integer internal_id so that both APIs can represent the ID to external users.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    def run_instance(self, context, instance_id, **_kwargs):
68
68
        """Launch a new instance with specified options."""
69
69
        instance_ref = self.db.instance_get(context, instance_id)
70
 
        if instance_ref['ec2_id'] in self.driver.list_instances():
 
70
        if instance_ref['internal_id'] in self.driver.list_instances():
71
71
            raise exception.Error("Instance has already been created")
72
72
        logging.debug("instance %s: starting...", instance_id)
73
73
        project_id = instance_ref['project_id']
129
129
            raise exception.Error(
130
130
                    'trying to reboot a non-running'
131
131
                    'instance: %s (state: %s excepted: %s)' %
132
 
                    (instance_ref['ec2_id'],
 
132
                    (instance_ref['internal_id'],
133
133
                     instance_ref['state'],
134
134
                     power_state.RUNNING))
135
135
 
151
151
 
152
152
        if FLAGS.connection_type == 'libvirt':
153
153
            fname = os.path.abspath(os.path.join(FLAGS.instances_path,
154
 
                                                 instance_ref['ec2_id'],
 
154
                                                 instance_ref['internal_id'],
155
155
                                                 'console.log'))
156
156
            with open(fname, 'r') as f:
157
157
                output = f.read()