vRealize Business Cost Calculation fails after changing the time zone from default UTC or GMT
search cancel

vRealize Business Cost Calculation fails after changing the time zone from default UTC or GMT

book

Article ID: 339427

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
When you change the time zone from the default UTC or GMT (UTC-0) in vRealize Business for Cloud, you experience these symptoms:
  • Incorrect virtual machine timing in reports.
  • Thousands of cost calculation attempts occur at a time.
Once changed the time-zone back to UTC, the Cost calculation might fail with below error in itfm-server.log:
ERROR [SystemSync-Persist Mappers] c.v.i.c.c.s.j.SystemSynchronizationManager - The end instant must be greater the start
java.lang.IllegalArgumentException: The end instant must be greater the start
 at org.joda.time.base.AbstractInterval.checkInterval(AbstractInterval.java:63) ~[joda-time-2.9.jar:2.9]
 at org.joda.time.base.BaseInterval.<init>(BaseInterval.java:94) ~[joda-time-2.9.jar:2.9]
 at org.joda.time.Interval.<init>(Interval.java:199) ~[joda-time-2.9.jar:2.9]
 at com.vmware.itfm.cloud.consumers.vmcategory.manager.VmPowerStateManager.getAllVmPowerStateSampleForInterval(VmPowerStateManager.java:108) ~[itfm-consumers-7.4.0.19475.jar:7.4.0.19475]
 at com.vmware.itfm.cloud.pricing.business.service.PricingCalculationService.getSlotUptimeMins(PricingCalculationService.java:537) ~[itfm-pricing-7.4.0.19475.jar:7.4.0.19475]


Environment

VMware vRealize Business for Cloud Standard 7.x

Cause

If the timezone is not set to UTC, this can lead to negative values for the uptime calculation in the MongoDB.

Resolution

​This is a known issue with vRealize Business for Cloud.

To resolve this issue:
  1. Set the time zone back to UTC.
  2. Clean up the Postgres DB.
To set the time zone back to UTC:
  1. Enter the command line interface of vRealize Business.
  2. Run these commands:
    1. monit stop all
    2. /opt/vmware/share/vami/vami_set_timezone_cmd UTC
    3. monit start all
To clean up the Postgres DB:

Note: Before cleaning up the Postgres DB, VMware recommends to take a backup of the Prostgres DB, or snapshot, or both. Run this script from the command linke of vRealize Business to take a backup of the Postgres DB: /usr/ITFM-Cloud/va-tools/bin/create_dump.sh.
  1. Enter the command line interface of vRealize Business.
  2. Run these commands:
    monit stop all
    monit start postgres
/usr/ITFM-Cloud/va-tools/bin/db-client.sh
select * from itfm_sync_job_run_status order by jr_id desc limit 10;


Note: This shows the top ten for itfm_sync_job_run_status. Make a note of the jr_id from the sixth entry down.

delete from itfm_sync_job_run_status where jr_id < Enter the jr_id of the sixth entry;
\q
monit start all

vRealize Business for Cloud now run cost calculations appropriately without attempting to do the total at once. If there is still an issue the following commands must be done to the MongoDB on the vRealize Business for Cloud Appliance:
  1. monit stop itbm-server
  2. mongo
  3. use fr_stable_system
  4. db.uptime.updateMany({value: {$lt:0}}, {$set:{value:0}})
  5. use fr_system
  6. db.uptime.updateMany({value: {$lt:0}}, {$set:{value:0}})
  7. Ctrl+c
  8. monit start itbm-server
Then re-attempt Cost Calculation.