def start_chassis(): """ """ global conf global ssh1 global ssh2 global chassis conf = fixtures.ChassisConfig().get_chassis_info() conf["data"]["pn"] = "What_ever_SN" conf["data"]["sn"] = "What_ever_SN" conf["data"]["psu1_pn"] = "A380-B737-C909" node0_log = "/tmp/qemu_node0.log" node1_log = "/tmp/qemu_node1.log" compute_0 = conf["nodes"][0]["compute"] compute_0["storage_backend"][0]["drives"][0][ "file"] = fixtures.a_boot_image compute_0["extra_option"] = "-D {} -trace events=/tmp/trace_items".format( node0_log) compute_0["ntb"] = [{ "addr": 'a.0', "bus": "pcie.0", "bar1_exp": 15, "bar2_exp": 15, "id": "ntb0", "peer_id": "ntb1" }] compute_1 = conf["nodes"][1]["compute"] compute_1["storage_backend"][0]["drives"][0][ "file"] = fixtures.b_boot_image compute_1["extra_option"] = "-D {} -trace events=/tmp/trace_items".format( node1_log) compute_1["ntb"] = [{ "addr": 'a.0', "bus": "pcie.0", "bar1_exp": 15, "bar2_exp": 15, "id": "ntb1", "peer_id": "ntb0" }] if os.path.exists(node0_log): os.remove(node0_log) if os.path.exists(node1_log): os.remove(node1_log) chassis = model.CChassis(conf["name"], conf) chassis.precheck() chassis.init() data_file_dir = os.path.join( ChassisWorkspace(conf).get_workspace_data(), "oem_data.json") with open(data_file_dir, "w") as f: json.dump(data_file, f) chassis.start() ssh1 = helper.prepare_ssh(nodes_ip[0], 8022) ssh2 = helper.prepare_ssh(nodes_ip[1], 8022)
def init(self): self.workspace = ChassisWorkspace(self.__chassis) nodes = self.__chassis.get("nodes") if nodes is None: raise InfraSimError("There is no nodes under chassis") for node in nodes: node_name = node.get("name", "{}_node_{}".format(self.__chassis_name, nodes.index(node))) node["name"] = node_name node["type"] = self.__chassis["type"] self.workspace.init() self.__file_name = os.path.join(self.workspace.get_workspace_data(), "shm_data.bin") self.__daemon = CChassisDaemon(self.__chassis_name, self.__file_name)
def start_chassis(): """ """ global conf global ssh global chassis conf = fixtures.ChassisConfig().get_chassis_info() conf["data"]["pn"] = "What_ever_SN" conf["data"]["sn"] = "What_ever_SN" conf["data"]["psu1_pn"] = "A380-B737-C909" node0_log = "/tmp/qemu_node0.log" node1_log = "/tmp/qemu_node1.log" compute_0 = conf["nodes"][0]["compute"] compute_0["storage_backend"][0]["drives"][0][ "file"] = fixtures.a_boot_image compute_0["extra_option"] = "-D {} -trace events=/tmp/trace_items".format( node0_log) compute_1 = conf["nodes"][1]["compute"] compute_1["storage_backend"][0]["drives"][0][ "file"] = fixtures.b_boot_image compute_1["extra_option"] = "-D {} -trace events=/tmp/trace_items".format( node1_log) if os.path.exists(node0_log): os.remove(node0_log) if os.path.exists(node1_log): os.remove(node1_log) chassis = model.CChassis(conf["name"], conf) chassis.precheck() chassis.init() data_file_dir = os.path.join( ChassisWorkspace(conf).get_workspace_data(), "oem_data.json") with open(data_file_dir, "w") as f: json.dump(data_file, f) chassis.start() ssh = helper.prepare_ssh("192.168.188.92", 8022)