- Channel HP
- :
- Enterprise Business Blogs
- :
- Servers
- :
- Eye on Blades Blog: Trends in Infrastructure
- Mark all as New
- Mark all as Read
- Float this item to the top
- Bookmark
- Subscribe to RSS Feed
- Invite a Friend
Customizing BladeSystem Matrix Allocation Rules Engine for Multi-tenancy Solutions
Early this week I was in a couple of halo meeting sessions with folks in our Bangalore India location, taking about "the next big thing". It reminded me that the last thing we worked on - exposing an extensible rules engine into the allocation and placement - was part of the BladeSystem Matrix 6.0 release. I wanted to talk a little about that capability today and give an example of how it can be used in deployments involving multi-tenancy.
BladeSystem Matrix Allocation and Placement Rules
Allocation and placement has always been a key function of BladeSystem Matrix. When multi-tier service designs (represented my templates) are submitted for instantiation, it is the allocation and placement function that looks at the requirements for the service in terms of individual element specifications, desired service topology and lease period and them binds these to the available resources in the environment based on their characteristics and capacity, availability calendar, and physical topology. In BladeSystem Matrtix 6.0, this allocation process can be customized by an extensible rules engine. Overall there are 18 different allocation rule sets that can be extended as shown in figure 1. The policy.xml file specifies which of the rule sets should be used. These are further explained the in the Insight Orchestration User Guide on page 48.
| |
Mutl-tenancy Example
A very common use case I hear from customers is the desire to have a common design for a service but to have some aspects of the resource binding to be determined by the identity of the service owner. In this scenario, we consider a provider who is servicing two competitors like Marriott and Hilton hotels but wants to put offer a common service template in the catalog. The desire is that when Marriott deploy a new instance of the service, that service instance would connect to Marriott-Corporate network segment. However, if Hilton deploy the service, then their service instance would connect to the Hilton Corporate network segment. | Figure 2. Pre-configured networks for the two competing corporations |
Setting up your Service Template
Here we show a portion of a simple single server template as an illustrative example. This is a multi-homed server with
| Figure 3 Sample Multi-tenancy configuration |
Adding the processing Rule
The rules engine is based on Drools. The rules are written expressed in Java with a Drools rule semantic wrapper. I'll give you a boiler plate wrapper to get you started below. This rule and the Java function are appended to the SubnetCheck.drl file. I'm going to show a very simple example, but can imagine that the creative community will quickly come up with some more sophisticated implementations. In figure 4, I show a simple rule. The rules processing is invoked to refine the candidate networks for allocation to the new service instance. The rule runs for each network (LogicalNetwork) specified in the template, and for each candidate network in the environment. The purpose of the rule processing is to discard candidates that "don't fit".
This snippet basically extracts the information about the subnet specification in the template (the $logicalSubnet), the candidate list of networks ($subnet) from the context ($pVO). It invokes a function customerSpecificSubnetCriteriaCheck to perform the actual processing.
rule "CustomerSpecificSubnetCriteria"
when
$pVO : PolicyExecutionVO( );
$resLst : List();
$logicalSubnet : LogicalSubnet();
$subnet : Subnet() from $resLst;
eval(customerSpecificSubnetCriteriaCheck($logicalSubnet, $subnet, $pVO));
then
// match processing is embedded in customerSpecificSubnetCriteriaCheck
// $pVO.match($subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM, "CustomerSpecificSubnetCriteriaCheck succeeded"));
end
Figure 4. Boiler plate rule example
The function code is placed in the drl file after the rule statement. Here is the snippet
function boolean customerSpecificSubnetCriteriaCheck(
LogicalSubnet logicalSubnet,
Subnet subnet,
PolicyExecutionVO pVO) {
AllocationEntry ae = pVO.getAllocationEntry();
InfrastructureService service = ae.getInfrastructureService();
String serviceName = service.getName();
String owner = service.getOwner().substring(owner.lastIndexOf("\\")+1); // strip domain
String lsName = logicalSubnet.getName();
String psName = subnet.getName();
System.out.println("Service: " + serviceName + " Owner: " + owner);
System.out.println("LogicalSubnet: " + lsName + "Physical Net: " + psName);
boolean match;
if (lsName.beginsWith("@")) {
String key = lsName.substring(1); // strip off @
// March @key to networks with Id "owner-key"
match = psName.equalsIgnoreCase(owner+"-"+key);
} else {
// regular network. Could include additional security checks here.
match = true;
}
if (match) {
pVO.match(subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM,
"CustomerSpecificSubnetCriteriaCheck succeeded"));
} else {
pVO.doesNotMatch(subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM,
"Could not find customer specific subnet"));
}
System.out.println("MATCH="+match);
return match;
}
Figure 5. Rule processing example
The function starts by getting the information on the InfrastructureService being provisioned. This contains details of the entire template being provisioned and can be used for additional context aware processing. From this object we extract the service owner name (stripping off the windows domain), as well as the name of the service. It is also possible to extract information such as the "notes" that are specified for the service where additional information may also be encoded by the requestor. From the LogicalNetwork object we extract the name (ie "@Corporate" or "net1") in lsName. Similarly we extract the physical network name into psName.
I've included some debug lines using System.out.println . These show up in C:\Program Files\HP\Insight Orchestration\logs\hpio.log.
The purpose of this code is to return "FALSE" if the physical network is not a match candidate for the LogicalNetwork specified in the template, otherwise return "TRUE". The rules processing logic requires that if the rule allows an element to be a selection candidate, then the function pVO.match must be invoked for that element. If the element is to be eliminated from consideration, then pVO.doesNotMatch() needs to be invoked listing a reason for the exclusion. As a matter of coding style, you can either include the calls to both these routines in your custom function, OR you can just include the pVO.doesNotMatch() code in the function, and put the pVO.match() innocation in the body of the rule.
For logical networks not beginning with a "@" we just want to return TRUE and let the normal selection rules apply. For networks beginning with "@" we will be more selective, excluding candidates unless they match a specific pattern. For a logical network specified in the template with name of the form "@key" we want it to match against physical networks named "owner-key", where owner is the id of the requesting user. The logic looks for a lsName beginning with "@" and then strips off the "@" to create the key. We then test the physical server name to see if it matches the owner-key pattern.
Configuring the Code
To configure the use of the rules processing, edit C:\Program Files\HP\Insight Orchestration\conf\policy\policy.xml As shown in Figure 6. Once you have updated the policy.xml file you will need to restart the Insight Orchestration service.
<policy enabled="true" name="SubnetPolicyCheck.applyFitting">
<policy-rule-file>SubnetCheck.drl</policy-rule-file>
<policy-class-name>policy-class-name</policy-class-name>
</policy>
Figure 6. Configuring rules processing
Provisioning the Service
Now we are ready to deploy the service. Logging on as user Marriott, I create the service using the template shown earlier in Figure 2. Once the provisioning completes, I can look at the service details page for more information about the service. Select the network named "@Corporate" and then click on the resource details tab. From there I see that the network has indeed been mapped to the Marriott-Corporate network by the customer allocation rules processing. | Figure 3 Provisioned Service details |
Conclusion
The rules based processing capabilities in BladeSystem Matrix enables simple realization of customized resource allocation processing that can be used to simplify and extend Matrix template deployment. I hope this example helps others to quickly understand the capabilities enabled through this powerful engine and gives a "Quick Start" to writing your own custom rules. If you have cool examples of rule extensions you have implemented, I'd be interested in hearing about them.
Thanks to Manjunatha Chinnaswamynaika for helping me to create this example.
Happy coding ![]()
What's new for blades in plain language
Today, we launched some new and updated technologies that I thought you might find useful. Here's the news in language as plain as it gets in IT.
Our Virtual Connect interconnect porfolio was updated in two ways.
- First, the Fibre Channel module was updated to 8Gb performance. That means you get more connections at higher speeds. The server side NPIV feature also increased support for up to 255 WWNs (world wide names) so you can support more VM's per module. This also means lower network costs per virtual machine. We also published a new Virtual Connect Fibre Channel cookbook that most folks find very useful. Get all the technical tips, tricks and best practices to help you set it up right and get the most out of Virtual Connect.
- Second, the the Virtual Connect Flex-10 module now supports multi-enclosure stacking which means you can connect up to 4 enclosures into one group and cut down the number of Ethernet cables to as few as two per rack. The number of total domains that can be managed together was also increased to 200 (or 800 with stacking). This makes it easier to manage more connections across a big environment in a single view.
The other news today was the update of our 4 processor, ProLiant BL685c blade server. Basically, the new G6 version dobules the supported memory per blade versus the older, G5 version. That's 32 DIMM sockets and 256Gb of memory per blade. We made this move to remove a key bottleneck -- memory performance, to btake advantage of the new quad-core AMD processors and to support more VM's or big applications per blade.
If you have more questions, leave them below and our experts will fill you in on all the technical details. In the future, visit this site to keep up to date with other blade news.
-
cookbook
-
Flex-10
-
new product
-
virtual connect
-
what's new









