'Create a snapshot.'

def create_snapshot(self, snapshot):

    LOG.debug('snapshot:    %s', snapshot.__dict__)
    LOG.debug('snapshot    id:    %s', snapshot['id'])
    LOG.debug('volume_metadata:    %s', snapshot.volume['metadata'])
    volume_metadata = snapshot.volume['metadata']
    LOG.debug('lun_naa:    %s', volume_metadata['LUNNAA'])
    lun_naa = volume_metadata['LUNNAA']
    src_lun = self.api_executor.get_lun_info(LUNNAA=lun_naa)
    lun_index = src_lun.find('LUNIndex').text
    LOG.debug('LUNIndex:    %s', lun_index)
    create_snapshot_name = self._create_snapshot_name(lun_index)
    LOG.debug('create_snapshot_name:    %s', create_snapshot_name)
    self.api_executor.create_snapshot_api(lun_index, create_snapshot_name)
    max_wait_sec = 600
    try_times = 0
    snapshot_id = ''
    while True:
        created_snapshot = self.api_executor.get_snapshot_info(lun_index=lun_index, snapshot_name=create_snapshot_name)
        if (created_snapshot is not None):
            snapshot_id = created_snapshot.find('snapshot_id').text
        try_times = (try_times + 3)
        eventlet.sleep(self.TIME_INTERVAL)
        if ((try_times > max_wait_sec) or (created_snapshot is not None)):
            break
    LOG.debug('created_snapshot:    %s', created_snapshot)
    LOG.debug('snapshot_id:    %s', snapshot_id)
    _metadata = snapshot['metadata']
    _metadata['snapshot_id'] = snapshot_id
    _metadata['SnapshotName'] = create_snapshot_name
    return {'metadata': _metadata}
