~nova-coresec/nova/ppa-lucid

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Soren Hansen
  • Date: 2010-10-14 21:26:14 UTC
  • mfrom: (195.1.85 ubuntu-packaging)
  • Revision ID: soren.hansen@rackspace.com-20101014212614-ioz32fe7oleepk4j
Merge ubuntu packaging branch.

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['str_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['str_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['str_id'],
 
154
                                                 instance_ref['internal_id'],
155
155
                                                 'console.log'))
156
156
            with open(fname, 'r') as f:
157
157
                output = f.read()
174
174
        instance_ref = self.db.instance_get(context, instance_id)
175
175
        dev_path = yield self.volume_manager.setup_compute_volume(context,
176
176
                                                                  volume_id)
177
 
        yield self.driver.attach_volume(instance_ref['str_id'],
 
177
        yield self.driver.attach_volume(instance_ref['ec2_id'],
178
178
                                        dev_path,
179
179
                                        mountpoint)
180
180
        self.db.volume_attached(context, volume_id, instance_id, mountpoint)
189
189
                      volume_id)
190
190
        instance_ref = self.db.instance_get(context, instance_id)
191
191
        volume_ref = self.db.volume_get(context, volume_id)
192
 
        yield self.driver.detach_volume(instance_ref['str_id'],
 
192
        yield self.driver.detach_volume(instance_ref['ec2_id'],
193
193
                                        volume_ref['mountpoint'])
194
194
        self.db.volume_detached(context, volume_id)
195
195
        defer.returnValue(True)