Top
ServerView Resource Orchestrator Cloud Edition V3.0.0 Operation Guide

12.5.1 Example Accounting Calculation

An example of accounting calculation is shown below.

[Conditions]

  1. Use the product master maintenance command to output the accounting information file.

    [Windows]

    productmaintain.bat export c:\chargeinfofile 

    [Linux]

    productmaintain.sh export /tmp/chargeinfofile

    An example of the output accounting information log is shown below.

  2. Use the output metering logs command to output the periodic log of the start date of the accounting calculation and event log for the period of calculation.

    [Windows]

      ctchg_getmeterlog.bat -start 2012-04-01 -end 2012-04-01 -period -outputfile periodfile
          (Output the periodic log of April 1, 2012)
      ctchg_getmeterlog.bat -start 2012-04-01 -end 2012-04-30 -event -outputfile eventfile
          (Output the event log of April, 2012)

    [Linux]

      ctchg_getmeterlog.sh -start 2012-04-01 -end 2012-04-01 -period -outputfile periodfile
          (Output the periodic log of April 1, 2012)
      ctchg_getmeterlog.sh -start 2012-04-01 -end 2012-04-30 -event -outputfile eventfile
          (Output the event log of April, 2012)

    An example of the output metering log is shown below.
    No.1 to 3 is the periodic log, and the No.4 to 14 is the event log.

  3. Sort the metering log in the order of virtual system (vsys_id) and the event occurrence time (event_time).
    Perform the accounting calculation for the row where the virtual system id = VSYS01. (The target metering logs are No.1 to 4.)

  4. Extract the contents of the periodic log as the accounting target products for each virtual system.
    Extract the periodic log of No.1 to 3. Do not include the software (the log where resource_type=software) and the system disk (the value of disk_size in the log where resource_type=vserver) in the accounting calculation target.

    (Extraction time: April 1 0:00:00)

  5. Check the metering log in the order of time for each virtual system to calculate the accounting for the accounting target products for the duration between the event log of the event No.4 and 3.

    (Extraction time: April 1 9:00:00)

    Calculate only the monthly charge for the duration between the event No.3 and 4 because the virtual server was stopped.
    Perform the following calculation for each accounting target product, and sum up the amount.
    Unit price of the product * Unit amount (1 because it is monthly) * Quantity

  6. Modify the status of the accounting target product according to the event No.4.
    Mark the monthly charges with "Complete", and modify the status to running (RUNNING) because the event No.4 is START.

  7. Repeat the operation of step 5 and 6 until the end date of the accounting calculation. Calculate as follows because there are no events until the end date of the accounting calculation.

    Calculate the hourly charges for the duration between the event No.4 and the end date of the accounting calculation (711 hours from 9:00:00 April 1 to 23:59:59 April 30) because the virtual server was running (RUNNING) for that duration. Perform the following calculate for each accounting target product, and sum up the amount.
    Unit price of the product * Unit amount (711 because it is hourly) * Quantity

  8. The amount for VSYS01 is as follows.
    $3.00 + $22.04 = $25.04

  9. Calculate the accounting for virtual system (VSYS02). (The target metering log is from the event No.5 to 14).
    Extract the accounting target products from the event No.5 to 8 because no periodic log exists for VSYS02.
    Do not include the software (the log where resource_type=software) and system disk (the value of disk_size in the log where resource_type=vserver) in the target.

    (Extraction time: April 30 13:00:00)

  10. Check the metering log in the order of time to calculate the accounting for the accounting target products for the duration between the event No.9 and 8.

    (Extraction time: April 30 13:10:00)

    Calculate only the monthly charges for the duration between the event No.8 and 9 because the virtual server was stopped.
    Perform the following calculation for all of the accounting target products, and sum up the amount.
    Unit price of the product * Unit amount (1 because it is monthly) * Quantity

  11. Modify the status of the accounting target product according to the event No.9.
    Mark the monthly charges with "Complete", and modify the status to running (RUNNING) because the event No.9 is START.

  12. Calculate the accounting for the accounting target products for the duration between the event No.10 and 9.

    (Extraction time: April 30 18:00:00)

    Calculate the hourly charges for the duration between the event No.9 and 10 (5 hours from 13:10:00 April 30 to 18:00:00 April 30) because the virtual server was running (RUNNING) for that duration.
    Perform the following calculation for all of the accounting target products, and sum up the amount.
    Unit price of the product * Unit amount (5 because it is hourly) * Quantity

  13. Modify the status of the accounting target product according to the event No.10.
    Modify the status to be stopped (STOPPED) because the event No.10 is STOP.

  14. Calculate the accounting for the accounting target products for the duration between the event No.11 and 10. This time, there is nothing to be charged.

    (Extraction time: April 30 19:00:00)

  15. Modify the status of the accounting target product according to the event No.11.
    Delete the accounting target product because the event No.11 is DELETE. The total amount for VSYS02 is as follows because there are no events until the end date of the accounting calculation.

    $8.00 + $0.18 = $8.18

  16. Sum up the amount of VSYS01 and VSYS02 for each tenant, and issue the billing statements.