Wrong instance_type_id field

Bug #1217429 reported by Yassine
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Shuangtai Tian
OpenStack Compute (nova)
Fix Released
Medium
Shuangtai Tian

Bug Description

Reproduce the bug:

** Config

$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| c91a4dcc-09f3-47c3-8532-8fa93014267c | cirros-0.3.1-x86_64-uec | ACTIVE | |
| 65089976-7382-4177-932f-b32503c86c78 | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| 81ffc23d-9efd-4f32-ac62-dfef9b969241 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+

$ nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

** Now boot a VM with flavor 42 (m1.nano):

$ nova boot server1 --image "c91a4dcc-09f3-47c3-8532-8fa93014267c" --flavor 42
$ nova show server1
+--------------------------------------+----------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------+
| status | ACTIVE |
| updated | 2013-08-27T15:16:10Z |
| OS-EXT-STS:task_state | None |
| OS-EXT-SRV-ATTR:host | controller |
| key_name | None |
| image | cirros-0.3.1-x86_64-uec (c91a4dcc-09f3-47c3-8532-8fa93014267c) |
| private network | 10.0.0.2 |
| hostId | ca0d3c4ec83e031c6117a85e15db2977136d5541494f542f35b49c5a |
| OS-EXT-STS:vm_state | active |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| OS-SRV-USG:launched_at | 2013-08-27T15:16:10.000000 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | controller |
| flavor | m1.nano (42) |
| id | 8c20e949-d340-48cc-81cb-a35d1dbef315 |
| security_groups | [{u'name': u'default'}] |
| OS-SRV-USG:terminated_at | None |
| user_id | 65604ab0988447738de47bb4f8ff734b |
| name | server1 |
| created | 2013-08-27T15:15:49Z |
| tenant_id | 0a9a398a230b445a8968682c72f01d72 |
| OS-DCF:diskConfig | MANUAL |
| metadata | {} |
| os-extended-volumes:volumes_attached | [] |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
+--------------------------------------+----------------------------------------------------------------+

** We can see the corresponding flavor:

| flavor | m1.nano (42)

** Now get the VM details through Ceilometer:

$ curl -H 'X-Auth-Token:b497065bfc2c429b9da5e0988367e832' "http://localhost:8777/v2/resources/8c20e949-d340-48cc-81cb-a35d1dbef315" | python -mjson.tool
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 2439 100 2439 0 0 14554 0 --:--:-- --:--:-- --:--:-- 15634
{
    "links": [
        {
            "href": "http://localhost:8777/v2/resources/8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "self"
        },
        {
            "href": "http://localhost:8777/v2/meters/disk.ephemeral.size?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "disk.ephemeral.size"
        },
        {
            "href": "http://localhost:8777/v2/meters/disk.root.size?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "disk.root.size"
        },
        {
            "href": "http://localhost:8777/v2/meters/instance:m1.nano?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "instance:m1.nano"
        },
        {
            "href": "http://localhost:8777/v2/meters/instance?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "instance"
        },
        {
            "href": "http://localhost:8777/v2/meters/vcpus?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "vcpus"
        },
        {
            "href": "http://localhost:8777/v2/meters/memory?q.field=resource_id&q.value=8c20e949-d340-48cc-81cb-a35d1dbef315",
            "rel": "memory"
        }
    ],
    "metadata": {
        "access_ip_v4": "None",
        "access_ip_v6": "None",
        "architecture": "None",
        "audit_period_beginning": "2013-08-27T15:00:00.000000",
        "audit_period_ending": "2013-08-27T15:15:49.409989",
        "availability_zone": "None",
        "created_at": "2013-08-27 15:15:49.336002",
        "deleted_at": "",
        "disk_gb": "0",
        "display_name": "server1",
        "ephemeral_gb": "0",
        "event_type": "compute.instance.update",
        "host": "api.controller",
        "hostname": "server1",
        "image_meta.base_image_ref": "c91a4dcc-09f3-47c3-8532-8fa93014267c",
        "image_meta.kernel_id": "65089976-7382-4177-932f-b32503c86c78",
        "image_meta.ramdisk_id": "81ffc23d-9efd-4f32-ac62-dfef9b969241",
        "image_ref_url": "http://192.168.1.15:9292/images/c91a4dcc-09f3-47c3-8532-8fa93014267c",
        "instance_id": "8c20e949-d340-48cc-81cb-a35d1dbef315",
        "instance_type": "m1.nano",
        "instance_type_id": "6",
        "kernel_id": "65089976-7382-4177-932f-b32503c86c78",
        "launched_at": "",
        "memory_mb": "64",
        "new_task_state": "scheduling",
        "node": "None",
        "old_state": "None",
        "old_task_state": "None",
        "os_type": "None",
        "ramdisk_id": "81ffc23d-9efd-4f32-ac62-dfef9b969241",
        "reservation_id": "r-rdoha2pl",
        "root_gb": "0",
        "state": "building",
        "state_description": "scheduling",
        "tenant_id": "0a9a398a230b445a8968682c72f01d72",
        "user_id": "65604ab0988447738de47bb4f8ff734b",
        "vcpus": "1"
    },
    "project_id": "0a9a398a230b445a8968682c72f01d72",
    "resource_id": "8c20e949-d340-48cc-81cb-a35d1dbef315",
    "user_id": "65604ab0988447738de47bb4f8ff734b"
}

** We can see a wrong flavor id:

"instance_type": "m1.nano",
"instance_type_id": "6",

Tags: api
description: updated
Revision history for this message
Shuangtai Tian (shuangtai-tian) wrote :

i think it is a nova bug.

Revision history for this message
Yassine (yassine-lamgarchal) wrote :

Yes, actually, in nova database the instance_types table which store every flavors contains two id:
    - "id" which is the primary key (the private id)
    - "flavorid" which is the id provided at the creation of the flavor (the public id)

"instance_type_id" belongs to the table "instances" and is a foreign key for the table instance_types.

I think Nova must publish "flavorid" instead of "instance_type_id".

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
ugvddm (271025598-9)
Changed in nova:
assignee: nobody → ugvddm (271025598-9)
ugvddm (271025598-9)
Changed in ceilometer:
assignee: nobody → ugvddm (271025598-9)
status: Triaged → In Progress
tags: added: api
ugvddm (271025598-9)
Changed in nova:
assignee: ugvddm (271025598-9) → nobody
Changed in ceilometer:
assignee: ugvddm (271025598-9) → nobody
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → Shuangtai Tian (shuangtai-tian)
Changed in ceilometer:
assignee: nobody → Shuangtai Tian (shuangtai-tian)
status: Confirmed → In Progress
Changed in nova:
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/45991

Andrew Laski (alaski)
Changed in nova:
importance: Undecided → Medium
milestone: none → havana-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/45991
Committed: http://github.com/openstack/nova/commit/b752995392e4c14c84cbe1cf6b3c55994199b3ca
Submitter: Jenkins
Branch: master

commit b752995392e4c14c84cbe1cf6b3c55994199b3ca
Author: Shuangtai Tian <email address hidden>
Date: Thu Aug 29 20:18:07 2013 +0800

    Add instance_flavor_id to the notification message

    Through Ceilometer,We can see the notification message just has
    instance_type_id, for example,
        "instance_type" :"m1.nano"
        "instance_type_id": "6",
    There is some confusion ,flavorid "42" should be added to the message.

    bug 1217429

    Change-Id: Id71e9480d243e7fc343bf9f7ea1faf2d87f01541

Changed in nova:
status: In Progress → Fix Committed
Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-rc1 → 2013.2
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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