vtep_hvsrA['hvsrPortNum'] = doo['hvsrPortNum_1'] vtep_hvsrA['vtepName'] = doo['vtepName_1'] vtep_hvsrA['hvsrName'] = doo['hvsrName_1'] vtep_hvsrA['vtep_hvsr_name'] = doo['vtepName_1'] + doo['hvsrName_1'] vtep_hvsrA['switchName'] = doo['switchName_1'] + doo['hvsrName_1'] # Configure VTEP 1 onto Hypervisor 1 and reference this set as vtep_hvsrA vtep_hvsrB['hvsrIp'] = doo['hvsrIp_2'] vtep_hvsrB['hvsrPortNum'] = doo['hvsrPortNum_2'] vtep_hvsrB['vtepName'] = doo['vtepName_2'] vtep_hvsrB['hvsrName'] = doo['hvsrName_2'] vtep_hvsrB['vtep_hvsr_name'] = doo['vtepName_1'] + doo['hvsrName_2'] vtep_hvsrB['switchName'] = doo['switchName_2'] + doo['hvsrName_2'] # Instantiate the Overlay Manager overlay_manager = Ovrly_mgr(doo['ctrlIpAddr'], doo['ctrlPortNum'], doo['ctrlUname'], doo['ctrlPswd'], doo['ctrlTimeOut']) # wait on input print "\n" user_input = raw_input("Press any key to register the first Hypervisor: ") # Register the 1st hypervisor overlay_manager.register_hypervisor(vtep_hvsrA) # wait on input print "\n" user_input = raw_input("Press any key to register the second Hypervisor: ") # Register the 2nd Hypervisor overlay_manager.register_hypervisor(vtep_hvsrB)
# Configure VTEP 1 onto Hypervisor 3 and reference this set as vtep_hvsrA vtep_hvsrA['hvsrIp'] = doo['hvsrIp_3'] vtep_hvsrA['hvsrPortNum'] = doo['hvsrPortNum_3'] vtep_hvsrA['vtepName'] = doo['vtepName_3'] vtep_hvsrA['hvsrName'] = doo['hvsrName_3'] vtep_hvsrA['vtep_hvsr_name'] = doo['vtepName_3'] + doo['hvsrName_3'] vtep_hvsrA['switchName'] = doo['switchName_3'] # Configure VTEP 1 onto Hypervisor 4 and reference this set as vtep_hvsrB vtep_hvsrB['hvsrIp'] = doo['hvsrIp_4'] vtep_hvsrB['hvsrPortNum'] = doo['hvsrPortNum_4'] vtep_hvsrB['vtepName'] = doo['vtepName_4'] vtep_hvsrB['hvsrName'] = doo['hvsrName_4'] vtep_hvsrB['vtep_hvsr_name'] = doo['vtepName_4'] + doo['hvsrName_4'] vtep_hvsrB['switchName'] = doo['switchName_4'] else: parser.print_help() sys.exit(0) # Instantiate the Overlay Manager overlay_manager = Ovrly_mgr(doo['ctrlIpAddr'], doo['ctrlPortNum'], doo['ctrlUname'], doo['ctrlPswd'], doo['ctrlTimeOut']) logging.info("Building tunnel %s (VNI ID %s) between vtep %s (switch %s) and vtep %s (switch %s)", tunnel_name, vni_id, vtep_hvsrA['vtepName'], vtep_hvsrA['switchName'], vtep_hvsrB['vtepName'], vtep_hvsrA['switchName']) overlay_manager.create_tunnel_between_two_hypervisors(tunnel_name, vni_id, vtep_hvsrA, vtep_hvsrB)
vtep_hvsrA['hvsrIp'] = doo['hvsrIp_3'] vtep_hvsrA['hvsrPortNum'] = doo['hvsrPortNum_3'] vtep_hvsrA['vtepName'] = doo['vtepName_3'] vtep_hvsrA['hvsrName'] = doo['hvsrName_3'] vtep_hvsrA['vtep_hvsr_name'] = doo['vtepName_3'] + doo['hvsrName_3'] vtep_hvsrA['switchName'] = doo['switchName_3'] # Configure VTEP 1 onto Hypervisor 4 and reference this set as vtep_hvsrB vtep_hvsrB['hvsrIp'] = doo['hvsrIp_4'] vtep_hvsrB['hvsrPortNum'] = doo['hvsrPortNum_4'] vtep_hvsrB['vtepName'] = doo['vtepName_4'] vtep_hvsrB['hvsrName'] = doo['hvsrName_4'] vtep_hvsrB['vtep_hvsr_name'] = doo['vtepName_4'] + doo['hvsrName_4'] vtep_hvsrB['switchName'] = doo['switchName_4'] else: parser.print_help() sys.exit(0) # Instantiate the Overlay Manager overlay_manager = Ovrly_mgr(doo['ctrlIpAddr'], doo['ctrlPortNum'], doo['ctrlUname'], doo['ctrlPswd'], doo['ctrlTimeOut']) logging.info("Creating 2 tunnel VTEP endpoints: %s on hypervisor %s and %s on hypervisor %s", vtep_hvsrA['vtepName'], vtep_hvsrA['hvsrName'], vtep_hvsrB['vtepName'], vtep_hvsrB['hvsrName']) overlay_manager.register_hypervisor(vtep_hvsrA) overlay_manager.resister_vtep_on_hypervisor(vtep_hvsrA) overlay_manager.register_hypervisor(vtep_hvsrB) overlay_manager.resister_vtep_on_hypervisor(vtep_hvsrB)
# Configure VTEP 1 onto Hypervisor 3 and reference this set as vtep_hvsrA vtep_hvsrA['hvsrIp'] = doo['hvsrIp_3'] vtep_hvsrA['hvsrPortNum'] = doo['hvsrPortNum_3'] vtep_hvsrA['vtepName'] = doo['vtepName_3'] vtep_hvsrA['hvsrName'] = doo['hvsrName_3'] vtep_hvsrA['vtep_hvsr_name'] = doo['vtepName_3'] + doo['hvsrName_3'] vtep_hvsrA['switchName'] = doo['switchName_3'] # Configure VTEP 1 onto Hypervisor 4 and reference this set as vtep_hvsrB vtep_hvsrB['hvsrIp'] = doo['hvsrIp_4'] vtep_hvsrB['hvsrPortNum'] = doo['hvsrPortNum_4'] vtep_hvsrB['vtepName'] = doo['vtepName_4'] vtep_hvsrB['hvsrName'] = doo['hvsrName_4'] vtep_hvsrB['vtep_hvsr_name'] = doo['vtepName_4'] + doo['hvsrName_4'] vtep_hvsrB['switchName'] = doo['switchName_4'] else: parser.print_help() sys.exit(0) # Instantiate the Overlay Manager overlay_manager = Ovrly_mgr(doo['ctrlIpAddr'], doo['ctrlPortNum'], doo['ctrlUname'], doo['ctrlPswd'], doo['ctrlTimeOut']) logging.info("Deleting tunnel %s (VNI ID %s) between vtep %s (switch %s) and vtep %s (switch %s)", tunnel_name, vni_id, vtep_hvsrA['vtepName'], vtep_hvsrA['switchName'], vtep_hvsrB['vtepName'], vtep_hvsrA['switchName']) overlay_manager.delete_tunnel_between_two_hypervisors(tunnel_name)
# Configure VTEP 1 onto Hypervisor 3 and reference this set as vtep_hvsrA vtep_hvsrA['hvsrIp'] = doo['hvsrIp_3'] vtep_hvsrA['hvsrPortNum'] = doo['hvsrPortNum_3'] vtep_hvsrA['vtepName'] = doo['vtepName_3'] vtep_hvsrA['hvsrName'] = doo['hvsrName_3'] vtep_hvsrA['vtep_hvsr_name'] = doo['vtepName_3'] + doo['hvsrName_3'] vtep_hvsrA['switchName'] = doo['switchName_3'] # Configure VTEP 1 onto Hypervisor 4 and reference this set as vtep_hvsrB vtep_hvsrB['hvsrIp'] = doo['hvsrIp_4'] vtep_hvsrB['hvsrPortNum'] = doo['hvsrPortNum_4'] vtep_hvsrB['vtepName'] = doo['vtepName_4'] vtep_hvsrB['hvsrName'] = doo['hvsrName_4'] vtep_hvsrB['vtep_hvsr_name'] = doo['vtepName_4'] + doo['hvsrName_4'] vtep_hvsrB['switchName'] = doo['switchName_4'] else: parser.print_help() sys.exit(0) # Instantiate the Overlay Manager overlay_manager = Ovrly_mgr(doo['ctrlIpAddr'], doo['ctrlPortNum'], doo['ctrlUname'], doo['ctrlPswd'], doo['ctrlTimeOut']) logging.info("Deleting 2 tunnel VTEP endpoints: %s on hypervisor %s and %s on hypervisor %s", vtep_hvsrA['vtepName'], vtep_hvsrA['hvsrName'], vtep_hvsrB['vtepName'], vtep_hvsrB['hvsrName']) overlay_manager.delete_hypervisor(vtep_hvsrA) overlay_manager.delete_hypervisor(vtep_hvsrB)