The vmware_nsx.common.nsx_utils Module

vmware_nsx.common.nsx_utils.convert_to_nsx_transport_zones(default_tz_uuid, network=None, bindings=None, default_transport_type=None)
vmware_nsx.common.nsx_utils.create_nsx_cluster(cluster_opts, concurrent_connections, gen_timeout)
vmware_nsx.common.nsx_utils.fetch_nsx_switches(session, cluster, neutron_net_id)

Retrieve logical switches for a neutron network.

This function is optimized for fetching all the lswitches always with a single NSX query. If there is more than 1 logical switch (chained switches use case) NSX lswitches are queried by ‘quantum_net_id’ tag. Otherwise the NSX lswitch is directly retrieved by id (more efficient).

vmware_nsx.common.nsx_utils.get_nsx_device_status(cluster, nsx_uuid)
vmware_nsx.common.nsx_utils.get_nsx_device_statuses(cluster, tenant_id)
vmware_nsx.common.nsx_utils.get_nsx_router_id(session, cluster, neutron_router_id)

Return the NSX router uuid for a given neutron router.

First, look up the Neutron database. If not found, execute a query on NSX platform as the mapping might be missing.

vmware_nsx.common.nsx_utils.get_nsx_security_group_id(session, cluster, neutron_id)

Return the NSX sec profile uuid for a given neutron sec group.

First, look up the Neutron database. If not found, execute a query on NSX platform as the mapping might be missing. NOTE: Security groups are called ‘security profiles’ on the NSX backend.

vmware_nsx.common.nsx_utils.get_nsx_switch_and_port_id(session, cluster, neutron_port_id)

Return the NSX switch and port uuids for a given neutron port.

First, look up the Neutron database. If not found, execute a query on NSX platform as the mapping might be missing because the port was created before upgrading to grizzly.

This routine also retrieves the identifier of the logical switch in the backend where the port is plugged. Prior to Icehouse this information was not available in the Neutron Database. For dealing with pre-existing records, this routine will query the backend for retrieving the correct switch identifier.

As of Icehouse release it is not indeed anymore possible to assume the backend logical switch identifier is equal to the neutron network identifier.

vmware_nsx.common.nsx_utils.get_nsx_switch_ids(session, cluster, neutron_network_id)

Return the NSX switch id for a given neutron network.

First lookup for mappings in Neutron database. If no mapping is found, query the NSX backend and add the mappings.