8.3 VM Management

This page describes how to configure the VM Management page. See Node Management for user documentation of the node management page.

The VM management page consists of a table for displaying VMs, a set of controls above the table for operating on one or more rows selected in the table, and configurable panels for displaying individual VMs in detail. All of these components can be configured in nodes.xml. The format of the related XML is given below.

<nodes>
  ...
  <vm-management>
    <controls>
      ...
    </controls>
    <table>
      ...
    </table>
    <node-details>
      ...
    </node-details>
    <details>
      ...
    </details>
      ...
  </vm-management>
</nodes>

8.3.1 Configuring the Table

The VM management table can be configured at the column-level to show different attributes specifically for VMs. The relevant XML section for configuring the table is nodes > vm-management > table > fields. Each child element of <fields> corresponds to a single column and the columns appear in the same order that the child elements are specified. The name of each element corresponds to data tracked by Moab about VMs, and also contains sensible defaults for display options of the column. The currently allowed field types are:

All field types share a common configuration. The shared attributes are:

The shared child elements of field types are:

In addition to the above fields, the table section supports a special kind of column named "composite". The composite column allows one to display a value based on the basic fields listed above by using the value decider framework. Each of the above fields can be accessed with component tags. Unlike the other fields, the composite field requires that both width and title be specified. The contents of the value tag constitute the value decider portion that determines the form of the column values. The structure of the composite tag is described below:

<composite width="{width}">
  <title>{title}</title>
  <value>
    ... 
  </value>
</composite>

One example of a composite value is one that displays both the available disk space and the total configured disk space on vms in gigabytes. Disk values are reported directly as given by Moab. If Moab is reporting disk values in megabytes, one could configure the composite value as shown below. This would display a column values of the form <disk available in GB> / <disk total in GB>.

<composite width="75">
  <title>Disk (GB)</title>
  <value>
    <calculate operation="append-in-order">
      <value order="1">
        <calculate operation="double-to-string" format="#.#">
          <calculate binary-operation="multiply">
            <first>
              <component id="disk-available"/>
            </first>
            <second>.0001</second>
          </calculate>
        </calculate>
      </value>
      <value order="2"> / </value>
      <value order="3">
        <calculate operation="double-to-string" format="#.#">
          <calculate binary-operation="multiply">
            <first>
              <component id="disk-total"/>
            </first>
            <second>.0001</second>
          </calculate>
        </calculate>
      </value>
    </calculate>
  </value>
</composite>

An example vm table configuration is given below:

<table>      
  <fields>        
    <id primary="true" width="150" visible="false">          
      <title>Name</title>        
    </id>        
    <link-id width="150">          
      <title>Name</title>        
    </link-id>        
    <parent/>        
    <status/>        
    <power/>        
    <pending-actions width="100"/>        
    <os width="60">          
      <title>Oper. Sys.</title>        
    </os>        
    <load/>          
      <composite width="75">            
        <title>Disk (GB)</title>          
      <value>            
        <calculate operation="append-in-order">              
          <value order="1">                 
            <calculate operation="double-to-string" format="#.#">                   
              <calculate binary-operation="multiply">                     
                <first>                       
                  <component id="disk-available"/>                     
                </first>                     
                <second>.0001</second>                 
            </calculate>           
        </calculate>         
      </value>         
      <value order="2"> / </value>         
      <value order="3">           
        <calculate operation="double-to-string" format="#.#">             
          <calculate binary-operation="multiply">               
            <first>                 
              <component id="disk-total"/>               
            </first>               
            <second>.0001</second>             
          </calculate>           
        </calculate>         
      </value>       
    </calculate>      
   </value>    
  </composite>    
  <composite width="100">      
    <title>Memory (MB)</title>        
      <value>          
        <calculate operation="append-in-order">            
          <value order="1">              
            <component id="memory-available"/>            
          </value>            
          <value order="2"> / </value>            
          <value order="3">              
            <component id="memory-total"/>            
          </value>          
        </calculate>        
      </value>     
    </composite>     
    <composite width="50">       
      <title>Procs</title>       
      <value>        
        <calculate operation="append-in-order">           
          <value order="1">             
            <component id="processors-available"/>           
          </value>           
          <value order="2"> / </value>           
          <value order="3">             
            <component id="processors-total"/>           
          </value>         
        </calculate>       
      </value>     
    </composite>    
    <ip-address/>     
    </fields>    
</table>

8.3.1.1 Primary Keys

In order for many features of the VM Management page to work properly, you must configure at least one field to be a primary key field. We strongly recommend creating an id field as the sole primary key field. You can make this field invisible if you don't want users to see it.

8.3.1.2 Filtering the Table

The following are valid filters:

8.3.2 Table Buttons

The above-table buttons are configured in the <controls> child element of <vm-management>. Supported elements are listed below. Buttons disable themselves when their surrounding context is invalid such as if the button requires a selected record but no table record is selected, or if the type of the selected record doesn't apply to the button.

In addition to specifying an action type via the element's name, you can configure the display of the button using any of the following attributes.

You can also specify the permission access for each button with the <permissions> child element. This element can contain a sequence of <permission> elements that specify a Viewpoint permission a user needs in order to see and use the button. An example permissions configuration might be:

