Moab Viewpoint
Configuring the <modify> Element

Configuring the <modify> Element

This document explains how to configure the <modify> element in vpcs.xml. Within the Manage environment page, a user has the option to modify a VPC. The <modify> element contains all information necessary to modify a VPC and the reservations that exist on them. This element also establishes the rules for modifying configurable attributes of a VPC.

To manage users in vpcs.xml, see Managing VPC Users.

Action Models

In Viewpoint, there are various actions that modify VPCs and reservations. By default, Viewpoint computes how to perform an action, such as adding resources to a reservation or adding users to a VPCs ACL. However, there are some actions that can be configured to perform other types of operations instead of or in addition to the default actions. For example, you can specify that you do not want Viewpoint to add reservations to a VPC, but should instead fire a trigger that takes care of the action. Or, you might configure Viewpoint to fire a trigger every time Viewpoint joins two resource reservations together.

The following actions can be configured using an action model:

  • Add Reservation to VPC.
  • Decrement a reservation's resources.
  • Migrate a reservations. This might occur when adding resources to a reservation.
  • Join two reservations. This might occur when adding resources to a reservation.
  • Delete a VPC. This defines what happens when the user selects "Delete" when a VPC is selected.

All action models have the 'perform-action' attribute where administrators can turn the default action on or off. For example, if the the 'perform-action' attribute in the add reservation action model is set to true, Viewpoint runs the 'mschedctl -m vpc:vpcId -a resources=tid' command to add a reservation to the VPC. If the attribute is set to false, Viewpoint does not perform this action.

Action models can have additional commands that can be run by using the <command> element. There can be 0 or more <command> element children for each action model. See XML Syntax for Moab Commands for details on setting up these administrator-specified commands.

Here's an example of an Add Reservation action where Viewpoint performs the Moab action to add the reservation, and then fires a trigger.

<action perform-action="true">
 <command>
  <value>
   <calculate operation="append-in-order">
    <value order="1">mschedctl -c trigger  name="add_new_reservation",etype=START,atype=EXEC,action="/opt/moab/tools/modify.vpc.pl --vpc_id=\\$VPCID --oid=\\$OID --cart_item_id=</value>
    <value order="2">
     <component id="cart-item-id" />
    </value>
    <value order="3">" -o rsv:</value>
    <value order="4">
     <component id="rsv-group" />
    </value>
   </calculate>
  </value>
 </command>
</action>

Add Reservation

The Add Reservation action runs the 'mschedctl -m vpc:vpcId -a resources=tid' command if 'perform-action' is set to true.

The following keywords are available for the Add Reservation <action> element value deciders:

  • "cart-item-id" - The id of the cart-item that contains the Add Reservation action. This is only useful if billing is enabled; otherwise, the value is empty or '0'.
  • "rsv-group" - The name of the reservation group of the original VPC.
  • "rsv_id" - The name of the placeholder reservation group that stores the resources until they are added to the VPC.
  • "vpc_id" - The id of the VPC where the new reservation(s) are added.
  • "account" - The account used to pay for the original VPC. If billing is not enabled, this might not be set.
  • "source_type" - The type of Add Reservation action that is taking place. This could be one of the following values:
    • "archive" - New reservation created from archive.
    • "new" - New reservation is a user-specified resource request.
    • "clone" - New reservation should be cloned from another reservation.
  • "source_id" - The id of the source for this reservation. This is only set if the source_type is archive or clone, in which case it is either the id of the archive or the original reservation, respectively.

Decrement Reservation's Resources

The Decrement Reservation Resources action is specified using the <decrement-resources> element. The specific Moab commands necessary to decrement a reservation's resources is dependent on the disk model set up in the configuration.

The following keywords are available for the <decrement-resources> element value deciders:

  • "rsv-id" - The name of the reservation whose resources are being decremented.

Migrate Reservations

The migrate reservation action is specified using the <migrate-rsv> element. The specific Moab commands necessary to migrate a reservation's resources is dependent on the disk model set up in the configuration.

The following keywords are available for the <migrate-rsv> element value deciders:

  • "target_rsv" - The name of the original reservation whose resources are being incremented.
  • "rsv_id" - The name of the new placeholder reservation that contains the additional resources.
  • "cart-item-id" - The id of the shopping cart item that contains the Add Resources To Reservation action. This is only useful if billing is enabled; otherwise, the value is empty or '0'.
  • "proxy_user" - The user that is adding the resources to the reservation.
  • "account" - The account used to pay for the original VPC. If billing is not enabled, this might not be set.

Join Reservations

The Join Reservation action is specified using the <join-rsv> element. The specific Moab commands necessary to join a reservation's resources is dependent on the disk model set up in the configuration.

The following keywords are available for the <join-rsv> element value deciders:

  • "target_rsv" - The name of the original reservation whose resources are being incremented.
  • "rsv_id" - The name of the new placeholder reservation that contains the additional resources.
  • "cart-item-id" - The id of the shopping cart item that contains the Add Resources To Reservation action. This is only useful if billing is enabled; otherwise, the value is empty or '0'.
  • "proxy_user" - The user that is adding the resources to the reservation
  • "account" - The account used to pay for the original VPC. If billing is not enabled, this might not be set.

Delete VPC

The Delete VPC action is specified using the <delete-vpc> element. This optional element defines the action model like the others explained above. If a value is not specified for this element, Viewpoint will take the default action of deleting the VPC using "mschedctl -d vpc:{vpc.id}".

The only keyword available for the <delete-vpc> element is "$VPC". Any occurrences of this keyword will be replaced with the ID of the VPC that is being deleted.

The following is an example of how the <delete-vpc> element is configured:

<delete-vpc perform-action="true">
 <command>
  <value>
   <calculate operation="append-in-order">
    <value order="1">echo "This is the Delete VPC" >> /opt/temp.txt</value>
   </calculate>
  </value>
 </command>
</delete-vpc>