Re: [openstack-dev] [gnocchi][ceilometer] gnocchi-metricd error using redis as coordination

2017-08-07 Thread Along Meng
>From the log info,It shows that your 'node' maybe is not the valid str.
You can show the node name via 'print node' and try to call
str(node).encode('utf-8')
, identify does it can goes well.

2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils key =
str(node).encode('utf-8')
2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils UnicodeDecodeError:
'ascii' codec can't decode byte 0xde in position 4: ordinal not in
range(128)
2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils



On Sat, Aug 5, 2017 at 7:16 PM, Yaguang Tang  wrote:

> Hi gnocchi devs,
>
> I have an issue when using gnocchi 4.0, the storage backend is ceph, and
> tooz coordination is redis. currently  gnocchi api in apache wsgi mode,
> only one controller node running gnocchi-metricd & gnocchi-statsd daemon.
> the error log of gnocchi-metricd is as follow.
>
>
>
> 2017-08-05 18:14:18.643 1329257 INFO gnocchi.storage.common.ceph [-] Ceph
> storage backend use 'cradox' python library
> 2017-08-05 18:14:18.654 1329257 INFO gnocchi.storage.common.ceph [-] Ceph
> storage backend use 'cradox' python library
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils [-] Unhandled
> exception
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils Traceback (most
> recent call last):
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/cotyledon/_utils.py", line 84, in
> exit_on_exception
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils yield
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/cotyledon/_service.py", line 139, in
> _run
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils self.run()
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/gnocchi/cli.py", line 120, in run
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils
> self._configure()
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 87, in
> wrapped_f
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils return
> r.call(f, *args, **kw)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 177, in call
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils return
> fut.result()
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 396,
> in result
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils return
> self.__get_result()
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 159, in call
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils result =
> fn(*args, **kwargs)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/gnocchi/cli.py", line 193, in _configure
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils self.GROUP_ID,
> partitions=200)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tooz/coordination.py", line 284, in
> join_partitioned_group
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils return
> partitioner.Partitioner(self, group_id)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tooz/partitioner.py", line 45, in
> __init__
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils
> partitions=self.partitions)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tooz/hashring.py", line 47, in __init__
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils
> self.add_nodes(set(nodes))
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils   File
> "/usr/lib/python2.7/site-packages/tooz/hashring.py", line 71, in add_nodes
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils key =
> str(node).encode('utf-8')
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils UnicodeDecodeError:
> 'ascii' codec can't decode byte 0xde in position 4: ordinal not in
> range(128)
> 2017-08-05 18:14:19.100 1329257 ERROR cotyledon._utils
>
> Is this a config issue or bug ? any tips or help is much appreciated :-)
>
>
> --
> Tang Yaguang
>
>
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [ceilometer]The principle of restrict the scope of returned events

2017-08-07 Thread Along Meng
OK,thanks @gord

Look forward to other people's suggestion.

On Sat, Aug 5, 2017 at 12:12 AM, gordon chung <g...@live.ca> wrote:

> hi,
>
> i think this is best to ask this on mailing list. to be honest, i do not
> work on Panko much anymore. feel free to propose something if it doesn't
> meet your requirements.
>
> On 04/08/17 10:59 AM, Along Meng wrote:
> > HI, gord
> >
> > https://review.openstack.org/#/c/218706
> >
> > As the above patch you submitted shows that: ceilometer will restricts
> > the scope of returned events. if admin role,
> > user is allowed to query all events which have traits.project_id
> > value*that match it's own project*OR any event without any project_id
> trait.
> >
> > I think if admin role, user is allowed to query all events *no matter
> the *
> > *traits.project_id value match it's own project or not *is more property.
> >
> > So, I wonder to know why we designed the principle like your patch's
> > commit-message shows.
> > Thanks
> >
> > MengAlong
>
> --
> gord
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [ceilometer][panko] Ocata ceilometer event storage configuration

2017-06-29 Thread Along Meng
Yes, and you need make sure ceilometer-agent-notification and panko was
intalled in a same machine in your environment.
Because ceilometer will load the publisher dispatcher panko from the module
panko and use the database url[1] which configured in panko.conf to init
the database connection.

[1]
https://github.com/openstack/panko/blob/stable/ocata/panko/dispatcher/database.py#L43

MengAlong


On Thu, Jun 29, 2017 at 8:56 PM, gordon chung  wrote:

>
>
> On 29/06/17 07:24 AM, Yaguang Tang wrote:
> > sinks:
> > - name: event_sink
> >   transformers:
> >   triggers:
> >   publishers:
> >   - direct://
> >   - panko://
>
> the publisher path is only available if you have Pike Panko. you need to
> either backport[1] or configure your publisher as:
>
> direct://?dispatcher=panko
>
>
> [1]
> https://github.com/openstack/panko/commit/d785015552937455d76f083d313a73
> a7c0c076b3
>
> cheers,
> --
> gord
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [telemetry][ceilometer]Cannot get vmware virtual machine's disk usage rate via vsphere inspector

