5.1.3.3 Configuring the VPC Element

The <vpc> element provides setup for creating VPCs. Assuming billing is enabled, a shopping cart item reserves requested resources until the VPC can be created. A VPC is created when funds for an associated project clear. To facilitate various administrative functions, shopping cart metadata can be specified via the <variable> element in the <cart-item> parent. Each variable must have both of the following:

  1. <key> (Required) - The name of the variable (accepts any string decider).
  2. <value> (Required) - The value of the variable (accepts any string decider).

The data in <cart-item> is not sent to Moab, but instead is saved to the database when a shopping cart item is created. If billing is disabled, this has no effect since no item is created.

5.1.3.3.1 Creating a VPC

The <create> element corresponds to the process of submitting a Moab mschedctl -c command. The mschedctl -c command is how Moab creates VPCs.

The following are supported attributes during the VPC creation command:

The optional <cart-action> element can be used to update the database. This is only useful if billing is enabled (which creates a shopping cart item). For example, if VPC creation is successful, the database can be updated with a message such as "A new VLAN was created." If unsuccessful, a message such as "Unable to create the VLAN" can be presented to the user. The <cart-action> element requires a <message> element that accepts any string decider.

The following is an example of a <cart-action>:

<cart-action type="update">
 <message>A VPC was created!</message>
</cart-action>
5.1.3.3.2 Configuring Reservation Names

When a reservation is created in Moab, Moab automatically assigns a name to the reservation using its own internal business rules. The name Moab assigns to the VPC is not necessarily what Viewpoint has to use. Moab allows reservations to have a user-specified label. Viewpoint can automatically assign labels to new reservations and then use these labels as a display name for the various UI pages.

The <rsv-label> element, which is a child of the <create> element, does the following:

Setting up the label names may provide greater context to the user as you can include such things in the label as the associated project and account. Use the <calculate> element to configure the way to label the name. The following are keywords that can be specified in the string decider:

The following is an example of a label that includes the project name (a variable on the parent VPC), the account name, and the Moab-generated reservation name.

<rsv-label use-label-name="true">
 <calculate operation="append-in-order">
  <value order="1">
   <component id="PROJECT_NAME" />
  </value>
  <value order="2">_</value>
  <value order="3">
   <component id="account" />
  </value>
  <value order="4">_</value>
  <value order="5">
   <component id="rsv-id" />
  </value>
 </calculate>
</rsv-label>

5.1.3.3.3 Configuring VPC Names

Configuring VPC names works similar to Configuring Reservation Names with a few exceptions:

The following example implements the vpc label vpc_{user}:

<vpc-label use-label-name="true">
    <calculate operation="append-in-order">
        <value>vpc_</value>
        <value>
                <component id="owner" />
        </value>
    </calculate>
</vpc-label>