'Creates a snapshot.'

@debugger
def create_snapshot(self, snapshot):

    snap_name = snapshot['name']
    display_list = [getattr(snapshot, 'display_name', ''), getattr(snapshot, 'display_description', '')]
    snap_description = ':'.join(filter(None, display_list))
    snap_description = snap_description[:254]
    (pool, project, volume_name) = self._get_pool_project_volume_name(snapshot['volume'])
    volume = {'blockSize': TEGILE_DEFAULT_BLOCK_SIZE, 'datasetPath': ('%s/%s/%s' % (pool, TEGILE_LOCAL_CONTAINER_NAME, project)), 'local': 'true', 'name': volume_name, 'poolName': ('%s' % pool), 'projectName': ('%s' % project), 'protocol': self._protocol, 'thinProvision': 'true', 'volSize': (snapshot['volume']['size'] * units.Gi)}
    params = list()
    params.append(volume)
    params.append(snap_name)
    params.append(False)
    LOG.info('Creating    snapshot    for    volume_name=%(vol)s    snap_name=%(name)s    snap_description=%(desc)s', {'vol': volume_name, 'name': snap_name, 'desc': snap_description})
    self._api_executor.send_api_request('createVolumeSnapshot', params)
