'Create a LUN.
specs - contains volume properties (e.g blocksize, compression).'

def create_lun(self, pool, project, lun, volsize, targetgroup, specs):

    svc = (((('/api/storage/v1/pools/' + pool) + '/projects/') + project) + '/luns')
    arg = {'name': lun, 'volsize': volsize, 'targetgroup': targetgroup, 'initiatorgroup': 'com.sun.ms.vss.hg.maskAll'}
    if specs:
        arg.update(specs)
    ret = self.rclient.post(svc, arg)
    if (ret.status != restclient.Status.CREATED):
        exception_msg = (_('Error    Creating    Volume:    %(lun)s    Size:    %(size)s    Return    code:    %(ret.status)d    Message:    %(ret.data)s.') % {'lun': lun, 'size': volsize, 'ret.status': ret.status, 'ret.data': ret.data})
        LOG.error(exception_msg)
        raise exception.VolumeBackendAPIException(data=exception_msg)
    val = json.loads(ret.data)
    return val
