~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/virt/libvirt/connection.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-01-20 11:54:15 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: package-import@ubuntu.com-20120120115415-h2ujma9o536o1ut6
Tags: upstream-2012.1~e3~20120120.12170
ImportĀ upstreamĀ versionĀ 2012.1~e3~20120120.12170

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
 
79
79
FLAGS = flags.FLAGS
80
80
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
 
81
flags.DECLARE('vncserver_proxyclient_address', 'nova.vnc')
81
82
# TODO(vish): These flags should probably go into a shared location
82
83
flags.DEFINE_string('rescue_image_id', None, 'Rescue ami image')
83
84
flags.DEFINE_string('rescue_kernel_id', None, 'Rescue aki image')
268
269
 
269
270
    def list_instances(self):
270
271
        return [self._conn.lookupByID(x).name()
271
 
                for x in self._conn.listDomainsID()]
 
272
                for x in self._conn.listDomainsID()
 
273
                if x != 0]  # We skip domains with ID 0 (hypervisors).
272
274
 
273
275
    @staticmethod
274
276
    def _map_to_instance_info(domain):
781
783
                    return graphic.getAttribute('port')
782
784
 
783
785
        port = get_vnc_port_for_instance(instance['name'])
784
 
        token = str(uuid.uuid4())
785
 
        host = instance['host']
 
786
        host = FLAGS.vncserver_proxyclient_address
786
787
 
787
 
        return {'token': token, 'host': host, 'port': port}
 
788
        return {'host': host, 'port': port, 'internal_access_path': None}
788
789
 
789
790
    @staticmethod
790
791
    def _cache_image(fn, target, fname, cow=False, *args, **kwargs):
1186
1187
            xml_info['config_drive'] = xml_info['basepath'] + "/disk.config"
1187
1188
 
1188
1189
        if FLAGS.vnc_enabled and FLAGS.libvirt_type not in ('lxc', 'uml'):
1189
 
            xml_info['vncserver_host'] = FLAGS.vncserver_host
 
1190
            xml_info['vncserver_listen'] = FLAGS.vncserver_listen
1190
1191
            xml_info['vnc_keymap'] = FLAGS.vnc_keymap
1191
1192
        if not rescue:
1192
1193
            if instance['kernel_id']:
1713
1714
                             FLAGS.live_migration_bandwidth)
1714
1715
 
1715
1716
        except Exception:
1716
 
            recover_method(ctxt, instance_ref, dest, block_migration)
1717
 
            raise
 
1717
            with utils.save_and_reraise_exception():
 
1718
                recover_method(ctxt, instance_ref, dest, block_migration)
1718
1719
 
1719
1720
        # Waiting for completion of live_migration.
1720
1721
        timer = utils.LoopingCall(f=None)