Chargeback - custom items and units?


#1

Hi guys, could you give me a hint how to create a custom chargeback item in ManageIQ? Say, what if I need to charge a customer for allocated IP address or an elastic load balancer in AWS? Is there any way? How would I do that?


#2

Hi, I did a very quick research just to see how difficult it would be to include some custom units to chargeback reports. For anybody interested, here are the main components I have traced down:

/var/www/miq/vmdb/product/chargeback/miq_reports/chargeback_by_vm.yaml
- contains list of columns to be fetched from the “main table”

/var/www/miq/vmdb/db/fixtures/miq_report_formats.yml
- contains predefined format mappings for measured units

/var/www/miq/vmdb/app/models/chargeback.rb
- the actual code which generates the chargeback numbers

It seems like that extending a list of measured items would not be a super-difficult task, if one only needs a few of them. On the other hand, to maintain the code changes out of upstream might possibly bring issues after MIQ upgrades.


#3

@gtanzillo Please respond


#4

Hi @opsourcetrail, Pretty cool that you’re able to extend the functionality of chargeback. Which additional metrics were you able to add to you chargeback reports?