'Create consistency group of GPFS volumes.'

def _create_consistencygroup(self, context, group):

    cgname = ('consisgroup-%s' % group['id'])
    fsdev = self._gpfs_device
    cgpath = os.path.join(self.configuration.gpfs_mount_point_base, cgname)
    try:
        self.gpfs_execute((self.GPFS_PATH + 'mmcrfileset'), fsdev, cgname, '--inode-space', 'new')
    except processutils.ProcessExecutionError as e:
        msg = (_('Failed    to    create    consistency    group:    %(cgid)s.    Error:    %(excmsg)s.') % {'cgid': group['id'], 'excmsg': six.text_type(e)})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    try:
        self.gpfs_execute((self.GPFS_PATH + 'mmlinkfileset'), fsdev, cgname, '-J', cgpath)
    except processutils.ProcessExecutionError as e:
        msg = (_('Failed    to    link    fileset    for    the    share    %(cgname)s.    Error:    %(excmsg)s.') % {'cgname': cgname, 'excmsg': six.text_type(e)})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    try:
        self.gpfs_execute('chmod', '770', cgpath)
    except processutils.ProcessExecutionError as e:
        msg = (_('Failed    to    set    permissions    for    the    consistency    group    %(cgname)s.    Error:    %(excmsg)s.') % {'cgname': cgname, 'excmsg': six.text_type(e)})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    model_update = {'status': fields.GroupStatus.AVAILABLE}
    return model_update
