Comment 7 for bug 1584625

Revision history for this message
Prakash Bailkeri (prakashmb) wrote :

The issue is with "vrouter-port-control" script called for sending plug message to vrouter-agent.

It wrongly parses the VM name and interprets the "--ip_address" which is part of the VM name.

        cmd_args = ("--oper=add --uuid=%s --instance_uuid=%s --vn_uuid=%s "
                    "--vm_project_uuid=%s --ip_address=%s --ipv6_address=%s"
                    " --vm_name=%s --mac=%s --tap_name=%s --port_type=%s "
                    "--tx_vlan_id=%d --rx_vlan_id=%d" % (vif['id'],
                    instance.uuid, vif['network']['id'],
                    instance.project_id, ip_addr, ip6_addr,
                    instance.display_name, vif['address'],
                    vif['devname'], ptype, -1, -1))

On the similar lines, if the vm name contain "--xx", the "plug" will fail from nova compute and VM info will not be sent to vrouter-agent

2016-06-23 11:10:33.840 2544 INFO nova.scheduler.client.report [-] Compute_service record updated for ('contrail64', 'contrail64.juniper.net')
2016-06-23 11:10:34.273 2544 ERROR nova.virt.libvirt.vif [-] [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Failed while plugging vif
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Traceback (most recent call last):
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 593, in plug_vrouter
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] utils.execute('vrouter-port-control', cmd_args, run_as_root=True)
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 163, in execute
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] return processutils.execute(*cmd, **kwargs)
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] File "/usr/lib/python2.7/dist-packages/nova/openstack/common/processutils.py", line 203, in execute
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] cmd=sanitized_cmd)
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] ProcessExecutionError: Unexpected error while running command.
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Command: sudo nova-rootwrap /etc/nova/rootwrap.conf vrouter-port-control --oper=add --uuid=f2782847-4d5d-4d8d-bcf1-358633e4c182 --instance_uuid=626b1b37-507e-41aa-8992-2f77a836c68d --vn_uuid=9fedd29b-5e6b-4213-a5b3-73948fb82264 --vm_project_uuid=f1b93ade003c4215ac63caa95e7e4ba7 --ip_address=50.50.50.46 --ipv6_address=None --vm_name=prakash --ip-address=1.2.3.4 --mac=02:f2:78:28:47:4d --tap_name=tapf2782847-4d --port_type=NovaVMPort --tx_vlan_id=-1 --rx_vlan_id=-1
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Exit code: 2
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Stdout: u''
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] Stderr: u'usage: vrouter-port-control [-h] [--oper {add,delete}] [--uuid UUID]\n [--instance_uuid INSTANCE_UUID]\n [--vn_uuid VN_UUID]\n [--vm_project_uuid VM_PROJECT_UUID]\n [--ip_address IP_ADDRESS]\n [--ipv6_address IPV6_ADDRESS] [--vm_name VM_NAME]\n [--mac MAC] [--tap_name TAP_NAME]\n [--port_type {NovaVMPort,NameSpacePort}]\n [--tx_vlan_id TX_VLAN_ID]\n [--rx_vlan_id RX_VLAN_ID]\n [--no_persist NO_PERSIST]\n [--vif_type {VhostUser,Vrouter}]\nvrouter-port-control: error: unrecognized arguments: --ip-address=1.2.3.4\n'
2016-06-23 11:10:34.273 2544 TRACE nova.virt.libvirt.vif [instance: 626b1b37-507e-41aa-8992-2f77a836c68d]
2016-06-23 11:10:34.746 2544 INFO nova.compute.manager [-] [instance: 626b1b37-507e-41aa-8992-2f77a836c68d] VM Started (Lifecycle Event)