'Make a cgroup by cgcreate command
:params: cgroup: Maked cgroup name
:return: last cgroup index'

def mk_cgroup_cgcreate(self, pwd=None, cgroup=None):

    try:
        parent_cgroup = self.get_cgroup_name(pwd)
        if (cgroup is None):
            range = 'abcdefghijklmnopqrstuvwxyz0123456789'
            sub_cgroup = ('cgroup-' + ''.join(random.sample((range + range.upper()), 6)))
        else:
            sub_cgroup = cgroup
        if (parent_cgroup is None):
            cgroup = sub_cgroup
        else:
            cgroup = os.path.join(parent_cgroup, sub_cgroup)
        if (self.__get_cgroup_pwd(cgroup) in self.cgroups):
            raise error.TestFail(('%s    exists!' % cgroup))
        cgcreate_cmd = ('cgcreate    -g    %s:%s' % (self.module, cgroup))
        utils.run(cgcreate_cmd, ignore_status=False)
        pwd = self.__get_cgroup_pwd(cgroup)
        self.cgroups.append(pwd)
        return (len(self.cgroups) - 1)
    except error.CmdError:
        raise error.TestFail('Make    cgroup    by    cgcreate    failed!')
