Thursday, 2019-02-14

*** lemko has joined #cloudkitty09:11
*** openstackgerrit has joined #cloudkitty09:22
openstackgerritMerged openstack/cloudkitty-specs master: Spec: Add some details to state management  https://review.openstack.org/63547609:22
openstackgerritHervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis  https://review.openstack.org/63666709:25
openstackgerritHervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis  https://review.openstack.org/63666709:28
openstackgerritMerged openstack/cloudkitty master: Added details to storage state  https://review.openstack.org/63577910:12
openstackgerritLuka Peschke proposed openstack/cloudkitty master: Fix InfluxDB storage total() method pagination  https://review.openstack.org/63689610:15
openstackgerritLuka Peschke proposed openstack/cloudkitty master: Fix InfluxDB storage total() method pagination  https://review.openstack.org/63689610:18
openstackgerritHervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis  https://review.openstack.org/63666710:50
*** jquiroga has joined #cloudkitty14:28
jquirogaHey14:28
jquirogaIm trying to make a pyscript to rate when instances are shutdown, for that im using the 'cpu', if there is a better way it would be awesome, also i cannot find the dict used to process the data so i can access to it accordingly, we are using ceilometer with gnocchi for collection14:29
peschk_ljquiroga: If you want to rate shutdown instances, you can use a metrics which does not depend on the state of the instance (like vcpu or ram)15:08
peschk_ljquiroga: and if you DO NOT want to rate instances which are shut down, you can use this cpu + NUMBOOL mutation (see https://docs.openstack.org/cloudkitty/latest/admin/configuration/collector.html#quantity-mutation)15:10
jquirogaOkay i asked the other way around15:11
jquirogathe problem is it rates when the vm is shutdown, the example instance_uptime_flavor_id, so i want the oposite, sorry15:11
peschk_ljquiroga: all right, have you tried the doc example ?15:13
jquirogaGoing to do that now15:13
peschk_ljquiroga: okay, please let me know ifthis works for you! Just for the record: which version are you running ?15:14
jquirogaCloud kitty that supports pike15:14
jquirogaits 6.0 i think15:14
peschk_ljquiroga: Oh. the config exmaple won't work then15:24
peschk_lwhat's your gnocchi version ?15:24
peschk_lif gnocchi is >=4.1, you could upgrade clouditty only15:25
jquirogayep i could see that15:27
jquirogachecking gnocchi version15:27
jquirogagnocchi 3.3.115:28
jquirogaso, the other way would be coming back to the json processed by cloudkitty15:30
jquirogaand a pyscript15:30
jquirogathing is i cannot find the correct documentation to the structure, get the cpu and just a simple if would do the trick15:31
jquirogaimport decimal   # Price for each flavor. These are equivalent to hashmap field mappings. flavors_id_price = {     '251f07b7-e40c-4d7c-b025-20cc3036be7a': decimal.Decimal(0.65),     '8af61796-e4be-4b97-9ded-37a047b35e7c': decimal.Decimal(0.35),     'a6ec9bb0-4be8-4651-84ff-df745aa9525e': decimal.Decimal(1.67),     'c565b92c-cceb-49d9-971c-9ec4d53c7ec4': decimal.Decimal(1.1),     'dbe2de22-305d-4831-92fe-95d801aa5f89': decimal.D15:34
jquirogaim trying with this script15:35
jquirogahttps://pastebin.com/CGLD7g6z15:35
jquirogagetting this error15:35
jquirogaERROR cloudkitty     data['rating']['price'] += res ERROR cloudkitty TypeError: unsupported operand type(s) for +=: 'NoneType' and 'Decimal'15:35
jquirogaim guessing the NoneType comes from my script in one of the returns, could change the cuntion in __init__ but it wont make any sense since its needed to see why there is NoneType instead of 0 or any number15:36
jquirogaalso im assuming the json is this one: {      u'volume':u'1',    u'rating':u'3.44',    u'service':u'compute',    'rate_value':'3.4400',    u'desc':{         u'user_id':u'a6fa01a331c74888a5c56a5bda70e02c',       u'name':u'whitestack-vm',       u'resource_id':u'36741843-00e7-48b6-8ec7-2566b55081e6',       u'disk.ephemeral.size':0.0,       u'vcpus':1.0,       u'instance_id':u'36741843-00e7-48b6-8ec7-2566b55081e6',       u'disk.roo15:41
jquiroga    u'memory':1024.0,       u'project_id':u'aa65dc57efec481e9f705c92c7301ce2',       u'cpu':98136902815.0    } }15:41
jquirogaother approach would be to add more logging so print the processed dict to the logs and then fix the issue15:54
*** jquiroga has quit IRC17:56
*** jquiroga has joined #cloudkitty17:56
jquiroga@lpeschke any thoughts ? or did you write anything i had to reload de windows19:01
*** lemko has quit IRC20:09
*** jquiroga has quit IRC21:24
*** lemko has joined #cloudkitty21:57

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!