'Creates a snapshot.'

@cinder_utils.trace
def create_snapshot(self, snapshot):

    client = self._login()
    try:
        volume_info = client.getVolumeByName(snapshot['volume_name'])
        option = {'inheritAccess': True}
        client.createSnapshot(snapshot['name'], volume_info['id'], option)
    except Exception as ex:
        raise exception.VolumeBackendAPIException(ex)
    finally:
        self._logout(client)
