@atomic.action_timer("cinder.upload_volume_to_image")
    def _upload_volume_to_image(self, volume, force=False,
                                container_format="bare", disk_format="raw"):
        resp, img = volume.upload_to_image(force, self.generate_random_name(),
                                           container_format, disk_format)
        # NOTE (e0ne): upload_to_image changes volume status to uploading so
        # we need to wait until it will be available.
        volume = bench_utils.wait_for(
            volume,
            ready_statuses=["available"],
            update_resource=bench_utils.get_from_manager(),
            timeout=CONF.benchmark.cinder_volume_create_timeout,
            check_interval=CONF.benchmark.cinder_volume_create_poll_interval
        )
        image_id = img["os-volume_upload_image"]["image_id"]
        image = self.clients("glance").images.get(image_id)
        image = bench_utils.wait_for(
            image,
            ready_statuses=["active"],
            update_resource=bench_utils.get_from_manager(),
            timeout=CONF.benchmark.glance_image_create_timeout,
            check_interval=CONF.benchmark.glance_image_create_poll_interval
        )

        return image
Upload the given volume to image.
dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/scenarios/cinder/utils.py/CinderScenario._upload_volume_to_image