<power-off>
  <permissions>
    <permission name="node.update"/>
  </permissions>
</power-off>

In this example, a user can use the power-off button only if they have the node.update permission.

8.3.3 Details Panel

The VM management page contains a panel for displaying a VM in detail. These sections are configured in the nodes > vm-management > node-details element and the config > server-management > vm-details element respectively. These panels currently allow one to configure a title, a set of controls, and a list of sections to display information in. The title can contain field references that will be replaced with the value of the field of the current object being viewed. Allowable fields are those available for the node table. Most of these fields are specified by prefixing a field name with $ and optionally wrapping it in curly brackets. Examples include $id, ${name}, and $cpu. In addition, one can display a variable in the title using the map variable syntax, which suffixes the field name with a key enclosed in square brackets.

8.3.3.1 Buttons

Each details panel contains a buttons section that has the same structure as the above-table buttons. They actually support an arbitrary menu structure, but that structure is more likely to be used in the details panel. That is, in addition to the button elements described above, a submenu can be created with a menu element that itself contains child elements. Arbitrarily nested menus can thus be created. Besides containing child elements, a menu element can also specify a boolean attribute vertical, which defaults to "true", that specifies the menu's layout direction. Furthermore, a menu itself can have permissions just like a button. If a user doesn't have permissions to view a menu, then he or she will not see the menu or any of its sub-elements.

The scope of a details panel button is the panel itself. Because of this, buttons that require a record to be selected in the VM table, if they were placed above the table, treat the record displayed in the details panel as the selected record. Also, the refresh button refreshes only the details panel.

An example VM buttons configuration is:

...
<controls>
  <refresh/>
    <power-on/>
    <power-off/>
    <reprovision/>
</controls>

VM Details Buttons

The VM details panel supports the above-table buttons, as well as the following extra buttons:

8.3.3.2 Sections

Each details panel section specified in XML corresponds to a collapsible section in the details panel. A section itself consists of a title (with no variable interpolation) and a <fields> element that contains a list of fields. These fields have names that correspond directly to the table fields described previously in the fields section.

In addition, the following fields are supported for both panels:

Note Several fields actually display a collection or list of scalar values. By default, these values are printed as a label of comma-separated values. However, if the field is given the attribute multiline="true", the field is displayed as a multi-select box with each individual collection value displayed on its own line. The fields that currently have this feature are labeled as collection fields.

8.3.3.3 Example

You can expand the sample code window below for an example of what a complete VM details panel might look like:

<details>
  <title>Virtual Machine: $id</title>
  <controls>
    <start image-url="images/play.png"/>
    <stop image-url="images/stop.png"/>
    <reprovision image-url="images/reprovision.png"/>
    <migrate image-url="images/migrate.gif">
    </migrate>
    <destroy image-url="images/vm-destroy.png">
    </destroy>
    <show-pending-actions image-url="images/filter_vm.png"/>
  </controls>
  <sections>
    <section>
      <title>General</title>
      <fields>
        <id>
          <title>Name></title>
        </id>
        <ip-address>
          <title>Network Address</title>
        </ip-address>
        <job-id/>
      </fields>
    </section>
    <section>
      <title>Status</title>
      <fields>
        <substate>
          <title>State</title>
        </substate>
        <composite>
          <title>VM State</title>
          <value>
            <calculate operation="conditional">
              <option>
                <value>Started</value>
                <condition comparison="equal">
                  <first>
                    <component id="power"/>
                  </first>
                  <second>On</second>
                </condition>
              </option>
              <option>
                <value>Stopped</value>
                <condition>
                  <value>true</value>
                </condition>
              </option>
            </calculate>
          </value>
        </composite>
        <state>
          <title>Compute RM State</title>
        </state>
        <os/>
        <os-options multiline="true"/>
      </fields>
    </section>
    <section>
      <title>Utilization</title>
      <fields>
        <composite>
          <title>Processor</title>
          <value>
            <calculate operation="append-in-order">
              <value order="1">
                <component id="processors-available"/>
              </value>
              <value order="2"> Available, </value>
              <value order="3">
                <component id="processors-total"/>
              </value>
              <value> Total</value>
            </calculate>
          </value>
        </composite>
        <composite>
          <title>Memory (MB)</title>
          <value>
            <calculate operation="append-in-order">
              <value order="1">
                <component id="memory-available"/>
              </value>
              <value order="2"> Available, </value>
              <value order="3">
                <component id="memory-total"/>
              </value>
              <value> Total</value>
            </calculate>
          </value>
        </composite>
        <composite>
          <title>Disk (MB)</title>
          <value>
            <calculate operation="append-in-order">
              <value order="1">
                <component id="disk-available"/>
              </value>
              <value order="2"> Available, </value>
              <value order="3">
                <component id="disk-total"/>
              </value>
              <value> Total</value>
            </calculate>
          </value>
        </composite>
      </fields>
    </section>
  </sections>
</vm-details>

8.3.3.4 Linking

The VM Management Page can contain links to the Node Management Page. By including the <parent> tag in the vm-management > table > fields > parent location a link to each VMs parent makes it possible to navigate to the Node Management Page with the specified node.