def init(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        fusionstorIsReady = False
        fusionstorIsReady = lichbd.lichbd_check_cluster_is_ready(
            cmd.monHostnames, cmd.sshUsernames, cmd.sshPasswords)

        if fusionstorIsReady is not True:
            lichbd.lichbd_create_cluster(cmd.monHostnames, cmd.sshPasswords)
            for monHostname in cmd.monHostnames:
                lichbd.lichbd_add_disks(monHostname)

        existing_pools = lichbd.lichbd_lspools()
        for pool in cmd.pools:
            if pool.predefined and pool.name not in existing_pools:
                raise Exception(
                    'cannot find pool[%s] in the fusionstor cluster, you must create it manually'
                    % pool.name)
            elif pool.name not in existing_pools:
                lichbd.lichbd_mkpool(pool.name)

        rsp = InitRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        rsp.userKey = "AQDVyu9VXrozIhAAuT2yMARKBndq9g3W8KUQvw=="
        self._set_capacity_to_response(rsp)

        return jsonobject.dumps(rsp)
예제 #2
0
    def init(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])

        existing_pools = lichbd.lichbd_lspools()
        for pool in cmd.pools:
            if pool.predefined and pool.name not in existing_pools:
                raise Exception('cannot find pool[%s] in the fusionstor cluster, you must create it manually' % pool.name)
            elif pool.name not in existing_pools:
                lichbd.lichbd_mkpool(pool.name)

        rsp = InitRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        self._set_capacity_to_response(rsp)

        return jsonobject.dumps(rsp)
예제 #3
0
    def init(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])

        existing_pools = lichbd.lichbd_lspools()
        for pool in cmd.pools:
            if pool.predefined and pool.name not in existing_pools:
                raise Exception('cannot find pool[%s] in the fusionstor cluster, you must create it manually' % pool.name)
            elif pool.name not in existing_pools:
                lichbd.lichbd_mkpool(pool.name)

        rsp = InitRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        self._set_capacity_to_response(rsp)

        return jsonobject.dumps(rsp)
예제 #4
0
    def init(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        fusionstorIsReady = False
        fusionstorIsReady = lichbd.lichbd_check_cluster_is_ready(cmd.monHostnames, cmd.sshUsernames, cmd.sshPasswords)

        if fusionstorIsReady is not True:
            lichbd.lichbd_create_cluster(cmd.monHostnames, cmd.sshPasswords)
            for monHostname in cmd.monHostnames:
                lichbd.lichbd_add_disks(monHostname)

        existing_pools = lichbd.lichbd_lspools()
        for pool in cmd.pools:
            if pool.predefined and pool.name not in existing_pools:
                raise Exception('cannot find pool[%s] in the fusionstor cluster, you must create it manually' % pool.name)
            elif pool.name not in existing_pools:
                lichbd.lichbd_mkpool(pool.name)

        rsp = InitRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        rsp.userKey = "AQDVyu9VXrozIhAAuT2yMARKBndq9g3W8KUQvw=="
        self._set_capacity_to_response(rsp)

        return jsonobject.dumps(rsp)
예제 #5
0
    def get_facts(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])

        rsp = GetFactsRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        return jsonobject.dumps(rsp)
예제 #6
0
    def get_facts(self, req):
        cmd = jsonobject.loads(req[http.REQUEST_BODY])

        rsp = GetFactsRsp()
        rsp.fsid = lichbd.lichbd_get_fsid()
        return jsonobject.dumps(rsp)