How to retrieve ceilometer statistics for the meter "network.incoming.bytes" for an instance

asked 2014-12-20 03:18:23 -0600

magesh-gv gravatar image

The ceilometer meter network.incoming.bytes takes a resource id in the format <os-ext-srv-attr:instance_name>-<instanceid>-<instancephysicalportname>

I have the instance ID and can retrieve OS-EXT-SRV-ATTR:instance_name using nova API.

Is it possible to fetch the instance physical port name also using any nova API ? I see that it is available in the table instance_info_caches in mysql, but couldnt find any api that retrieves it.

Or is there a better way of retrieving the resource ID to be used here using ceilometer API itself.

Using ceilometer resource list API and checking the resource ids is a overkill in my case as this list is becoming uncontrollably large.

Any help is appreciated.

edit retag flag offensive close merge delete

Comments

Have you tried queries? Like search for resources with metadata.instance_id=<resource_id>?

fetahi gravatar imagefetahi ( 2014-12-27 07:36:16 -0600 )edit

you can query direct to database with SELECT tap.id, tap.network_info FROM instance_info_caches tap WHERE tap.deleted = 0 and tap.instance_uuid="vm_id". But this way is very crazy. I want to call using api openstack

lamhaison gravatar imagelamhaison ( 2015-12-06 06:17:48 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-12-06 06:15:02 -0600

lamhaison gravatar image

updated 2015-12-06 06:33:55 -0600

Hi you. I did do it follow with you(Marmoto). I run command line curl -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' "http://10.200.0.130:9696/v2.0/ports?device_id=af038a23-ac81-42f3-99ea-da3d19892a2c" | json_reformat and result it: { "ports": [ { "status": "ACTIVE", "binding:host_id": "openstackAllinOne", "allowed_address_pairs": [

        ],
        "extra_dhcp_opts": [

        ],
        "device_owner": "compute:nova",
        "binding:profile": {

        },
        "fixed_ips": [
            {
                "subnet_id": "7eb726d2-fda4-4d02-9bf1-caaa4345c344",
                "ip_address": "172.30.41.8"
            }
        ],
        "id": "1109ad82-a1ac-49bb-a451-eaa736125e25",
        "security_groups": [
            "3c8d60c4-dbbb-4cbf-bf7c-6b165353ecba"
        ],
        "device_id": "af038a23-ac81-42f3-99ea-da3d19892a2c",
        "name": "",
        "admin_state_up": true,
        "network_id": "5c327275-1c39-4776-a3ef-fc2789a123cd",
        "tenant_id": "0f9d10741d5d41eea8bee3c241358f25",
        "binding:vif_details": {
            "port_filter": true,
            "ovs_hybrid_plug": true
        },
        "binding:vnic_type": "normal",
        "binding:vif_type": "ovs",
        "mac_address": "fa:16:3e:c3:5b:5a"
    }
]

}

I can't find filed about dev name with tap prefix Please help me

edit flag offensive delete link more

Comments

I do not read carefully. With id port id: 1109ad82-a1ac-49bb-a451-eaa736125e25 then tap name is tap1109ad82-a1

lamhaison gravatar imagelamhaison ( 2015-12-20 23:45:06 -0600 )edit
0

answered 2015-04-29 15:52:27 -0600

if by physical port name you have something like tap844d2678-83 , its in fact tap<11_first_char_of_interface_id>

to get the full interface_id, you can call neutron with /v2.0/ports?device_id=<instance_id>, it will return all the port (interface) of the instance, there you can get the first 11 char of interface_id and create your chain.

On my part, i'm looking for a way to make the network.incoming.bytes call take interface_id as resource_id instead of the actual <os-ext-srv-attr:instance_name>-<instanceid>-<instancephysicalportname> because I dont want to add calls just to create this crappy resource_id chain ....

Hope this help, Marmoto

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

3 followers

Stats

Asked: 2014-12-20 03:18:23 -0600

Seen: 3,068 times

Last updated: Dec 06 '15