'Wrapper utility that returns an image created from the server.'

@classmethod
def create_image_from_server(cls, server_id, **kwargs):

    name = kwargs.pop('name', data_utils.rand_name((cls.__name__ + '-image')))
    wait_until = kwargs.pop('wait_until', None)
    wait_for_server = kwargs.pop('wait_for_server', True)
    image = cls.compute_images_client.create_image(server_id, name=name, **kwargs)
    image_id = data_utils.parse_image_id(image.response['location'])
    cls.images.append(image_id)
    if (wait_until is not None):
        try:
            waiters.wait_for_image_status(cls.compute_images_client, image_id, wait_until)
        except lib_exc.NotFound:
            if (wait_until.upper() == 'ACTIVE'):
                server = cls.servers_client.show_server(server_id)['server']
                if ('fault' in server):
                    raise exceptions.SnapshotNotFoundException(server['fault'], image_id=image_id)
                else:
                    raise exceptions.SnapshotNotFoundException(image_id=image_id)
            else:
                raise
        image = cls.compute_images_client.show_image(image_id)['image']
        if (wait_until.upper() == 'ACTIVE'):
            if wait_for_server:
                waiters.wait_for_server_status(cls.servers_client, server_id, 'ACTIVE')
    return image
