'Makes REST API call to create volume under a project.
:param project_name: name of the project under which the volume
will be created
:param label: name of volume
:param size: size of volume
:param varray: name of varray
:param vpool: name of vpool
:param sync: synchronous request
:param consistencygroup: To create volume under a consistencygroup
:param synctimeout: Query for task status for \'synctimeout\' secs.
If the task doesn\'t complete in synctimeout secs,
an exception is thrown
:returns: Created task details in JSON response payload'

def create(self, project_name, label, size, varray, vpool, sync, consistencygroup, synctimeout=0):

    proj_obj = project.Project(self.ipaddr, self.port)
    project_uri = proj_obj.project_query(project_name)
    vpool_obj = virtualpool.VirtualPool(self.ipaddr, self.port)
    vpool_uri = vpool_obj.vpool_query(vpool, 'block')
    varray_obj = virtualarray.VirtualArray(self.ipaddr, self.port)
    varray_uri = varray_obj.varray_query(varray)
    request = {'name': label, 'size': size, 'varray': varray_uri, 'project': project_uri, 'vpool': vpool_uri, 'count': 1}
    if consistencygroup:
        request['consistency_group'] = consistencygroup
    body = oslo_serialization.jsonutils.dumps(request)
    (s, h) = common.service_json_request(self.ipaddr, self.port, 'POST', Volume.URI_VOLUMES, body)
    o = common.json_decode(s)
    if sync:
        if (len(o['task']) > 0):
            task = o['task'][0]
            return self.check_for_sync(task, sync, synctimeout)
        else:
            raise common.CoprHdError(common.CoprHdError.SOS_FAILURE_ERR, _('error:    task    list    is    empty,    no    task    response    found'))
    else:
        return o
