VM interface connect fail if vm name has whitespace in it

Bug #1519768 reported by Harish Kumar
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Medium
Harish Kumar
R2.21.x
Fix Committed
Medium
Harish Kumar
R2.22.x
Fix Committed
Medium
Harish Kumar
Trunk
Fix Committed
Medium
Harish Kumar

Bug Description

In case VM have a space in the name, VM create but vrouter-port-control fail to register the port to vrouter and thus vm will not be available in the network.

This is reported by users and also I confirmed that it is happening.

This is a bug in vrouter-port-control which split the argument string (nova-rootwrap send multiple arguments as single string), which is causing the vm name with space in it split in multiple arguments which cause argparse to break. One of the possible solution is to do regex based split to avoid splitting arguments with space in it.

>>> Original post in the mailing list

From: Maciej Lecki <email address hidden>
Subject: [Users] Can Contrail 2.21 handle instance names with spaces?
Date: November 23, 2015 9:58:01 PM GMT+05:30
To: "<email address hidden>" <email address hidden>

I just observed that if i put a whitespace in my instance name, my instance can never connect to the network. Are whitespaces allowed in Instance names when using Contrail?

BTW - this is what happens in nova-compute.log when i try to boot a instance with whitespaces in the name:

2015-11-23 08:04:34.885 1867 ERROR nova.virt.libvirt.vif [-] [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] Failed while plugging vif
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] Traceback (most recent call last):
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 593, in plug_vrouter
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] utils.execute('vrouter-port-control', cmd_args, run_as_root=True)
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] File "/usr/lib/python2.7/dist-packages/nova/utils.py", line 163, in execute
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] return processutils.execute(*cmd, **kwargs)
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] File "/usr/lib/python2.7/dist-packages/nova/openstack/common/processutils.py", line 203, in execute
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] cmd=sanitized_cmd)
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] ProcessExecutionError: Unexpected error while running command.
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] Command: sudo nova-rootwrap /etc/nova/rootwrap.conf vrouter-port-control --oper=add --uuid=f8c0e7c4-580c-40b2-b1b7-ef105cd57ebf --instance_uuid=aaf64e04-d792-4ed6-82fe-c83c4424be99 --vn_uuid=0d7d6379-3771-46b4-af96-ee95556097d5 --vm_project_uuid=de7d3ecd59e14fe5a87ffc4545de8e3f --ip_address=192.168.0.3 --ipv6_address=None --vm_name=maciej instance a --mac=02:f8:c0:e7:c4:58 --tap_name=tapf8c0e7c4-58 --port_type=NovaVMPort --tx_vlan_id=-1 --rx_vlan_id=-1
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] Exit code: 2
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] Stdout: u''
2015-11-23 08:04:34.885 1867 TRACE nova.virt.libvirt.vif [instance: aaf64e04-d792-4ed6-82fe-c83c4424be99] 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]\nvrouter-port-control: error: unrecognized arguments: instance a\n'

