The networking_cisco.apps.saf.server.dfa_server Module

This is the DFA enabler server module which is respnsible for processing neutron, keystone and DCNM events. Also interacting with DFA enabler agent module for port events.

class networking_cisco.apps.saf.server.dfa_server.DfaServer(cfg)

Bases: networking_cisco.apps.saf.server.dfa_fail_recovery.DfaFailureRecovery, networking_cisco.apps.saf.db.dfa_db_models.DfaDBMixin, networking_cisco.apps.saf.server.services.firewall.native.fw_mgr.FwMgr

Process keystone and neutron events.

The supported events project and network create/delete/update. For each events, data will be provided and sent to DCNM.

add_dhcp_port(p)
add_lbaas_port(port_id, lb_id)

Give port id, get port info and send vm info to agent.

Parameters:
  • port_id – port id of vip port
  • lb_id – vip id for v1 and lbaas_id for v2
cfg
correct_dhcp_ports(net_id)
create_subnet(snet)

Create subnet.

create_threads()

Create threads on server.

dcnm_network_create_event(network_info)

Process network create event from DCNM.

dcnm_network_delete_event(network_info)

Process network delete event from DCNM.

decrement_dhcp_check()
delete_lbaas_port(lb_id)

send vm down event and delete db.

Parameters:lb_id – vip id for v1 and lbaas_id for v2
delete_vm_function(port_id, vm=None)
dhcp_agent_network_add(dhcp_net_info)

Process dhcp agent net add event.

dhcp_agent_network_remove(dhcp_net_info)

Process dhcp agent net remove event.

get_dci_id(tenant_id)
get_project_name(tenant_id)
listener_create_event(listener_info)

Process listener create event.

This is lbaas v2 vif will be plugged into ovs when first listener is created and unpluged from ovs when last listener is deleted

listener_delete_event(listener_info)

Process listener delete event.

This is lbaas v2 vif will be plugged into ovs when first listener is created and unpluged from ovs when last listener is deleted. as the data only contains listener id, we will scan all loadbalancers from db and delete the vdp if their admin state is down in that loadbalancer

loadbalancer_delete_event(lb_info)

Process loadbalancer delete event.

This is lbaas v2

need_dhcp_check()
network_create_event(network_info)

Process network create event.

Save the network information in the database.

network_create_func(net)

Create network in database and dcnm :param net: network dictionary

network_delete_event(network_info)

Process network delete event.

neutronclient
pool_create_event(pool_info)

Process pool create event.

Extract pool info and get listener info and call next listen_create_event

port_create_event(port_info)
port_delete_event(port_info)
port_update_event(port_info)
process_data(data)
process_queue()
project_create_event(proj_info)

Create project.

project_create_func(proj_id, proj=None)

Create project given project uuid

project_delete_event(proj_info)

Process project delete event.

project_update_event(proj_info)

Process project update event.

There could be change in project name. DCNM doesn’t allow change in project (a.k.a tenant). This event may be received for the DCI update. If the change is for DCI, update the DCI portion of the project name and send the update event to the DCNM.

register_segment_dcnm(cfg, seg_id_min, seg_id_max)

Register segmentation id pool with DCNM.

Get the uplink from the database and send the info to the agent.

request_vms_info(payload)

Get the VMs from the database and send the info to the agent.

send_vm_info(vm_info)

Send vm info to the compute host. it will return True/False

service_vnic_create(vnic_info_arg)
service_vnic_delete(vnic_info_arg)
set_static_ip_address(payload)

Set static ip address for a VM.

start_rpc()
stop_rpc()
subnet_create_event(subnet_info)

Process subnet create event.

sync_networks()

sync networks.

It will retrieve networks from neutron and populate them in dfa database and dcnm

sync_projects()

Sync projects.

This function will retrieve project from keystone and populate them dfa database and dcnm

turn_on_dhcp_check()
update_agent_status(agent, ts)
update_port_ip_address()

Find the ip address that assinged to a port via DHCP

The port database will be updated with the ip address.

update_project_info_cache(pid, dci_id=None, name=None, opcode=’add’, result=’SUCCESS’)
vip_create_event(vip_info)

Process vip create event.

vip_delete_event(vip_info)

Process vip delete event.

vm_result_update(payload)

Update the result field in VM database.

This request comes from an agent that needs to update the result in VM database to success or failure to reflect the operation’s result in the agent.

class networking_cisco.apps.saf.server.dfa_server.RpcCallBacks(obj)

Bases: object

RPC call back methods.

heartbeat(context, msg)

Process heartbeat message from agents on compute nodes.

is_mand_arg_present(intf_dict)

Check if mndatory parameters is present for LLDPAD.

Just checking for 2 parameters.

Process uplink message from an agent.

request_vms_info(context, agent)

Process request for VM information from an agent.

save_topo_disc_params(context, msg)
set_static_ip_address(context, msg)

Process request for setting rules in iptables.

In cases that static ip address is assigned for a VM, it is needed to update the iptables rule for that address.

update_vm_result(context, msg)

Update VM’s result field in the DB.

The result reflects the success of failure of operation when an agent processes the vm info.

networking_cisco.apps.saf.server.dfa_server.dfa_server()
networking_cisco.apps.saf.server.dfa_server.save_my_pid(cfg)