The networking_cisco.apps.saf.agent.vdp.dfa_vdp_mgr
Module¶
-
class
networking_cisco.apps.saf.agent.vdp.dfa_vdp_mgr.
VdpMgr
(config_dict, rpc_client, hostname)¶ Bases:
object
Responsible for Handling VM/Uplink requests.
-
check_periodic_bulk_vm_notif_rcvd
()¶ Bulk VM check handler called from periodic uplink detection.
This gets called by the ‘normal’ stage of uplink detection. The bulk VM event sends all the VM’s running in this agent. Sometimes during upgrades, it was found that due to some race condition, the server does not send the Bulk VM event. Whenever, a save_uplink is done by the agent, the server sends the Bulk VM event. If Bulk VM event is not received after few attempts, save_uplink is done to request the Bulk VM list. It’s not protected with a mutex, since worst case, Bulk VM event will be sent twice, which is not that bad. When uplink is detected for the first time, it will hit the below else case and there a save_uplink is anyways done.
-
dfa_uplink_restart
(uplink_dict)¶
-
is_openstack_running
()¶ Currently it just checks for the presence of both the bridges.
-
is_uplink_received
()¶ Returns whether uplink information is received after restart.
Not protecting this with a mutex, since this gets called inside the loop from dfa_agent and having a mutex is a overkill. Worst case, during multiple restarts on server and when the corner case is hit, this may return an incorrect value of False when _dfa_uplink_restart is at the middle of execution. Returning an incorrect value of False, may trigger an RPC to the server to retrieve the uplink one extra time. _dfa_uplink_restart will not get executed twice, since that is anyway protected with a mutex.
-
process_bulk_vm_event
(msg, phy_uplink)¶ Process the VM bulk event usually after a restart.
-
process_err_queue
()¶
-
process_queue
()¶
-
process_uplink_event
(msg, phy_uplink)¶
-
process_vm_event
(msg, phy_uplink)¶
-
read_static_uplink
()¶ Read the static uplink from file, if given.
-
save_topo_disc_params
(intf, topo_disc_obj)¶
-
save_uplink
(uplink=”, veth_intf=”, fail_reason=”)¶
-
start
()¶
-
static_uplink_detect
(veth)¶ Return the static uplink based on argument passed.
The very first time, this function is called, it returns the uplink port read from a file. After restart, when this function is called the first time, it returns ‘normal’ assuming a veth is passed to this function which will be the case if uplink processing is successfully done. If user modified the uplink configuration and restarted, a ‘down’ will be returned to clear the old uplink.
-
topo_disc_cb
(intf, topo_disc_obj)¶
-
update_vm_result
(port_uuid, result, lvid=None, vdp_vlan=None, fail_reason=None)¶
-
uplink_bond_intf_process
()¶ Process the case when uplink interface becomes part of a bond.
This is called to check if the phy interface became a part of the bond. If the below condition is True, this means, a physical interface that was not a part of a bond was earlier discovered as uplink and now that interface became part of the bond. Usually, this doesn’t happen as LLDP and in turn this function will first detect a ‘down’ followed by an ‘up’. When regular interface becomes part of bond, it’s rare for it to hit this ‘normal’ case. But, still providing the functionality if it happens. The following is done : a. Bring down the physical interface by sending a ‘down’ event b. Add the bond interface by sending an ‘up’ event Consquently, when bond is added that will be assigned to self.phy_uplink. Then, the below condition will be False. i.e.. ‘get_bond_intf’ will return False, when the argument is ‘bond0’.
-
vdp_uplink_proc
()¶ Periodic handler to detect the uplink interface to the switch.
-> restart_uplink_called: should be called by agent initially to set the stored uplink and veth from DB -> process_uplink_ongoing: Will be set when uplink message is enqueue and reset when dequeued and processed completely -> uplink_det_compl: Will be set to True when a valid uplink is detected and object created. Will be reset when uplink is down -> phy_uplink: Is the uplink interface -> veth_intf : Signifies the veth interface.
-
vdp_uplink_proc_top
()¶
-
vdp_vlan_change_cb
(port_uuid, lvid, vdp_vlan, fail_reason)¶ Callback function for updating the VDP VLAN in DB.
-
vdp_vm_event
(vm_dict_list)¶
-
-
class
networking_cisco.apps.saf.agent.vdp.dfa_vdp_mgr.
VdpMsgPriQue
¶ Bases:
object
VDP Message Queue.
-
dequeue
()¶
-
dequeue_nonblock
()¶
-
enqueue
(priority, msg)¶
-
is_not_empty
()¶
-
-
class
networking_cisco.apps.saf.agent.vdp.dfa_vdp_mgr.
VdpQueMsg
(msg_type, port_uuid=None, vm_mac=None, oui=None, net_uuid=None, segmentation_id=None, status=None, vm_bulk_list=None, phy_uplink=None, br_int=None, br_ex=None, root_helper=None)¶ Bases:
object
Construct VDP Message.
-
construct_uplink_msg
(status, phy_uplink, br_int, br_ex, root_helper)¶
-
construct_vm_bulk_sync_msg
(vm_bulk_list, phy_uplink)¶
-
construct_vm_msg
(port_uuid, vm_mac, net_uuid, segmentation_id, status, oui, phy_uplink)¶
-
get_ext_br
()¶
-
get_integ_br
()¶
-
get_mac
()¶
-
get_net_uuid
()¶
-
get_oui
()¶
-
get_port_uuid
()¶
-
get_root_helper
()¶
-
get_segmentation_id
()¶
-
get_status
()¶
-
get_uplink
()¶
-
set_uplink
(uplink)¶
-