2017-06-29 Thread Along Meng
HI,gord

Thanks for your infomation.
But I think vmware driver already support my requirement because It's docs
indicate it's already support the counter.
Maybe just the vsphere inspector in ceilometer haven't implement the
interface or we need add some other configuration in ceilometer.
So, is there any one know something about vsphere inspector in ceilometer
can give me some advice?
And I'll try to contact some developers on vmware driver for some help.

MengAlong

On Thu, Jun 29, 2017 at 8:58 PM, gordon chung <g...@live.ca> wrote:

> i'll be honest, i don't think any of the active developers on Ceilometer
> uses or knows anything about vmware driver. you will probably want to
> reach out to vmware themselves so they can provide support or fix the
> driver (or ideally move the vmware driver to their own repo).
>
> On 28/06/17 10:34 AM, Along Meng wrote:
> >
> > HI, all
> >
> > Today I try to add a new pollster plugin in ceilometer-agent-compute to
> > collect vmware virtual machines's disk usage rate.
> >
> > After researched the vmware docs:
> > https://www.vmware.com/support/developer/converter-
> sdk/conv61_apireference/disk_counters.html#usage
> > <https://www.vmware.com/support/developer/converter-
> sdk/conv61_apireference/disk_counters.html#usage>
> >
> > I think I can call the vsphere inspector get the
> > counter capacity.provisioned and capacity.usage.
> > Then I can get the virtual machine's disk usage rate via: disk_util
> > = capacity.usage/capacity.provisioned
> >
> > *But, when I add a new function in vsphere inspector like below, It
> > cannot get any data from vcenter:*
> > My example code like this:
> >
> > ceilometer.compute.virt.vmware.inspector.VsphereInspector#inspect_disks
> > 
> =
> > def inspect_disks(self, instance, duration=None):
> > vm_moid = self._ops.get_vm_moid(instance.id <http://instance.id/>)
> > if not vm_moid:
> > raise virt_inspector.InstanceNotFoundException(
> > _('VM %s not found in VMware vSphere') % instance.id
> > <http://instance.id/>)
> >
> > VC_DISK_PROVISIONED_CNTR = "disk:capacity.provisioned:average"
> > disk_counter_id =
> > self._ops.get_perf_counter_id(VC_DISK_PROVISIONED_CNTR)
> > disk_infos = self._ops.query_vm_aggregate_stats(vm_moid,
> > mem_counter_id, duration)
> > print “The disk info is:%s” % disk_infos
> > 
> 
> >
> > The disk_infos is empty.
> >
> > I try to use these functions to query the counter value:
> > self._ops.query_vm_device_stats(vm_moid, disk_counter_id, duration)
> > self._ops.query_vm_aggregate_stats(vm_moid, mem_counter_id, duration)
> >
> > *But cannot get any data from vcenter, and I'm sure the vcenter service
> > is correct in my env.*
> >
> > *Does anyone know what's wrong with my code? *
> > *Or is there any other solutions for my requirement.*
> >
> > Thanks~
> >
> > ==
> > MengAlong
>
> --
> gord
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [telemetry][ceilometer]Cannot get vmware virtual machine's disk usage rate via vsphere inspector

2017-06-28 Thread Along Meng
HI, all
Today I try to add a new pollster plugin in ceilometer-agent-compute to
collect vmware virtual machines's disk usage rate.

After researched the vmware docs:
https://www.vmware.com/support/developer/converter-
sdk/conv61_apireference/disk_counters.html#usage

I think I can call the vsphere inspector get the counter capacity.provisioned
and capacity.usage.
Then I can get the virtual machine's disk usage rate via: disk_util =
capacity.usage/capacity.provisioned

*But, when I add a new function in vsphere inspector like below, It cannot
get any data from vcenter:*
My example code like this:

ceilometer.compute.virt.vmware.inspector.VsphereInspector#inspect_disks
=
def inspect_disks(self, instance, duration=None):
vm_moid = self._ops.get_vm_moid(instance.id)
if not vm_moid:
raise virt_inspector.InstanceNotFoundException(
_('VM %s not found in VMware vSphere') % instance.id)

VC_DISK_PROVISIONED_CNTR = "disk:capacity.provisioned:average"
disk_counter_id = self._ops.get_perf_counter_id(VC_DISK_PROVISIONED_CNTR
)
disk_infos = self._ops.query_vm_aggregate_stats(vm_moid,
mem_counter_id, duration)
print “The disk info is:%s” % disk_infos


The disk_infos is empty.

I try to use these functions to query the counter value:
self._ops.query_vm_device_stats(vm_moid, disk_counter_id, duration)
self._ops.query_vm_aggregate_stats(vm_moid, mem_counter_id, duration)

*But cannot get any data from vcenter, and I'm sure the vcenter service is
correct in my env.*

*Does anyone know what's wrong with my code? *
*Or is there any other solutions for my requirement.*

Thanks~

==
MengAlong
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev