The vmware_nsx.plugins.nsx_v.vshield.edge_utils Module

class vmware_nsx.plugins.nsx_v.vshield.edge_utils.EdgeManager(nsxv_manager, plugin)

Bases: object

Edge Appliance Management. EdgeManager provides a pool of edge appliances which we can use to support DHCP&metadata, L3&FIP and LB&FW&VPN services.

add_host_route_on_static_bindings(static_bindings, dest_cidr, nexthop)

Add one host route on a bulk of static bindings config.

We can add host route on VM via dhcp option121. this func can only works at NSXv version 6.2.3 or higher.

add_mtu_on_static_binding(static_binding, mtu)

Add the pre-configured MTU to a static binding config.

We can add the MTU via dhcp option26. This func can only works at NSXv version 6.2.3 or higher.

allocate_lb_edge_appliance(context, resource_id, availability_zone, appliance_size='compact')
allocate_new_dhcp_edge(context, network_id, resource_id, availability_zone)
bind_router_on_available_edge(context, target_router_id, optional_router_ids, conflict_router_ids, conflict_network_ids, network_number, availability_zone)

Bind logical shared router on an available edge. Return True if the logical router is bound to a new edge.

check_edge_active_at_backend(edge_id)
create_dhcp_bindings(context, port_id, network_id, bindings)
create_dhcp_edge_service(context, network_id, subnet)

Create an edge if there is no available edge for dhcp service, Update an edge if there is available edge for dhcp service

If new edge was allocated, return resource_id, else return None

create_lrouter(context, lrouter, lswitch=None, dist=False, appliance_size='compact', availability_zone=None)

Create an edge for logical router support.

create_plr_with_tlr_id(context, router_id, router_name, availability_zone)
create_static_binding(context, port)

Create the DHCP Edge static binding configuration

<staticBinding>
<macAddress></macAddress> <ipAddress></ipAddress> <hostname></hostname> <!–disallow duplicate–> <defaultGateway></defaultGateway> <!–optional.–> <primaryNameServer></primaryNameServer> <!–optional–> <secondaryNameServer></secondaryNameServer> <!–optional–> <domainName></domainName> <!–optional–>

</staticBinding>

delete_dhcp_binding(context, port_id, network_id, mac_address)
delete_dhcp_edge_service(context, network_id)

Delete an edge for dhcp service.

delete_lrouter(context, router_id, dist=False)
delete_plr_by_tlr_id(context, plr_id, router_id)
get_plr_by_tlr_id(context, router_id)
get_routers_on_edge(context, edge_id)
get_routers_on_same_edge(context, router_id)
handle_meta_static_route(context, subnet_id, static_bindings)
is_router_conflict_on_edge(context, router_id, conflict_router_ids, conflict_network_ids, intf_num=0)
reconfigure_shared_edge_metadata_port(context, org_router_id)
remove_network_from_dhcp_edge(context, network_id, edge_id)
rename_lrouter(context, router_id, new_name)
resize_lrouter(context, router_id, new_size)
reuse_existing_dhcp_edge(context, edge_id, resource_id, network_id, availability_zone)
unbind_router_on_edge(context, router_id)

Unbind a logical router from edge. Return True if no logical router bound to the edge.

update_dhcp_edge_bindings(context, network_id)

Reconfigure the DHCP to the edge.

update_dhcp_edge_service(context, network_id, address_groups=None)

Update the subnet to the dhcp edge vnic.

update_dhcp_service_config(context, edge_id)

Reconfigure the DHCP to the edge.

update_external_interface(nsxv_manager, context, router_id, ext_net_id, ipaddr, netmask, secondary=None)
update_interface_addr(context, edge_id, old_ip, new_ip, subnet_mask, is_uplink=False)
update_syslog_by_flavor(context, router_id, flavor_id, edge_id)

Update syslog config on edge according to router flavor.

