*** lemko has joined #cloudkitty | 09:11 | |
*** openstackgerrit has joined #cloudkitty | 09:22 | |
openstackgerrit | Merged openstack/cloudkitty-specs master: Spec: Add some details to state management https://review.openstack.org/635476 | 09:22 |
---|---|---|
openstackgerrit | Hervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis https://review.openstack.org/636667 | 09:25 |
openstackgerrit | Hervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis https://review.openstack.org/636667 | 09:28 |
openstackgerrit | Merged openstack/cloudkitty master: Added details to storage state https://review.openstack.org/635779 | 10:12 |
openstackgerrit | Luka Peschke proposed openstack/cloudkitty master: Fix InfluxDB storage total() method pagination https://review.openstack.org/636896 | 10:15 |
openstackgerrit | Luka Peschke proposed openstack/cloudkitty master: Fix InfluxDB storage total() method pagination https://review.openstack.org/636896 | 10:18 |
openstackgerrit | Hervé Beraud proposed openstack/cloudkitty master: [WIP] Add bandit for security static analysis https://review.openstack.org/636667 | 10:50 |
*** jquiroga has joined #cloudkitty | 14:28 | |
jquiroga | Hey | 14:28 |
jquiroga | Im 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 collection | 14:29 |
peschk_l | jquiroga: 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_l | jquiroga: 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 |
jquiroga | Okay i asked the other way around | 15:11 |
jquiroga | the problem is it rates when the vm is shutdown, the example instance_uptime_flavor_id, so i want the oposite, sorry | 15:11 |
peschk_l | jquiroga: all right, have you tried the doc example ? | 15:13 |
jquiroga | Going to do that now | 15:13 |
peschk_l | jquiroga: okay, please let me know ifthis works for you! Just for the record: which version are you running ? | 15:14 |
jquiroga | Cloud kitty that supports pike | 15:14 |
jquiroga | its 6.0 i think | 15:14 |
peschk_l | jquiroga: Oh. the config exmaple won't work then | 15:24 |
peschk_l | what's your gnocchi version ? | 15:24 |
peschk_l | if gnocchi is >=4.1, you could upgrade clouditty only | 15:25 |
jquiroga | yep i could see that | 15:27 |
jquiroga | checking gnocchi version | 15:27 |
jquiroga | gnocchi 3.3.1 | 15:28 |
jquiroga | so, the other way would be coming back to the json processed by cloudkitty | 15:30 |
jquiroga | and a pyscript | 15:30 |
jquiroga | thing is i cannot find the correct documentation to the structure, get the cpu and just a simple if would do the trick | 15:31 |
jquiroga | import 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.D | 15:34 |
jquiroga | im trying with this script | 15:35 |
jquiroga | https://pastebin.com/CGLD7g6z | 15:35 |
jquiroga | getting this error | 15:35 |
jquiroga | ERROR cloudkitty data['rating']['price'] += res ERROR cloudkitty TypeError: unsupported operand type(s) for +=: 'NoneType' and 'Decimal' | 15:35 |
jquiroga | im 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 number | 15:36 |
jquiroga | also 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.roo | 15:41 |
jquiroga | u'memory':1024.0, u'project_id':u'aa65dc57efec481e9f705c92c7301ce2', u'cpu':98136902815.0 } } | 15:41 |
jquiroga | other approach would be to add more logging so print the processed dict to the logs and then fix the issue | 15:54 |
*** jquiroga has quit IRC | 17:56 | |
*** jquiroga has joined #cloudkitty | 17:56 | |
jquiroga | @lpeschke any thoughts ? or did you write anything i had to reload de windows | 19:01 |
*** lemko has quit IRC | 20:09 | |
*** jquiroga has quit IRC | 21:24 | |
*** lemko has joined #cloudkitty | 21:57 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!