def transfer_vhd(session, instance_uuid, host, vdi_uuid, sr_path, seq_num): """Rsyncs a VHD to an adjacent host.""" staging_path = utils.make_staging_area(sr_path) try: utils.prepare_staging_area(sr_path, staging_path, [vdi_uuid], seq_num=seq_num) _rsync_vhds(instance_uuid, host, staging_path) finally: utils.cleanup_staging_area(staging_path)
def transfer_vhd(session, instance_uuid, host, vdi_uuid, sr_path, seq_num): """Rsyncs a VHD to an adjacent host.""" staging_path = utils.make_staging_area(sr_path) try: utils.prepare_staging_area( sr_path, staging_path, [vdi_uuid], seq_num=seq_num) _rsync_vhds(instance_uuid, host, staging_path) finally: utils.cleanup_staging_area(staging_path)
def upload_vhd2(session, vdi_uuids, image_id, endpoint, sr_path, extra_headers, properties, api_version=1): """Bundle the VHDs comprising an image and then stream them into Glance. """ staging_path = utils.make_staging_area(sr_path) try: utils.prepare_staging_area(sr_path, staging_path, vdi_uuids) # TODO(mfedosin): remove this check when v1 is deprecated. if api_version == 1: _upload_tarball_by_url_v1(staging_path, image_id, endpoint, extra_headers, properties) else: _upload_tarball_by_url_v2(staging_path, image_id, endpoint, extra_headers, properties) finally: utils.cleanup_staging_area(staging_path)
def upload_vhd2(session, vdi_uuids, image_id, endpoint, sr_path, extra_headers, properties, api_version=1): """Bundle the VHDs comprising an image and then stream them into Glance""" staging_path = utils.make_staging_area(sr_path) try: utils.prepare_staging_area(sr_path, staging_path, vdi_uuids) # TODO(mfedosin): remove this check when v1 is deprecated. if api_version == 1: _upload_tarball_by_url_v1(staging_path, image_id, endpoint, extra_headers, properties) else: _upload_tarball_by_url_v2(staging_path, image_id, endpoint, extra_headers, properties) finally: utils.cleanup_staging_area(staging_path)