Conventions

6.6 NAMI Queuing

Using the QueueNAMIActions parameter, the NAMI (Native Allocation Manager Interface) charge and destroy actions will be queued. Other actions are still fired by themselves.

All queues on an allocation manager will be flushed each flush interval.

6.6-A NAMI for Jobs

There are five main events for billing jobs with NAMI. These are shown below in the job timeline:

 Job:  -------Quote--|--Submit------Start----------------------------------End----
                     |
 Nami:   -----Quote -|--Create-----Reserve--------Charge---Charge---------Delete--
 Input:        XML   |   XML         XML           XML      XML            XML
 Output:     #[:TID] |  [TID]

All scripts will have return codes checked. For charge and delete, the return code will only cause Moab to log the failure (this is also because of the queuing).

Quoting is not done by Moab, but called by Viewpoint. If they get a TID, it should be attached as a variable on the job. If a TID is returned by the create call, it will be attached as a variable.

Each script will be passed an XML description of the object (the same scripts are used for both jobs and reservations). This XML is not the same as checkpoint or checkjob XML, it is special XML specifically for charging. It is simpler than the checkjob XML.

Also note that a final charge will always be called before the delete script.

Return Values

You must configure the NAMITransVarName parameter to save the TID. The TID will be saved under a variable with that name. The TID may not contain equal sign (=) or colon (:) characters.

Billing Failure

If any call fails, Moab will log the failed action. Also, there will be two parameters on the allocation manager, BillingCreateFailure and BillingReserveFailure, that specify the action that will be taken when an action fails. Options will be IGNORE, HOLD, and CANCEL, with IGNORE being the default. Functionality may differ between jobs and reservations. For the StartFailureAction, you can also use RETRY, which will remove the job's reservation and will put it back into the queue to be scheduled the next iteration.

The RunAlways internal flag will cause jobs to ignore billing failures.

Job Approval

One of the great things about this billing system is that we get job approval very easily. The administrator puts BillingCreateFailure to HOLD. Next, they make the create script trigger their approval system (send an email, etc.) and return FAILURE. This will make the job always be put on hold. Then the administrator takes off the hold to approve the job (or reservation).