'Copy a  volume to a new image.'

def copy_volume_to_image(self, context, volume, image_service, image_meta):

    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.upload_volume(context, image_service, image_meta, device_info['path'])
    finally:
        attach_detach_volume._detach_volume(volume)