Harish Kumar (hkumarmk)
summary: - VM interface connect fail if vm name has space in it
+ VM interface connect fail if vm name has whitespace in it
Harish Kumar (hkumarmk)
Changed in juniperopenstack:
status: New → In Progress
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/15474
Submitter: Harish Kumar (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/15474
Committed: http://github.org/Juniper/contrail-controller/commit/a12c12cfedaf4a7d0659ac278e6a64393e2f5fae
Submitter: Zuul
Branch: master

commit a12c12cfedaf4a7d0659ac278e6a64393e2f5fae
Author: hkumarmk <email address hidden>
Date: Mon Nov 30 12:18:51 2015 +0530

Handle VMs with whitespace in the name

vrouter-port-control script fail when there is a whitespace in the vm
name (in fact in any of the arguments).

This patch add a regex based split on vrouter-port-control to fix that,
so that it will pass the arguments with whitespace in it correctly.

Change-Id: Ibf52dc23321d1c4c7f231cb5cd386afa495de0aa
Fixes-Bug: #1519768
Signed-off-by: hkumarmk <email address hidden>

tags: added: security vrouter
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.21.x

Review in progress for https://review.opencontrail.org/16468
Submitter: Harish Kumar (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.20

Review in progress for https://review.opencontrail.org/16469
Submitter: Harish Kumar (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/16468
Committed: http://github.org/Juniper/contrail-controller/commit/dd0c8bb54f7b1798dc790f5359588fd423a9e383
Submitter: Zuul
Branch: R2.21.x

commit dd0c8bb54f7b1798dc790f5359588fd423a9e383
Author: hkumarmk <email address hidden>
Date: Mon Nov 30 12:18:51 2015 +0530

Handle VMs with whitespace in the name

vrouter-port-control script fail when there is a whitespace in the vm
name (in fact in any of the arguments).

This patch add a regex based split on vrouter-port-control to fix that,
so that it will pass the arguments with whitespace in it correctly.

Change-Id: Ibf52dc23321d1c4c7f231cb5cd386afa495de0aa
Fixes-Bug: #1519768
Signed-off-by: hkumarmk <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/16469
Committed: http://github.org/Juniper/contrail-controller/commit/841a10577980bff37d957a31f7fc309c241991a5
Submitter: Zuul
Branch: R2.20

commit 841a10577980bff37d957a31f7fc309c241991a5
Author: hkumarmk <email address hidden>
Date: Mon Nov 30 12:18:51 2015 +0530

Handle VMs with whitespace in the name

vrouter-port-control script fail when there is a whitespace in the vm
name (in fact in any of the arguments).

This patch add a regex based split on vrouter-port-control to fix that,
so that it will pass the arguments with whitespace in it correctly.

Change-Id: Ibf52dc23321d1c4c7f231cb5cd386afa495de0aa
Fixes-Bug: #1519768
Signed-off-by: hkumarmk <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.22.x

Review in progress for https://review.opencontrail.org/16686
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged
Download full text (8.5 KiB)

Reviewed: https://review.opencontrail.org/16686
Committed: http://github.org/Juniper/contrail-controller/commit/156ad0b760f9b532572116d813d7afa695555bea
Submitter: Zuul
Branch: R2.22.x

commit 156ad0b760f9b532572116d813d7afa695555bea
Author: Atul Moghe <email address hidden>
Date: Mon Dec 21 14:29:14 2015 -0800

Cherry pick controller commits from R2.20 to R2.22.x
updating version.info from 2.22 to 2.23 in 2.20 branch
Closes-Bug:#1528370

Change-Id: Ic649422979a926cc5f5b8457c01610b848dc206b

Storage stats daemon fix

Partial-Bug: #1528327
Fixed latency monitor code based on the Ceph 0.94.3 version.
Fixed issues in OSD throughput/IOPs calculation.
Updated code based on the latest Sandesh apis.

Change-Id: I12caf951f84c8b213b1b5ec01371bb68b4c48cb3

Fix contrail-collector back pressure mechanism

contrail-collector DB queue back presssure mechanism was not
working since the DB drop level is initialized to INVALID and
even the water marks levels are INVALID and hence the defer/undefer
callbacks are not called.

Change-Id: Ib28141a69aeed3c4ad6f50abbaed2a285e3e7db2
Partial-Bug: #1528380

Fix Agent crash for flow index tree management

Issue:
------
During a flow index change vrouter-agent triggers a delete
on index tree using new flow handle instead of currently
held flow_handle resulting in flow entry getting associated
to two slots in the flow index tree, which further on flow
entry delete due to aging or eviction never releases the
slot for old flow handle, causing failures for further
insertions in the flow index tree

Fix:
----
Avoid taking flow handle as argument to DeleteByIndex and
use the currently associated flow_handle to remove from tree
Adding assert in DeleteByIndex to catch delete failure
Avoid doing delete from index tree in code paths other than
flow entry index update of flow entry delete.

Add logic for KSync Sock User to Mock vrouter behavior
returning index for an entry if it is already allocated
instead of allocating a new one.

Closes-Bug: 1527425
Change-Id: I10e77fb59650acfdd924a5f1d35d6b8dea03a3f0

Fix discovery dependency issue. Originally made in master branch
via https://review.opencontrail.org/#/c/15749

Change-Id: I5d874de3714074c66fa73bfd7c9119772dc681fd
Partial-Bug: #1530186

Avoid calling get_routing_instances on VN object

Calling get_routing_instances could trigger another read of the VN
if the VN has no routing instance. This is not only inefficient, but
could also cause exception if the VN has disappeared. We can avoid
this by calling getattr.

Change-Id: Ie5500585b9e6c578576276c2c04ec03f32c75112
Partial-Bug: 1528950

Fix Centos 65 agent compilation issues.
Closes-Bug: #1532159

Change-Id: Ia8b77619c80737000d5bd949534c9e0a16967359

Closes-Bug: #1524063, contrail-status is showing contrail-web-ui, even it is not configured, in case of SMLite

Change-Id: I55afc19140b1ce52b3b529a644124705de5ce6a8

Fix a corner case with routing instance delete

Sequence of event that causes the crash
1. Static route config deleted
2. Static Route maanger triggers resolve_trigger_ to re-evaluate static
route config
3. Before the resolve trigger is invoked routing instance is deleted

Resolve trigger calls ProcessStaticRouteConfi...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.