update_vdr_interface_addr(context, edge_id, vnic_index, old_ip, new_ip, subnet_mask)
class vmware_nsx.plugins.nsx_v.vshield.edge_utils.NsxVCallbacks(plugin)

Bases: object

Edge callback implementation Callback functions for asynchronous tasks.

complete_edge_creation(context, edge_id, name, router_id, dist, deploy_successful, availability_zone=None, deploy_metadata=False)
complete_edge_update(context, edge_id, router_id, successful, set_errors)
interface_update_result(task)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.add_vdr_internal_interface(nsxv_manager, context, router_id, int_net_id, address_groups, is_connected=True)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.check_network_in_use_at_backend(context, network_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.clean_host_groups(dvs, availability_zone)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.clear_gateway(nsxv_manager, context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.clear_nat_rules(nsxv_manager, context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.create_lrouter(nsxv_manager, context, lrouter, lswitch=None, dist=False, availability_zone=None)

Create an edge for logical router support.

vmware_nsx.plugins.nsx_v.vshield.edge_utils.default_loglevel_modifier(config, level)

Modify log level settings in edge config bulk (standard syntax)

vmware_nsx.plugins.nsx_v.vshield.edge_utils.delete_interface(nsxv_manager, context, router_id, network_id, dist=False)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.delete_lrouter(nsxv_manager, context, router_id, dist=False)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_dhcp_binding_for_binding_id(nsxv_manager, edge_id, binding_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_dhcp_binding_mappings(nsxv_manager, edge_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_dhcp_binding_mappings_for_hostname(nsxv_manager, edge_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_dhcp_binding_mappings_for_ips(nsxv_manager, edge_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_dhcp_edge_id(context, network_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_internal_lswitch_id_of_plr_tlr(context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_internal_vnic_index_of_plr_tlr(context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_loglevel_modifier(module, level)

Pick modifier according to module and set log level

vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_router_edge_id(context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_routes(edge_manager, context, router_id)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_vdr_transit_network_netmask()
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_vdr_transit_network_plr_address()
vmware_nsx.plugins.nsx_v.vshield.edge_utils.get_vdr_transit_network_tlr_address()
vmware_nsx.plugins.nsx_v.vshield.edge_utils.is_overlapping_reserved_subnets(cidr, reserved_subnets)

Return True if the subnet overlaps with reserved subnets.

For the V plugin we have a limitation that we should not use some reserved ranges like: 169.254.128.0/17 and 169.254.1.0/24

vmware_nsx.plugins.nsx_v.vshield.edge_utils.parse_backup_edge_pool_opt_per_az(az)

Parse edge pool opts per AZ and returns result.

vmware_nsx.plugins.nsx_v.vshield.edge_utils.query_dhcp_service_config(nsxv_manager, edge_id)

Retrieve the current DHCP configuration from the edge.

vmware_nsx.plugins.nsx_v.vshield.edge_utils.remove_irrelevant_keys_from_edge_request(edge_request)

Remove some unnecessary keys from the edge request. Having these keys fail the update edge NSX transaction

vmware_nsx.plugins.nsx_v.vshield.edge_utils.routing_loglevel_modifier(config, level)

Modify log level in routing global settings

vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_edge_host_groups(vcns, edge_id, dvs, availability_zone, validate=False)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_edge_loglevel(vcns, edge_id, module, level)

Update loglevel on edge for specified module

vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_firewall(nsxv_manager, context, router_id, firewall, allow_external=True)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_gateway(nsxv_manager, context, router_id, nexthop, routes=None)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_internal_interface(nsxv_manager, context, router_id, int_net_id, address_groups, is_connected=True)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_nat_rules(nsxv_manager, context, router_id, snat, dnat, az=None)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_routes(edge_manager, context, router_id, routes, nexthop=None)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.update_vdr_internal_interface(nsxv_manager, context, router_id, int_net_id, address_groups, is_connected=True)
vmware_nsx.plugins.nsx_v.vshield.edge_utils.validate_vdr_transit_network()

This Page