'New snapshot is created, for a given volume.
:param otype: block type should be provided
:param typename: either volume or consistency-groups should
be provided
:param ouri: uri of volume
:param snaplabel: name of the snapshot
:param inactive: if true, the snapshot will not activate the
synchronization between source and target volumes
:param sync: synchronous request
:param synctimeout: Query for task status for \'synctimeout\' secs.
If the task doesn\'t complete in synctimeout secs,
an exception is thrown'

def snapshot_create(self, otype, typename, ouri, snaplabel, inactive, sync, readonly=False, synctimeout=0):

    is_snapshot_exist = True
    try:
        self.snapshot_query(otype, typename, ouri, snaplabel)
    except common.CoprHdError as e:
        if (e.err_code == common.CoprHdError.NOT_FOUND_ERR):
            is_snapshot_exist = False
        else:
            raise
    if is_snapshot_exist:
        raise common.CoprHdError(common.CoprHdError.ENTRY_ALREADY_EXISTS_ERR, (_('Snapshot    with    name    %(snaplabel)s    already    exists    under    %(typename)s') % {'snaplabel': snaplabel, 'typename': typename}))
    parms = {'name': snaplabel, 'create_inactive': inactive}
    if (readonly is True):
        parms['read_only'] = readonly
    body = oslo_serialization.jsonutils.dumps(parms)
    (s, h) = common.service_json_request(self.ipaddr, self.port, 'POST', Snapshot.URI_SNAPSHOT_LIST.format(otype, typename, ouri), body)
    o = common.json_decode(s)
    task = o['task'][0]
    if sync:
        return common.block_until_complete(otype, task['resource']['id'], task['id'], self.ipaddr, self.port, synctimeout)
    else:
        return o
