VMI list got with a VM id as backref-id filter has incorrect fq-name

Bug #1478435 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Medium
Prakash Bailkeri
Trunk
Fix Committed
Medium
Prakash Bailkeri

Bug Description

R2.20 Build 71

Below curl command returned incorrect fqname for all the vmis.

curl -u admin:contrail123 "http://127.0.0.1:8095/virtual-machine-interfaces?count=False&back_ref_id=30e6afac-c7b8-4a70-9fdb-55471b6bde05" | python -m json.tool

  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 629 100 629 0 0 170k 0 --:--:-- --:--:-- --:--:-- 204k
{
    "virtual-machine-interfaces": [
        {
            "fq_name": [
                "backref",
                "virtual_machine_interface"
            ],
            "href": "http://127.0.0.1:8095/virtual-machine-interface/958aba98-7b23-48e1-a044-09cce4c107d2",
            "uuid": "958aba98-7b23-48e1-a044-09cce4c107d2"
        },
        {
            "fq_name": [
                "backref",
                "virtual_machine_interface"
            ],
            "href": "http://127.0.0.1:8095/virtual-machine-interface/7aca8e5f-d947-4c1e-919b-2f2e8b7428bb",
            "uuid": "7aca8e5f-d947-4c1e-919b-2f2e8b7428bb"
        },
        {
            "fq_name": [
                "backref",
                "virtual_machine_interface"
            ],
            "href": "http://127.0.0.1:8095/virtual-machine-interface/2a867ba1-bf90-4d54-83c8-d32a18d259f7",
            "uuid": "2a867ba1-bf90-4d54-83c8-d32a18d259f7"
        }
    ]
}
root@nodec1:~/github/mine/tor/contrail-test-verify-on-setup#

root@nodec1:~/github/mine/tor/contrail-test-verify-on-setup# curl -u admin:contrail123 http://127.0.0.1:8095/virtual-machine-interface/958aba98-7b23-48e1-a044-09cce4c107d2 | python -m json.tool
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 2246 100 2246 0 0 460k 0 --:--:-- --:--:-- --:--:-- 548k
{
    "virtual-machine-interface": {
        "display_name": "default-domain__admin__si1__1__left__2",
        "fq_name": [
            "default-domain",
            "admin",
            "default-domain__admin__si1__1__left__2"
        ],
        "href": "http://127.0.0.1:8095/virtual-machine-interface/958aba98-7b23-48e1-a044-09cce4c107d2",
        "id_perms": {
            "created": "2015-07-09T06:03:21.927791",
            "creator": null,
            "description": null,
            "enable": true,
            "last_modified": "2015-07-09T06:03:24.579055",
            "permissions": {
                "group": "KeystoneServiceAdmin",
                "group_access": 7,
                "other_access": 7,
                "owner": "admin",
                "owner_access": 7
            },
            "user_visible": true,
            "uuid": {
                "uuid_lslong": 11548366120100628434,
                "uuid_mslong": 10775630222501038305
            }
        },
        "name": "default-domain__admin__si1__1__left__2",
        "parent_href": "http://127.0.0.1:8095/project/cbed4e09-c2e8-4ccf-9bff-6dc58b4c089a",
        "parent_type": "project",
        "parent_uuid": "cbed4e09-c2e8-4ccf-9bff-6dc58b4c089a",
        "routing_instance_refs": [
            {
                "attr": {
                    "direction": "both",
                    "dst_mac": null,
                    "mpls_label": null,
                    "protocol": null,
                    "service_chain_address": null,
                    "src_mac": null,
                    "vlan_tag": null
                },
                "href": "http://127.0.0.1:8095/routing-instance/0db6e061-2c5e-4b6c-825b-1b757aa6c09e",
                "to": [
                    "default-domain",
                    "admin",
                    "vn3",
                    "vn3"
                ],
                "uuid": "0db6e061-2c5e-4b6c-825b-1b757aa6c09e"
            }
        ],
        "security_group_refs": [
            {
                "attr": null,
                "href": "http://127.0.0.1:8095/security-group/e2987209-c613-4207-83df-d37aeb4b5d0c",
                "to": [
                    "default-domain",
                    "admin",
                    "default"
                ],
                "uuid": "e2987209-c613-4207-83df-d37aeb4b5d0c"
            }
        ],
        "uuid": "958aba98-7b23-48e1-a044-09cce4c107d2",
        "virtual_machine_interface_device_owner": "compute:None",
        "virtual_machine_interface_mac_addresses": {
            "mac_address": [
                "02:90:86:38:a2:2d"
            ]
        },
        "virtual_machine_interface_properties": {
            "interface_mirror": null,
            "local_preference": null,
            "service_interface_type": "left",
            "sub_interface_vlan_tag": null
        },
        "virtual_machine_refs": [
            {
                "attr": null,
                "href": "http://127.0.0.1:8095/virtual-machine/30e6afac-c7b8-4a70-9fdb-55471b6bde05",
                "to": [
                    "30e6afac-c7b8-4a70-9fdb-55471b6bde05"
                ],
                "uuid": "30e6afac-c7b8-4a70-9fdb-55471b6bde05"
            }
        ],
        "virtual_network_refs": [
            {
                "attr": null,
                "href": "http://127.0.0.1:8095/virtual-network/a5d16f37-b766-4e9f-940f-b952a3a1ab99",
                "to": [
                    "default-domain",
                    "admin",
                    "vn3"
                ],
                "uuid": "a5d16f37-b766-4e9f-940f-b952a3a1ab99"
            }
        ]
    }
}

