Developing New Resource Limits
This chapter contains the following sections:
About New Resource
You can introduce new
resource types to be subjected to limit checks. For example, if you add device
support for a new storage device, you might have limit checks for the number of
logical unit numbers (LUNs) used by a group. You might want to be more granular
and limit the number of gegabytes used per LUN by a group. Resource limits are
associated per group, so whatever resource type that you add to the system, you
must associate it with a group.
resource limit types involves two procedures:
new resource type to a group.
computer that calculates the usage of the new resource for a group.
Resource with a Group
The new resource
type that you want limited must be associated with a group. We recommend that
you develop a new user interface (UI) action that allows the user to associate
a group with the resource. To do so, you develop a report with a generic UI
action. Similar to what you did in the
Developing Reports Using POJO and Annotations,
but you must ensure that the form object includes a reference to the
UserGroupsLOVProvider.NAME LOV provider. This identifies the group with which
the user is associating the resource. You must also decide how to track the
usage of the resource.
For example of a
form that associates a resource with a group, see
com.cloupia.feature.foo.actions.AssignDummyVLANToGroupAction. The UI should
identify the fundamental function (Assign to Group), identify the resource by
its unique ID, and provide a means of selecting the group.
the resource with a group, you must develop a resource computer to compute the
resource limit for the group. The resource computer implements the
interface to pass the group details required for the resource limit
calculation. Using the association between resource and group, you can
determine which group is using which resources and can calculate the full
amount of resource being used by the group.
For more information
on how to use this interface, refer to the sample code:
Registering the New
You need to register
your resource computer in AbstractCloupiaModule. For more information, see
FooModule.java in the sample code. You must provide a string to uniquely
identify the resource type, a description of the resource type so it can be
displayed in the UI, and the corresponding resource computer to be used.
Before You Begin
resource to a group.
Testing Your New
Resource Limit Check
To verify that a
newly introduced resource type is being checked properly, perform the following
steps in the
Cisco UCS Director UI.
Verify that the
resource type that you introduced is listed as a resource that can be limited.
Set a resource
limit for your new resource.
Verify that your
resource computer is working properly by checking the Resource Limits report.
Administration > Users and Groups > User Groups > (Your
Group), then click
Resource Limits. In the
dialog box, select
Limits dialog box expands into a page that shows all resources that can be
limited. The resource type that you introduced should be visible under the
Physical Resource Limits heading.
The sample code
shows a Dummy VLAN resource. If you have implemented this resource, it should
be present in the listing.
|| In the Resource
Limits listing, set a limit for the resource type that you introduced, and
|| Check the
Limits report table. This is located under
Organizations > Summary > (Your Group) > Resource
Limits. After choosing the Group, click the
Resource Limits tab, look for a row of
information about your resource.
The limit that
you set is displayed. You can put the resource into usage (and take it to the
usage limit) and recheck this report to verify that it is working as expected.