def download_image(self, context, session, instance, image_id): params = {} params['image_id'] = image_id params['uuid_stack'] = vm_utils._make_uuid_stack() params['sr_path'] = vm_utils.get_sr_path(session) params['torrent_seed_duration'] = CONF.xenserver.torrent_seed_duration params['torrent_seed_chance'] = CONF.xenserver.torrent_seed_chance params['torrent_max_last_accessed'] = \ CONF.xenserver.torrent_max_last_accessed params['torrent_listen_port_start'] = \ CONF.xenserver.torrent_listen_port_start params['torrent_listen_port_end'] = \ CONF.xenserver.torrent_listen_port_end params['torrent_download_stall_cutoff'] = \ CONF.xenserver.torrent_download_stall_cutoff params['torrent_max_seeder_processes_per_host'] = \ CONF.xenserver.torrent_max_seeder_processes_per_host lookup_fn = self._lookup_torrent_url_fn() params['torrent_url'] = lookup_fn(image_id) vdis = session.call_plugin_serialized( 'bittorrent', 'download_vhd', **params) return vdis
def download_image(self, context, session, instance, image_id): params = {} params['image_id'] = image_id params['uuid_stack'] = vm_utils._make_uuid_stack() params['sr_path'] = vm_utils.get_sr_path(session) params['torrent_seed_duration'] = CONF.xenserver.torrent_seed_duration params['torrent_seed_chance'] = CONF.xenserver.torrent_seed_chance params['torrent_max_last_accessed'] = \ CONF.xenserver.torrent_max_last_accessed params['torrent_listen_port_start'] = \ CONF.xenserver.torrent_listen_port_start params['torrent_listen_port_end'] = \ CONF.xenserver.torrent_listen_port_end params['torrent_download_stall_cutoff'] = \ CONF.xenserver.torrent_download_stall_cutoff params['torrent_max_seeder_processes_per_host'] = \ CONF.xenserver.torrent_max_seeder_processes_per_host lookup_fn = self._lookup_torrent_url_fn() params['torrent_url'] = lookup_fn(image_id) vdis = session.call_plugin_serialized('bittorrent', 'download_vhd', **params) return vdis
def _make_params(self, context, session, image_id): return { 'image_id': image_id, 'sr_path': vm_utils.get_sr_path(session), 'extra_headers': glance.generate_identity_headers(context) }
def _make_params(self, context, session, image_id): return {'image_id': image_id, 'sr_path': vm_utils.get_sr_path(session), 'extra_headers': glance.generate_identity_headers(context)}