Tags: config
Changed in juniperopenstack:
assignee: Hampapur Ajay (hajay) → Prakash Bailkeri (prakashmb)
Revision history for this message
Prakash Bailkeri (prakashmb) wrote :

Backref query returns in following format.
x=OBJ_UUID_TABLE.multiget(['8ab1860f-67ff-4687-8e87-d583e4844401'], column_start='backref:virtual_machine_interface:', column_finish='backref:virtual_machine_interface;', column_count=100)

>>> print x
OrderedDict([('8ab1860f-67ff-4687-8e87-d583e4844401', OrderedDict([('backref:virtual_machine_interface:e0ed2693-9bea-40fc-8940-afbf764e1cf0', u'{"is_weakref": false, "attr": null}')]))])
>>>

which is [('backref:<type>:<uuid>', (<val>,<ts>), *]

But the code assumes [('<fqnstr>:<uuid>', (<val>,<ts>), *]

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

Review in progress for https://review.opencontrail.org/12634
Submitter: Prakash Bailkeri (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/12637
Submitter: Prakash Bailkeri (<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/12640
Submitter: Prakash Bailkeri (<email address hidden>)

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

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

commit 426ae094db366b4faeb8f7bc9343c6d3a60ca78a
Author: Prakash M Bailkeri <email address hidden>
Date: Mon Jul 27 15:59:10 2015 +0530

fq_name from cassandra list query

Wrong fields are access to fetch the fq_name while querying with backref_id.

Fix the code to extract correct fq_name. Existing unit tests test the list with backref_id but it is missing fq_name validation. Added code in unit test to validate the fq_name

Change-Id: Ib3ea70bb83080a29a26ec123b2df1ca5b191af49
Closes-bug: #1478435

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

Reviewed: https://review.opencontrail.org/12634
Committed: http://github.org/Juniper/contrail-generateDS/commit/0e253f37aa7bfef0b2ce0e64c5c3e5c3e7716d49
Submitter: Zuul
Branch: master

commit 0e253f37aa7bfef0b2ce0e64c5c3e5c3e7716d49
Author: Prakash M Bailkeri <email address hidden>
Date: Mon Jul 27 14:38:01 2015 +0530

fq_name from cassandra list query

Wrong fields are access to fetch the fq_name while querying with backref_id.

Fix the code to extract correct fq_name. Existing unit tests test the list with backref_id. But it doesn't verify the fq_name.Test code will be fixed in next commit.

Change-Id: I023367254717237a2724f28c5e03aa621a38ac40
Related-bug: #1478435

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

Reviewed: https://review.opencontrail.org/12640
Committed: http://github.org/Juniper/contrail-generateDS/commit/ea77bc86b6ffdd377491ebd2db83e533816e3578
Submitter: Zuul
Branch: R2.20

commit ea77bc86b6ffdd377491ebd2db83e533816e3578
Author: Prakash M Bailkeri <email address hidden>
Date: Mon Jul 27 14:38:01 2015 +0530

fq_name from cassandra list query

Wrong fields are access to fetch the fq_name while querying with backref_id.

Fix the code to extract correct fq_name. Existing unit tests test the list with backref_id. But it doesn't verify the fq_name.Test code will be fixed in next commit.

Change-Id: I023367254717237a2724f28c5e03aa621a38ac40
Closes-bug: #1478435
(cherry picked from commit 0e253f37aa7bfef0b2ce0e64c5c3e5c3e7716d49)

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.