'Fetch the image from image_service and write it to the volume.'

def copy_image_to_volume(self, context, volume, image_service, image_id):

    LOG.debug('Enter    in    copy    image    to    volume    for    disco.')
    try:
        attach_detach_volume = disco_attach_detach.AttachDetachDiscoVolume(self.configuration)
        device_info = attach_detach_volume._attach_volume(volume)
        image_utils.fetch_to_raw(context, image_service, image_id, device_info['path'], self.configuration.volume_dd_blocksize, size=volume['size'])
    finally:
        attach_detach_volume._detach_volume(volume)
