Ask Your Question

royking's profile - activity

2018-11-06 17:47:11 -0500 asked a question how to change dhcp port ip? Dose neutron port-update works?

Openstack version:Liberty,5 controller nodes and 2 network nodes(dhcp-agent running on both network nodes) I want to update the dhcp port ip for every network,and I use neutron port-update command. For networks with few ports it works, but for network with many ports(330+), it dosn't work and I find all neutron ports status change to pending and neutron-server process occupied too much cpu, finally one controller node goes down. Here is the neutron log:

2018-09-13T03:03:24.686095+08:00 B0609009 neutron-server: 2018-09-13 03:03:24.681 2054653 ERROR oslo_messaging.rpc.dispatcher [req-902a4c1e-c047-4ce5-a716-cd04ebca7f17 - - public - -] Exception during message handling: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: u'SELECT ports.tenant_id AS ports_tenant_id, ports.id AS ports_id, ports.name AS ports_name, ports.network_id AS ports_network_id, ports.mac_address AS ports_mac_address, ports.admin_state_up AS ports_admin_state_up, ports.status AS ports_status, ports.device_id AS ports_device_id, ports.device_owner AS ports_device_owner, ports.dns_name AS ports_dns_name, securitygroupportbindings.security_group_id AS securitygroupportbindings_security_group_id, ipallocations_1.port_id AS ipallocations_1_port_id, ipallocations_1.ip_address AS ipallocations_1_ip_address, ipallocations_1.subnet_id AS ipallocations_1_subnet_id, ipallocations_1.network_id AS ipallocations_1_network_id, securitygroupportbindings_1.port_id AS securitygroupportbindings_1_port_id, securitygroupportbindings_1.security_group_id AS securitygroupportbindings_1_security_group_id, ml2_dvr_port_bindings_1.port_id AS ml2_dvr_port_bindings_1_port_id, ml2_dvr_port_bindings_1.host AS ml2_dvr_port_bindings_1_host, ml2_dvr_port_bindings_1.router_id AS ml2_dvr_port_bindings_1_router_id, ml2_dvr_port_bindings_1.vif_type AS ml2_dvr_port_bindings_1_vif_type, ml2_dvr_port_bindings_1.vif_details AS ml2_dvr_port_bindings_1_vif_details, ml2_dvr_port_bindings_1.vnic_type AS ml2_dvr_port_bindings_1_vnic_type, ml2_dvr_port_bindings_1.profile AS ml2_dvr_port_bindings_1_profile, ml2_dvr_port_bindings_1.status AS ml2_dvr_port_bindings_1_status, allowedaddresspairs_1.port_id AS allowedaddresspairs_1_port_id, allowedaddresspairs_1.mac_address AS allowedaddresspairs_1_mac_address, allowedaddresspairs_1.ip_address AS allowedaddresspairs_1_ip_address, ml2_port_bindings_1.port_id AS ml2_port_bindings_1_port_id, ml2_port_bindings_1.host AS ml2_port_bindings_1_host, ml2_port_bindings_1.vnic_type AS ml2_port_bindings_1_vnic_type, ml2_port_bindings_1.profile AS ml2_port_bindings_1_profile, ml2_port_bindings_1.vif_type AS ml2_port_bindings_1_vif_type, ml2_port_bindings_1.vif_details AS ml2_port_bindings_1_vif_details, qos_port_policy_bindings_1.policy_id AS qos_port_policy_bindings_1_policy_id, qos_port_policy_bindings_1.port_id AS qos_port_policy_bindings_1_port_id, extradhcpopts_1.id AS extradhcpopts_1_id, extradhcpopts_1.port_id AS extradhcpopts_1_port_id, extradhcpopts_1.opt_name AS extradhcpopts_1_opt_name, extradhcpopts_1.opt_value AS extradhcpopts_1_opt_value, extradhcpopts_1.ip_version AS extradhcpopts_1_ip_version \nFROM ports LEFT OUTER JOIN securitygroupportbindings ON ports.id = securitygroupportbindings.port_id LEFT OUTER JOIN ipallocations AS ipallocations_1 ON ports.id = ipallocations_1.port_id LEFT OUTER JOIN securitygroupportbindings AS securitygroupportbindings_1 ON ports.id = securitygroupportbindings_1.port_id LEFT OUTER JOIN ml2_dvr_port_bindings AS ml2_dvr_port_bindings_1 ON ports.id = ml2_dvr_port_bindings_1.port_id LEFT OUTER JOIN allowedaddresspairs AS allowedaddresspairs_1 ON ports.id = allowedaddresspairs_1.port_id LEFT OUTER JOIN ml2_port_bindings AS ml2_port_bindings_1 ON ports.id = ml2_port_bindings_1.port_id LEFT OUTER JOIN qos_port_policy_bindings AS qos_port_policy_bindings_1 ON ports.id = qos_port_policy_bindings_1.port_id LEFT OUTER JOIN extradhcpopts AS extradhcpopts_1 ON ports.id = extradhcpopts_1.port_id \nWHERE ports.id IN (...)[parameters:(335 ports, I dont list them here)]

it seems all ports in this network is updating because dhcp port ip was changed and too much sql query caused the mysql server gose down.