Ejemplo n.º 1
0
    def data(self):
        # Populate Clusto                                                                                                       
        ServerClass("Class 5")
        HostState("up")
        h1 = Class5Server("hostname1.lindenlab.com")
        h1.serial_number = "SM55880"
        h1.set_port_attr("nic-eth", 1, "mac", "aa:bb:cc:11:22:33")
        h1.set_port_attr("nic-eth", 2, "mac", "aa:bb:cc:11:22:34")

        dfw = LindenDatacenter("DFW", "1234 Anywhere", "123 Anywhere street", "*****@*****.**")

        rack1 = LindenRack("c1.01.1000")
        dfw.insert(rack1)

        pdu = LindenPDU()
        pdu.set_port_attr("nic-eth", 1, "mac", "aa:bb:cc:11:22:12")
        pdu.hostname = "pdu1.lindenlab.com"
        pdu.connect_ports("pwr-nema-5",1,h1,1)

        rack1.attach_pdu(pdu)
        rack1.insert(h1, 1)
Ejemplo n.º 2
0
    def data(self):
        # Populate Clusto
        ServerClass("Class 5")
        HostState("up")
        h1 = Class5Server("hostname1.lindenlab.com")
        h1.serial_number = "SM55880"
        h1.set_port_attr("nic-eth", 1, "mac", "aa:bb:cc:11:22:33")
        h1.set_port_attr("nic-eth", 2, "mac", "aa:bb:cc:11:22:34")

        dfw = LindenDatacenter("DFW", "1234 Anywhere", "123 Anywhere street", "*****@*****.**")
        phx = LindenDatacenter("PHX", "1234 Anywhere", "123 Anywhere street", "*****@*****.**")

        rack1 = LindenRack("c1.01.1000")
        rack2 = LindenRack("c3.03.2000")

        dfw.insert(rack1)
        phx.insert(rack2)

        ServerClass("Class 7")
        chassis = Class7Chassis()
        rack1.insert(chassis, [1, 2])
        class7 = Class7Server("hostname2.lindenlab.com")
        class7.serial_number = "SM55880"
        class7.set_port_attr("nic-eth", 1, "mac", "aa:bb:cc:11:22:96")
        class7.set_port_attr("nic-eth", 2, "mac", "aa:bb:cc:11:22:97")

        chassis.insert(class7)
        
        rack2.insert(h1, 1)