def main(argv): if len(argv) != 2: help(argv[0]) args = ['--config-file'] args.append(argv[1]) config.parse(args) print "------------------------ Database Options ------------------------" print "\tsql_connection: %s" % cfg.CONF.DATABASE.sql_connection print "\treconnect_interval: %d" % cfg.CONF.DATABASE.reconnect_interval print "\tsql_max_retries: %d" % cfg.CONF.DATABASE.sql_max_retries print "------------------------ NVP Options ------------------------" print "\tNVP Generation Timeout %d" % cfg.CONF.NVP.nvp_gen_timeout print ("\tNumber of concurrent connections to each controller %d" % cfg.CONF.NVP.concurrent_connections) print "\tmax_lp_per_bridged_ls: %s" % cfg.CONF.NVP.max_lp_per_bridged_ls print "\tmax_lp_per_overlay_ls: %s" % cfg.CONF.NVP.max_lp_per_overlay_ls print ("\tenable_metadata_access_network: %s" % cfg.CONF.NVP.enable_metadata_access_network) print "------------------------ Cluster Options ------------------------" print "\trequested_timeout: %s" % cfg.CONF.req_timeout print "\tretries: %s" % cfg.CONF.retries print "\tredirects: %s" % cfg.CONF.redirects print "\thttp_timeout: %s" % cfg.CONF.http_timeout cluster = QuantumPlugin.create_nvp_cluster( cfg.CONF, cfg.CONF.NVP.concurrent_connections, cfg.CONF.NVP.nvp_gen_timeout) num_controllers = len(cluster.nvp_controllers) print "Number of controllers found: %s" % num_controllers if num_controllers == 0: print "You must specify at least one controller!" sys.exit(1) for controller in cluster.nvp_controllers: print "\tController endpoint: %s" % controller nvplib.check_cluster_connectivity(cluster) gateway_services = get_gateway_services(cluster) for svc_type in ["L2GatewayServiceConfig", "L3GatewayServiceConfig"]: for uuid in gateway_services[svc_type]: print "\t\tGateway(%s) uuid: %s" % (svc_type, uuid) transport_zones = get_transport_zones(cluster) print "\tTransport zones: %s" % transport_zones print "Done."
def main(argv): if len(argv) != 2: help(argv[0]) args = ['--config-file'] args.append(argv[1]) config.parse(args) print "------------------------ Database Options ------------------------" print "\tsql_connection: %s" % cfg.CONF.DATABASE.sql_connection print "\treconnect_interval: %d" % cfg.CONF.DATABASE.reconnect_interval print "\tsql_max_retries: %d" % cfg.CONF.DATABASE.sql_max_retries print "------------------------ NVP Options ------------------------" print "\tNVP Generation Timeout %d" % cfg.CONF.NVP.nvp_gen_timeout print("\tNumber of concurrent connections to each controller %d" % cfg.CONF.NVP.concurrent_connections) print "\tmax_lp_per_bridged_ls: %s" % cfg.CONF.NVP.max_lp_per_bridged_ls print "\tmax_lp_per_overlay_ls: %s" % cfg.CONF.NVP.max_lp_per_overlay_ls print("\tenable_metadata_access_network: %s" % cfg.CONF.NVP.enable_metadata_access_network) print "------------------------ Cluster Options ------------------------" print "\trequested_timeout: %s" % cfg.CONF.req_timeout print "\tretries: %s" % cfg.CONF.retries print "\tredirects: %s" % cfg.CONF.redirects print "\thttp_timeout: %s" % cfg.CONF.http_timeout cluster = QuantumPlugin.create_nvp_cluster( cfg.CONF, cfg.CONF.NVP.concurrent_connections, cfg.CONF.NVP.nvp_gen_timeout) num_controllers = len(cluster.nvp_controllers) print "Number of controllers found: %s" % num_controllers if num_controllers == 0: print "You must specify at least one controller!" sys.exit(1) for controller in cluster.nvp_controllers: print "\tController endpoint: %s" % controller nvplib.check_cluster_connectivity(cluster) gateway_services = get_gateway_services(cluster) for svc_type in ["L2GatewayServiceConfig", "L3GatewayServiceConfig"]: for uuid in gateway_services[svc_type]: print "\t\tGateway(%s) uuid: %s" % (svc_type, uuid) transport_zones = get_transport_zones(cluster) print "\tTransport zones: %s" % transport_zones print "Done."
def main(argv): if len(argv) != 2: help(argv[0]) args = ['--config-file'] args.append(argv[1]) config.parse(args) print "------------------------ Database Options ------------------------" print "\tsql_connection: %s" % cfg.CONF.DATABASE.sql_connection print "\treconnect_interval: %d" % cfg.CONF.DATABASE.reconnect_interval print "\tsql_max_retries: %d" % cfg.CONF.DATABASE.sql_max_retries print "------------------------ NVP Options ------------------------" print "\tNVP Generation Timeout %d" % cfg.CONF.NVP.nvp_gen_timeout print("\tNumber of concurrent connections to each controller %d" % cfg.CONF.NVP.concurrent_connections) print "\tmax_lp_per_bridged_ls: %s" % cfg.CONF.NVP.max_lp_per_bridged_ls print "\tmax_lp_per_overlay_ls: %s" % cfg.CONF.NVP.max_lp_per_overlay_ls print("\tenable_metadata_access_network: %s" % cfg.CONF.NVP.enable_metadata_access_network) print "------------------------ Cluster Options ------------------------" print "\trequested_timeout: %s" % cfg.CONF.req_timeout print "\tretries: %s" % cfg.CONF.retries print "\tredirects: %s" % cfg.CONF.redirects print "\thttp_timeout: %s" % cfg.CONF.http_timeout cluster = QuantumPlugin.create_nvp_cluster( cfg.CONF, cfg.CONF.NVP.concurrent_connections, cfg.CONF.NVP.nvp_gen_timeout) num_controllers = len(cluster.nvp_controllers) print "Number of controllers found: %s" % num_controllers if num_controllers == 0: print "You must specify at least one controller!" sys.exit(1) for controller in cluster.nvp_controllers: print "\tController endpoint: %s" % controller nvplib.check_cluster_connectivity(cluster) gateway_services = get_gateway_services(cluster) default_gateways = { "L2GatewayServiceConfig": cfg.CONF.default_l2_gw_service_uuid, "L3GatewayServiceConfig": cfg.CONF.default_l3_gw_service_uuid } errors = 0 for svc_type in default_gateways.keys(): for uuid in gateway_services[svc_type]: print "\t\tGateway(%s) uuid: %s" % (svc_type, uuid) if (default_gateways[svc_type] and default_gateways[svc_type] not in gateway_services): print( "\t\t\tError: specified default %s gateway (%s) is " "missing from NVP Gateway Services!" % (svc_type, default_gateways[svc_type])) errors += 1 transport_zones = get_transport_zones(cluster) print "\tTransport zones: %s" % transport_zones if cfg.CONF.default_tz_uuid not in transport_zones: print( "\t\tError: specified default transport zone " "(%s) is missing from NVP transport zones!" % cfg.CONF.default_tz_uuid) errors += 1 if errors: print( "\nThere are %d errors with your configuration. " " Please, revise!" % errors) sys.exit(1) else: print "Done."
def main(argv): if len(argv) != 2: help(argv[0]) args = ['--config-file'] args.append(argv[1]) config.parse(args) print "------------------------ Database Options ------------------------" print "\tconnection: %s" % cfg.CONF.database.connection print "\tretry_interval: %d" % cfg.CONF.database.retry_interval print "\tmax_retries: %d" % cfg.CONF.database.max_retries print "------------------------ NVP Options ------------------------" print "\tNVP Generation Timeout %d" % cfg.CONF.NVP.nvp_gen_timeout print ("\tNumber of concurrent connections to each controller %d" % cfg.CONF.NVP.concurrent_connections) print "\tmax_lp_per_bridged_ls: %s" % cfg.CONF.NVP.max_lp_per_bridged_ls print "\tmax_lp_per_overlay_ls: %s" % cfg.CONF.NVP.max_lp_per_overlay_ls print ("\tenable_metadata_access_network: %s" % cfg.CONF.NVP.enable_metadata_access_network) print "------------------------ Cluster Options ------------------------" print "\trequested_timeout: %s" % cfg.CONF.req_timeout print "\tretries: %s" % cfg.CONF.retries print "\tredirects: %s" % cfg.CONF.redirects print "\thttp_timeout: %s" % cfg.CONF.http_timeout cluster = QuantumPlugin.create_nvp_cluster( cfg.CONF, cfg.CONF.NVP.concurrent_connections, cfg.CONF.NVP.nvp_gen_timeout) num_controllers = len(cluster.nvp_controllers) print "Number of controllers found: %s" % num_controllers if num_controllers == 0: print "You must specify at least one controller!" sys.exit(1) for controller in cluster.nvp_controllers: print "\tController endpoint: %s" % controller nvplib.check_cluster_connectivity(cluster) gateway_services = get_gateway_services(cluster) default_gateways = { "L2GatewayServiceConfig": cfg.CONF.default_l2_gw_service_uuid, "L3GatewayServiceConfig": cfg.CONF.default_l3_gw_service_uuid} errors = 0 for svc_type in default_gateways.keys(): for uuid in gateway_services[svc_type]: print "\t\tGateway(%s) uuid: %s" % (svc_type, uuid) if (default_gateways[svc_type] and default_gateways[svc_type] not in gateway_services): print ("\t\t\tError: specified default %s gateway (%s) is " "missing from NVP Gateway Services!" % (svc_type, default_gateways[svc_type])) errors += 1 transport_zones = get_transport_zones(cluster) print "\tTransport zones: %s" % transport_zones if cfg.CONF.default_tz_uuid not in transport_zones: print ("\t\tError: specified default transport zone " "(%s) is missing from NVP transport zones!" % cfg.CONF.default_tz_uuid) errors += 1 if errors: print ("\nThere are %d errors with your configuration. " " Please, revise!" % errors) sys.exit(1) else: print "Done."
def main(argv): if len(sys.argv) != 2: help() args = ['--config-file'] args.append(sys.argv[1]) config.parse(args) errors = False nvp_opts, clusters_opts = QuantumPlugin.parse_config() print "-----------Database Options--------------------" print "sql_connection: %s" % cfg.CONF.DATABASE.sql_connection print "reconnect_interval: %d" % cfg.CONF.DATABASE.reconnect_interval print "sql_max_retries: %d" % cfg.CONF.DATABASE.sql_max_retries print "-----------NVP Options--------------------" print ("Number of concurrents allow to each controller %d" % nvp_opts.concurrent_connections) print "NVP Generation Timeout %d" % nvp_opts.nvp_gen_timeout print "NVP Default Cluster Name %s" % nvp_opts.default_cluster_name print "-----------Cluster Options--------------------" if not clusters_opts: print "No NVP Clusters detected in nvp.ini!" exit(1) clusters, default_cluster = QuantumPlugin.parse_clusters_opts( clusters_opts, nvp_opts.concurrent_connections, nvp_opts.nvp_gen_timeout, nvp_opts.default_cluster_name) for cluster in clusters.itervalues(): num_controllers = cluster.get_num_controllers() print "\n%d controllers found in cluster [CLUSTER:%s]" % ( num_controllers, cluster.name) if num_controllers == 0: print ("Cluster %s has no nvp_controller_connection defined!" % cluster.name) exit(1) for i in range(0, num_controllers): controller = cluster.get_controller(i) if i == 0: gateway_services = get_gateway_services(cluster) transport_zones = get_transport_zones(cluster) controller.update(nvplib.check_cluster_connectivity(cluster)) default_tz_zone = controller.get('default_tz_uuid') print ("\n\tdefault_tz_uuid: %s" % default_tz_zone) if not default_tz_zone: print "\t* ERROR: No default trasport zone specified!" errors = True elif default_tz_zone not in transport_zones: print ("\t* ERROR: did not find default transport %s zone " "on NVP!" % default_tz_zone) errors = True print ("\tapi_redirect_interval: %s" % controller.get('api_redirect_interval')) print "\tcluster uuid: %s" % controller.get('uuid') print "\tapi_mode: %s" % controller.get('api_mode') l2_gateway = controller.get('default_l2_gw_service_uuid') print ("\tdefault_l2_gw_service_uuid: %s" % l2_gateway) if (l2_gateway and l2_gateway not in gateway_services['L2GatewayServiceConfig']): print ("\t* ERROR: Did not find L2 gateway service uuid %s" " in NVP!" % l2_gateway) errors = True l3_gateway = controller.get('default_l3_gw_service_uuid') print ("\tdefault_l3_gw_service_uuid: %s" % l3_gateway) if (l3_gateway and l3_gateway not in gateway_services['L3GatewayServiceConfig']): print ("\t* ERROR did not find L3 gateway service uuid %s" " in NVP!" % l3_gateway) errors = True print ("\n-----controller %d------\n" % (i + 1)) test_controller(cluster, controller) display_controller_info(controller) print "\n" if errors: print ("**There were configuration errors found " "please review output carefully!!**") print "\n"