'Snapshot a server.
:param server: The :class:`Server` (or its ID) to share onto.
:param image_name: Name to give the snapshot image
:param metadata: Metadata to give newly-created image entity
:returns: An instance of novaclient.base.StrWithMeta
(The snapshot image\'s UUID)'

def create_image(self, server, image_name, metadata=None):

    body = {'name': image_name, 'metadata': (metadata or {})}
    (resp, body) = self._action_return_resp_and_body('createImage', server, body)
    if (self.api_version >= api_versions.APIVersion('2.45')):
        image_uuid = body['image_id']
    else:
        location = resp.headers['location']
        image_uuid = location.split('/')[(-1)]
    return base.StrWithMeta(image_uuid, resp)
