@classmethod
def create_image_from_server(cls, server_id, **kwargs):
    'Wrapper utility that returns an image created from the server.\n\n        If compute microversion >= 2.36, the returned image response will\n        be from the image service API rather than the compute image proxy API.\n        '
    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)
    if api_version_utils.compare_version_header_to_response('OpenStack-API-Version', 'compute 2.45', image.response, 'lt'):
        image_id = image['image_id']
    else:
        image_id = data_utils.parse_image_id(image.response['location'])
    if (not cls.is_requested_microversion_compatible('2.35')):
        client = cls.images_client
    else:
        client = cls.compute_images_client
    cls.addClassResourceCleanup(test_utils.call_and_ignore_notfound_exc, client.delete_image, image_id)
    if (wait_until is not None):
        try:
            wait_until = wait_until.upper()
            if (not cls.is_requested_microversion_compatible('2.35')):
                wait_until = wait_until.lower()
            waiters.wait_for_image_status(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 = client.show_image(image_id)
        if ('image' in image):
            image = image['image']
        if (wait_until.upper() == 'ACTIVE'):
            if wait_for_server:
                waiters.wait_for_server_status(cls.servers_client, server_id, 'ACTIVE')
    return image
Wrapper utility that returns an image created from the server.

If compute microversion >= 2.36, the returned image response will
be from the image service API rather than the compute image proxy API.
@classmethod
def create_image_from_server(cls, server_id, **kwargs):
    'Wrapper utility that returns an image created from the server.\n\n        If compute microversion >= 2.36, the returned image response will\n        be from the image service API rather than the compute image proxy API.\n        '
    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)
    if api_version_utils.compare_version_header_to_response('OpenStack-API-Version', 'compute 2.45', image.response, 'lt'):
        image_id = image['image_id']
    else:
        image_id = data_utils.parse_image_id(image.response['location'])
    if (not cls.is_requested_microversion_compatible('2.35')):
        client = cls.images_client
    else:
        client = cls.compute_images_client
    cls.addClassResourceCleanup(test_utils.call_and_ignore_notfound_exc, client.delete_image, image_id)
    if (wait_until is not None):
        try:
            wait_until = wait_until.upper()
            if (not cls.is_requested_microversion_compatible('2.35')):
                wait_until = wait_until.lower()
            waiters.wait_for_image_status(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 = client.show_image(image_id)
        if ('image' in image):
            image = image['image']
        if (wait_until.upper() == 'ACTIVE'):
            if wait_for_server:
                waiters.wait_for_server_status(cls.servers_client, server_id, 'ACTIVE')
    return image