Microsystems Technology Laboratories > OpenCoral

Supporting More Than One Lab in a Set of Coral Servers

Overview of Multiple Lab Support in Coral

As of Coral tag release coral-3_4_7, we have added support for more than one lab in a single running instance in Coral. Supported features include:

  • Each lab will show up as a separate tab with their individual equipment hierarchy on the left side of the equipment client.
  • Members may be assigned lab-wide roles in each lab. This means that a member may be a normal user in one lab but may have an elevated role such as staff in another lab.
  • Each lab may have customized XACML policies.
  • Each lab may have customized XCRML cost policies.

Steps to Add a New Lab in Coral

There are several things that need to be done to add a new lab in a running Coral instance. The first thing that you need to run is 'ant addLab'. This will prompt you for the name of the new lab and will add the lab-wide roles of 'coral', 'staff', 'admin', and 'inventory' to the ${bootstrapUser" for that new lab. This will allow the ${bootstrapUser} to actually add that new lab.

Next you need to start coral-admin and select the "Add New Lab" menu item from the File menu. This will prompt you for both the unique identifier (usually an abbreviation) that will and the display name (the long or full name) that will appear at the head of each equipment tree.

At this point (before you can actually add equipment to this new lab) you have to quit coral-admin (saving your equipment tree with the added lab). Next you have to run 'ant deployAll'. This will see your updated /path-to-opencoral-src/opencoral/src/xml/equipment/Area.${site}.xml file, realize that you've added a new lab, and add a default set of policies for that new lab. A default set of policies will allow you to add equipment to that new lab. After your run 'ant deployAll' you need to restart your servers with '/usr/local/sbin/opencoral start' to make those new policies active. As long as you have properly run 'ant addLab' previously and have been given the proper roles in this new lab, you should be allowed to add equipment in that new lab when you run 'coral-admin' again.

XACML Policy Files for More than One Lab

As long as you use default policies, you do not need to explicitly worry about XACML plicies for a new lab. Any policies that you need (StaffPolicy, ResourcePolicy, ReservationPolicy, EquipmentPolicy, etc) will be created for you "on the fly" when you do an 'ant deployAll' based on the set of labs that are currently defined in /path-to-opencoral-src/opencoral/src/xml/equiment/Area.${site}.xml (or Area.${site}-${instance}.xml, if you are using an ${instance} defined to be something other than "prod".). If, however, you wish to create a customized policy for a lab ... and that can be either for your default lab or for a newly added lab ... you can issue the command: 'ant createCustomPolicy'. It will prompt you for a lab and then a list of possible policies (EquipmentPolicy, ReservationPolicy, etc.). Let us assume that we wish to create a custom ReservationPolicy for lab ABC. In that case, the file named /path-to-opencoral-src/opencoral/src/xml/policy/ReservationPolicy.${site}.xml will have a default ABCReservationPolicySet added to it. That is, the body section of ReservationPolicy.xml (the entire section that is labeled with a PolicySetId of "@LAB@ReservationPolicySet") will be copied and appended to the file named /path-to-opencoral-src/opencoral/src/xml/policy/ReservationPolicy.${site}.xml and will be named with a PolicySetId of "ABCReservationPolicySet". While that file has not yet been customized ... that is left to you ... you will have an appropriate starting policy to begin to modify.

XCRML CostPolicy Files for More than one Lab

In many respects, handling of CostPolicy files for more than one lab is in many ways similar to the handling of XACML policy files. There are a couple of caveats that are listed here:

  • To be consistent with the philosophy that each lab, in principle, can run a separate and distinct Cost Policy Schema. Which it is true that to date there is only one Cost Policy Schema, you will need to make sure that any new lab that you have has a Cost Policy Schema loaded for it. Assuming that the cost_schema_bdate, cost_schema_edate, and cost_schema_active flags are appropriate (in general, the defaults should work for most people), you will need to load a cost_policy_schema for your new lab by running the command 'ant -Dcost_schema_lab=NewLab loadCostSchema'.
  • Given the much greater variation in Cost Policy from lab to lab, it is less likely that the default cost policy will work for your new lab. In this case, in a fashion similar to that for XACML policy files, you may need to issue the command 'ant createCustomCostPolicy'. This will prompt you for a lab and, if you enter a valid lab, will append a default cost policy with the PolicySetID of "ABCCostPolicy" (assuming, of course that you entered "ABC" when prompted for the lab. At this point you will need to customize that policy to meet your needs ... and to set applicable rates for that new policy using the coral-admin client.
  • Once you are happy with your new cost policy, you will need to load it by running 'and loadCostPolicy' with applicable command-line definitions of cost_policy_lab, cost_policy_bdate, cost_policy_edate, and cost_policy_active.
  • In order to get a cost recovery to run periodically for a new lab using the Quartz job mechanism, you will need to customize a quartz-Cost Manager.xml file by creating a copy of quartz-Cost Manager.xml as quartz-Cost Manager.${site}.xml and creating a new job and trigger defintion that will run Cost Recovery for that new lab. An example of how this is done may be found in /path-to-opencoral-src/opencoral/src/xml/quartz/quartz-Cost Manager.stanford.xml.
At present, for your default lab, the cost policy file will likely have an edate very far in the future (2999-01-01) and has it's active flag set to 1 to indicate that it is the currently active cost recovery policy for the default lab. If you load a new cost policy for a lab other than your default lab, it should also likely be entered with an edate very far in the future of 2999-01-01 but it should be loaded with it's active flag set to 0 (that is, false). While it is the currently active policy for this new lab, it is not the currently active policy for the default lab. As we gain more experience with sites running Coral with more than one lab in a single instance, this convention may change.