'Try to clone a volume from an image, and check status afterwards.
NOTE: if clone_error is True we force the image type to raw otherwise
clone_image is not called'

def _create_volume_from_image(self, expected_status, raw=False, clone_error=False):

    if raw:
        image_id = '155d900f-4e14-4e4c-a73d-069cbf4541e6'
    else:
        image_id = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
    db_volume = {'display_description': 'Test    Desc', 'size': 20, 'status': 'creating', 'availability_zone': 'fake_zone', 'attach_status': fields.VolumeAttachStatus.DETACHED, 'host': 'dummy'}
    volume = objects.Volume(context=self.context, **db_volume)
    volume.create()
    try:
        if (not clone_error):
            self.volume.create_volume(self.context, volume, request_spec={'image_id': image_id})
        else:
            self.assertRaises(exception.CinderException, self.volume.create_volume, self.context, volume, request_spec={'image_id': image_id})
        volume = objects.Volume.get_by_id(self.context, volume.id)
        self.assertEqual(expected_status, volume.status)
    finally:
        volume.destroy()
