neutron 相关agent 服务分析
neutron 相关agent 服务分析
我们回到 dhcp_agent 服务在来看代码:
1 | def init(args, **kwargs): |
##初始化manager 服务的详细分析
manager = neutron.agent.dhcp.agent.DhcpAgentWithStateReport 的详细分析
1 | class DhcpAgentWithStateReport(DhcpAgent): |
##dhcp 服务所要执行的linux的shell 命令汇总
- kill -9 $pid 关闭dnsmasq 服务
- /var/lib/neutron/dhcp/827$uuid 删除dnsmasq 的配置文件
- u’ip netns exec qdhcp-827b355e-4348-41e8-96c7-c99e0ba08126 ip link set ns-b9f61118-2f up’ 启动网卡
- [‘sudo’, ‘ip’, ‘netns’, ‘exec’, ‘qdhcp-827b355e-4348-41e8-96c7-c99e0ba08126’, ‘ip’, ‘-o’, ‘link’, ‘show’, ‘ns-b9f61118-2f’]
- sudo ip netns exec qdhcp-827b355e-4348-41e8-96c7-c99e0ba08126 ip addr show ns-b9f61118-2f permanent
- sudo ip netns exec qdhcp-827b355e-4348-41e8-96c7-c99e0ba08126 ip route list dev ns-b9f61118-2f
- sudo ip netns exec qdhcp-827b355e-4348-41e8-96c7-c99e0ba08126 dnsmasq –no-hosts –no-resolv –strict-order –except-interface=lo –pid-file=/var/lib/neutron/dhcp/827b355e-4348-41e8-96c7-c99e0ba08126/pid –dhcp-hostsfile=/var/lib/neutron/dhcp/827b355e-4348-41e8-96c7-c99e0ba08126/host –addn-hosts=/var/lib/neutron/dhcp/827b355e-4348-41e8-96c7-c99e0ba08126/addn_hosts –dhcp-optsfile=/var/lib/neutron/dhcp/827b355e-4348-41e8-96c7-c99e0ba08126/opts –dhcp-leasefile=/var/
lib/neutron/dhcp/827b355e-4348-41e8-96c7-c99e0ba08126/leases –dhcp-match=set:ipxe,175 –bind-interfaces –interface=ns-b9f61118-2f –dhcp-range=set:tag0,192.168.222.0,static,86400s –dhcp-lease-max=256 –conf-file= –domain=openstacklocal 启动 dnsmasq 服务
总结 每一个namespace网络都会有相应的 dnsmasq 服务
##linux bridge 服务所要执行的linux的shell命令汇总
- ip link add vxlan-1 type vlan id 1 dev eth0 proxy
- bridge fdb append 00:00:00:00:00:00 dev vxlan-1 dst 1.1.1.1
- ip -o link show vxlan-1
- sudo ip link set vxlan-1 down
- sudo ip link delete vxlan-1