12.7 Charging for Usage

A usage charge debits the appropriate allocations based on the attributes of the usage. The charge is calculated based on factors including the resources and services used, the usage time, and other quality-based factors (see Managing Charge Rates). By default, any reservations associated with the charge will be removed. The incremental option may be specified if you want associated reservations to be reduced instead of removed. If a usage record already exists for the instance being charged it will be updated with the data properties passed in with the charge request, otherwise a new usage record will be created.

A quote id can be specified to use a previously quoted set of charge rates. This will also ensure the charge will update the usage record instantiated with the quote. A reservation id can be specified to help match up a charge with its reservation (this may assist in deleting the correct reservation if instance ids are not unique). This will also ensure the charge will update the usage record that may have been instantiated by the reservation.

Although, by default, Moab Accounting Manager will calculate the charge for the usage using its default charge rates or using the charge rates saved by a referenced quote or quote template, it is possible to specify override charge rates via the rate option. Alternatively, it is possible to designate an externally calculated charge by specifying the charge amount with the Charge option (-z option to gcharge) and to pass the itemized charges detail for the charge transaction by specifying the ItemizedCharges option (--itemizedCharges option to gcharge).

To charge for a job use the command gcharge:

gcharge [-T usage_record_type] [-u user_name] [-g group_name] [-p project_name] [-o organization] [-c class_name] [-Q quality_of_service] [-m machine_name] [-N nodes] [-P processors] [-M memory] [-D disk] [-n network] [-S usage_state] [-X, --extension property name=property_value[,property_name=property_value...]] [-t charge_duration] [-s charge_start_time] [-e charge_end_time] [-d charge_description] [-z charge_amount] [--itemizedCharges itemized_charges] [--incremental] [-R charge_rate_type:charge_rate_name[{charge_rate_instance}]=charge_rate_amount[,charge_rate_type:charge_rate_name[{charge_rate_instance}]=charge_rate_amount...]] [-h, --hours] [--debug] [-?, --help] [--man] [--quiet] [-v, --verbose] [-V, --version] [[-j] usage_record_id] [-q quote_id] [-r reservation_id] {-J instance_name|job_id}

Note Additional detail for this command can be found in the man page by issuing gcharge --man at the command line.
Example 8. Issuing a usage charge
$ gcharge -J PBS.1234.0 -p chemistry -u amy -m colony -P 2 -t 1234
Successfully charged 2468 credits for instance PBS.1234.0
1 reservation was removed

(Undefined variable: MyVariables.!CopyrightInfo!)