The networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_client
Module¶
-
class
networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_client.
Client
(**kwargs)¶ Bases:
object
Client for the Cisco Nexus1000V Neutron Plugin.
This client implements functions to communicate with Cisco Nexus1000V VSM.
For every Neutron object, Cisco Nexus1000V Neutron Plugin creates a corresponding object on the controller (Cisco Nexus1000V VSM).
CONCEPTS:
Following are few concepts used in Nexus1000V VSM:
port-profiles: Policy profiles correspond to port profiles on Nexus1000V VSM. Port profiles are the primary mechanism by which network policy is defined and applied to switch interfaces in a Nexus 1000V system.
network-segment: Each network-segment represents a broadcast domain.
network-segment-pool: A network-segment-pool contains one or more network-segments.
logical-network: A logical-network contains one or more network-segment-pools.
bridge-domain: A bridge-domain is created when the network-segment is of type VXLAN. Each VXLAN <–> VLAN combination can be thought of as a bridge domain.
ip-pool: Each ip-pool represents a subnet on the Nexus1000V VSM.
WORK FLOW:
For every network profile a corresponding logical-network and a network-segment-pool, under this logical-network, will be created.
For every network created from a given network profile, a network-segment will be added to the network-segment-pool corresponding to that network profile.
A port is created on a network and associated with a policy-profile. Hence for every unique combination of a network and a policy-profile, a unique vm-network will be created and a reference to the port will be added. If the same combination of network and policy-profile is used by another port, the references to that port will be added to the same vm-network.
-
bridge_domain_path
= ‘/kvm/bridge-domain/%s’¶
-
bridge_domains_path
= ‘/kvm/bridge-domain’¶
-
create_bridge_domain
(network, net_prof, vsm_ip=None)¶ Create a bridge domain on VSM.
Parameters: - network – network dict
- net_prof – network profile dict
- vsm_ip – string representing the IP address of the VSM
-
create_ip_pool
(subnet, vsm_ip=None)¶ Create a subnet on VSM.
Parameters: - subnet – subnet dict
- vsm_ip – string representing the IP address of the VSM
-
create_n1kv_port
(port, vmnetwork_name, policy_profile, vsm_ip=None)¶ Create a port on the VSM.
Parameters: - port – port dict
- vmnetwork_name – name of the VM network
- policy_profile – policy profile object
- vsm_ip – string representing the IP address of the VSM
-
create_network_segment
(network, network_profile, vsm_ip=None)¶ Create a network segment on the VSM.
Parameters: - network – network dict
- network_profile – network profile object
- vsm_ip – string representing the IP address of the VSM
-
create_network_segment_pool
(network_profile, vsm_ip=None)¶ Create a network segment pool on the VSM.
Parameters: - network_profile – network profile dict
- vsm_ip – string representing the IP address of the VSM
-
delete_bridge_domain
(name, vsm_ip=None)¶ Delete a bridge domain on VSM.
Parameters: - name – name of the bridge domain to be deleted
- vsm_ip – string representing the IP address of the VSM
-
delete_ip_pool
(subnet_id, vsm_ip=None)¶ Delete an ip-pool on the VSM.
Parameters: - subnet_id – UUID representing the subnet
- vsm_ip – string representing the IP address of the VSM
-
delete_logical_network
(logical_network_name, vsm_ip=None)¶ Delete a logical network on VSM.
Parameters: - logical_network_name – string representing name of the logical network
- vsm_ip – string representing the IP address of the VSM
-
delete_n1kv_port
(vmnetwork_name, port_id, vsm_ip=None)¶ Delete a port on the VSM.
Parameters: - vmnetwork_name – name of the VM network which imports this port
- port_id – UUID of the port
- vsm_ip – string representing the IP address of the VSM
-
delete_network_segment
(network_segment_id, network_type, vsm_ip=None)¶ Delete a network segment on the VSM.
Parameters: - network_segment_id – UUID representing the network segment
- network_type – type of network to be deleted
- vsm_ip – string representing the IP address of the VSM
-
delete_network_segment_pool
(network_segment_pool_id, vsm_ip=None)¶ Delete a network segment pool on the VSM.
Parameters: - network_segment_pool_id – UUID representing the network segment pool
- vsm_ip – string representing the IP address of the VSM
-
ip_pool_path
= ‘/ip-pool-template/%s’¶
-
ip_pools_path
= ‘/ip-pool-template’¶
-
list_bridge_domains
(vsm_ip=None)¶ Fetch the list of all bridge domains on the VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_md5_hashes
(vsm_ip=None)¶ Fetch MD5 hashes for all resources from VSM.
Fetch MD5 hashes for network profiles, networks, subnets, ports and a consolidated hash of these hashes from the VSM
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_network_profiles
(vsm_ip=None)¶ Fetch all network profiles from VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_networks
(vsm_ip=None)¶ Fetch all networks from VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_port_profiles
(vsm_ip=None)¶ Fetch all policy profiles from the VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_subnets
(vsm_ip=None)¶ Fetch all subnets from VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
list_vmnetworks
(vsm_ip=None)¶ Fetch all VM networks from VSM.
Parameters: vsm_ip – string representing the IP address of the VSM Returns: JSON string
-
logical_network_path
= ‘/logical-network/%s’¶
-
md5_path
= ‘/kvm/config-md5-hashes’¶
-
network_segment_path
= ‘/network-segment/%s’¶
-
network_segment_pool_path
= ‘/network-segment-pool/%s’¶
-
network_segment_pools_path
= ‘/network-segment-pool’¶
-
network_segments_path
= ‘/network-segment’¶
-
pool
= <eventlet.greenpool.GreenPool object at 0x9cb7c90>¶
-
port_path
= ‘/kvm/vm-network/%s/ports/%s’¶
-
port_profiles_path
= ‘/virtual-port-profile’¶
-
ports_path
= ‘/kvm/vm-network/%s/ports’¶
-
send_sync_notification
(msg, vsm_ip)¶ Send a start/end/no-change sync notification to the VSM.
Parameters: - vsm_ip – string representing the IP address of the VSM
- msg – message string, start, end or no-change
-
show_network
(network_id, vsm_ip=None)¶ Fetch details of a given network like segment type from the VSM.
Parameters: - network_id – UUID of the network whose details are needed
- vsm_ip – string representing the IP address of the VSM
Returns: JSON string
-
sync_notification_path
= ‘/sync-notification’¶
-
update_ip_pool
(subnet)¶ Update an ip-pool on the VSM.
Parameters: subnet – subnet dictionary
-
update_network_segment
(updated_network)¶ Update a network segment on the VSM.
Parameters: updated_network – updated network dict
-
vm_network_path
= ‘/kvm/vm-network/%s’¶
-
vm_networks_path
= ‘/kvm/vm-network’¶
-