HMC Resource Management - Part #4 - HMC Resource Management and Exchange

 

Now, let's talk about the most confusing portion in the HMC Resource Management, which is the Exchange resource management. The reason why this Exchange resource management seems highly complicated is because there are a few layers or levels of relationship that linking everything together. I, myself do not claim to fully comprehend the whole database schema and all the relationship but I believe I have worked on it enough to understand most of the essential relationships and I will try to explain them in this blog in the simplest form possible.

 

In my opinion, once you understand the high level concept, everything will begin to fit into the picture and HMC Resource Management for SharePoint and OCS will be a walk in the park.

 

The reason for doing resource management is because we have finite resource. So, to understand the resource management in HMC for Exchange, we must first understand the business problem that we are trying to resolve and what resource in Exchange that is finite that we need to manage.

 

Yes, it is disk space. It all comes down to disk space, really. Every system has a finite amount of disk space. We can put a lot of disk space to be used by Exchange but there is still a limit at the end. While disk space may be cheaper compared to 5 years ago, it isn't free. With multiple companies hosted in the same hosting environment, and many companies hosted on the same Exchange server, sharing the same disk space, and with each company may grow or reduce their mailbox users, it is essential for us to have the ability to properly manage the disk space so that the disk do not get filled up and that we are getting good return on investment.  

 

Exchange Resource Management

 

Tracking the Exchange Resource

 

With the objective set to have a mechanism to properly manage the resource, we can start looking at this from ground up. To start with, we need to know how much disk space does an Exchange server has. We know each Exchange server many have multiple mailbox stores. Therefore, the first thing we need to do is to make sure HMC knows the following,

 

  • How many Mailbox stores are there on that server
  • How much disk space is available for each of the mailbox store.

 

To do that, we perform the procedure, Exchange 2007 Resource Manager::AddExchangeResources each time we add a new mailbox store, specifying the server name, the mailbox store as well as the space available on that box.

 

When you do that, there are a couple of entries being created in the ResourceManagement database. We created an entry in the rmcore_ResourceInstance table. The instance_location and instance_description will give you the server name and the mailbox database name. Do take note that we do not store the storage group name. At the same time, it also records down the capacity of the mailbox store in another table (blockmodel_ResourceCapacity).

 

Note: The above is a high level explanation and does not explain all the tables involved in the database.

 

Now that we know the storage of each server, the next question is how we are going to track which organization and users are using it. This can become slightly complicated to explain.

 

Tracking Organization Usage

 

Because we have finite resource, we need to be able to plan and manage our resource. That's why when we subscribe an organization to an Exchange Organization plan, we usually need to specify the amount of space this organization will use unless it is Dynamic Quota which I will explain more later.  I will discuss briefly about the Dynamic Quota, Fixed Quota and mailbox allocation algorithm later but for ease of explanation, I will primarily use Fixed Quota over here. Obviously, this Exchange resource management in HMC is such a big topic that I know I can't cover everything in a few blog entries.

 

So, how does it all work? When we subscribe an organization to an Exchange organization plan, what HMC will do from the resource management standpoint is to allocate some of the spaces from the Exchange Resource we added earlier. So, basically, it is something like the following,

 

  • Server 1
  • Mailbox Store 1 (200 GB)
  • Organization 1 (10 GB)
  • Organization 2 (10 GB)
  • Mailbox Store 2 (200 GB)

 

The above we have Server1 having 2 mailbox store with each having a size of 200GB and we have an Organization Plan to allocate 10 GB per organization for Mailbox Store 1. Now, we can also distribute them to different mailbox stores or different mailbox servers like the following,

 

  • Server 1
  • Mailbox Store 1 (200 GB)
  • Organization 1 (3 GB)
  • Organization 2 (10 GB)
  • Mailbox Store 2 (200 GB)
  • Organization 1 (2 GB)
  • Server 2
  • Mailbox Store 3 (200 GB)
  • Organization 1 (5 GB)

 

Note: Organization 1 may have mailboxes in different mailbox store because it has been allocated mailbox space in 3 different mailbox stores.

 

The above is what we called fixed quota, meaning an organization has been specifically bought a specific amount of disk space and they will get allocated with those spaces. If they have used up those spaces, they won't be able to create any more mailboxes until they delete some or they buy more and it will need to be allocated with more space. This is really not difficult to understand at all.

 

Now, from the ResourceManager database, what's going to happen is this,

 

  • Like tracking the Exchange resource, HMC will also track the Organization resource. This is done in the similar manner as the Exchange resource. It will create resource instances in rmcore_ResourceInstance table. It will create one resource instance entry per mailbox store per organization. Meaning if I have an organization being allocated space in 2 different mailbox store, it will create 2 different resource instances.
  • Now, because the Organization resource is taken out from the Exchange resource, it means the organization is also a consumer of resource. Hence,
  • It will create an entry in the rmcore_ConsumerInstance for this organization.
  • Then it will record the space taken by the organization on blockmodel_ModelAllocationData table, mapping it to the Exchange resource.
  • Exchange resource capacity will be updated to reflect the available space.

 

Note: It should be noted that the above is a high level and does not include all the tables involved. For example, rmcore_MappingTable will be also be updated to record the mapping of the resource instance with the consumer instance. The above is to facilitate the understanding of how things get tied together.

 

Tracking Mailbox Usage

 

This is very similar to Organization taking the resources from the Exchange resources, except this time, it is Mailbox taking the resources from the Organization resource. So, it actually look like the following,

 

  • Server 1
  • Mailbox Store 1 (200 GB)
  • Organization 1 (3 GB)
  • User 1 (1 GB)
  • User 2 (2 GB)
  • Organization 2 (10 GB)
  • Mailbox Store 2 (200 GB)
  • Organization 1 (2 GB)
  • User 3 (2 GB)
  • Server 2
  • Mailbox Store 3 (200 GB)
  • Organization 1 (5 GB)
  • User 4 (2 GB)

 

So, from the ResourceManager database, what's going to happen is this,

 

  • Because a mailbox is the final consumer of the resource, it will not create any resource instance.
  • It will consume the resource from the Organization resource, it means,
  • It will create an entry in the rmcore_ConsumerInstance for this mailbox.
  • Then it will record the space taken by the mailbox on blockmodel_ModelAllocationData table, mapping it to the Organization resource.
  • Organization resource capacity will be updated to reflect the available space.

 

Does it make sense so far? I hope it does. I know it can be slightly confusing.

 

Dynamic Quota

 

So far, we talked about Fixed Quota. There is also another option called Dynamic Quota. Dynamic Quota basically free the organization from specifying a specific amount of disk space. Instead, it doesn't allocate the organization any space until we create a mailbox for that organization. So, when you create a mailbox in an Organization that dynamic quota has been enabled, it will,

 

  • Dynamically find an Exchange resource that has space using the resource selection algorithm.
  • Then allocate the resource from those Exchange resources to the Organization resource. It will create the resource instance if necessary.
  • It will also create the necessary records including organization as the consumer instance and etc.
  • Then it will allocate the organization resource to the mailbox appropriately just like the fixed quota.

 

One thing you should know is that when using Dynamic quota is the deletion. When you delete the mailbox, it will also remove the resources accordingly. However in Fixed Quota, it will only free up the space in the Organization resource but it will not remove the organization resource from the Exchange resource because those are fixed resource allocated to the organization.  

 

All the logic of dynamic and fixed is actually in the application (HMC namespaces and procedures). There is no difference in the database itself.

 

The above should give you an idea of how things fit together and a little bit more insight to how the allocation of Exchange resources in HMC.

 

Resource Selection Algorithm

 

I mentioned about the resource selection algorithm. I just want to briefly explain a bit on this. There are 3 resource selection behaviors that you can specify,

 

  • tightPack - attempts to use the smallest number of mail stores
  • level - level seeks to spread allocations evenly across available stores
  • minStoreCount - minStoreCount attempts to minimize the number of stores allocated to each organization.

 

Shared or not Shared

 

Finally, the last thing I want to mention is that you can also set a resource to Shared or Not Shared. When you add an Exchange resource, you can specify that mailbox store as Shared or not Shared. Shared means it can be used by more than one organization. Not shared means it can only be used by a single organization.

 

 

Exchange Public Folder Resource Management

 

The resource management for Exchange doesn't stop at the mailbox. The ResourceManager database is also being used to manage the Public Folder as well.

 

When we create an Exchange Organization Plan, we also specified the Public Folder space to be allocated for organization using that plan. Like Mailbox Store allocation for the Organization, Public Folder store from the database perspective is actually no difference. There isn't anything very interesting to talk about there.

 

However, when we create a Public Folder for the Organization, that's something I like to touch on. HMC treats Public Folder as a consumer instance for the resource, which is really like a mailbox as a consumer to an Organization mailbox store resource. So, when you create a Public Folder for an organization,

 

  • It creates a consumer instance. The instance_description in rmcore_ConsumerInstance table will be ‘public folder' and the instance_name will be ‘<ORG GUID>\ <public folder name>.
  • It will then consume the resource from the Organization Public Folder store resource, it means,
  • o it will record the space taken by the public folder on blockmodel_ModelAllocationData table, mapping it to the Organization public folder store resource.
  • o Organization public folder store resource capacity will be updated to reflect the available space.

 

Here is a sample SQL query that I use to retrieve all public folders in the Resource Management database,

 

SELECT

                a.instance_Id,

                c.CommonName,

                substring(a.instance_name,1,32) as OrgGUID,

                substring(a.instance_name,33,50) as PublicFolder,

                b.actual_used,

                a.instance_description,

 

                (select distinct instance_location from rmcore_resourceinstance where instance_name = d.instance_location) As Server

FROM

                [ResourceManager].[dbo].[rmcore_ConsumerInstance] a,

                [resourcemanager].[dbo].[blockmodel_modelallocationdata] b,

                [planmanager].[dbo].[customers] c,

                [resourcemanager].[dbo].[rmcore_resourceinstance] d

 

WHERE

                a.instance_description = 'public folder'

                and substring(a.instance_name,1,32) = replace(c.customerID,'-','')

                and a.instance_id = b.consumer_id

                and b.resource_id = d.instance_id

 

 

Public Folder Offline Address Book Resource Management

 

Offline Address Book resource management is nothing fancy as well. Once you understand the resource management model, everything will become relatively mundane. Like the Exchange Resource, we need to first add the Public Folder OAB server resource to the HMC environment.  By default, there should be no more than 1000 OABs per Public Folder server. However, I strongly recommend you to discuss this with Microsoft to understand the scalability of this.

 

Once you have added the Exchange resource, when you create the first MAPI user, it will attempt to create the AL, GAL and OAB and during that time, the organization will be a consumer of the public folder OAB resource. Since there is only one OAB allowed per organization, the decrement will always be just 1.

 

Here, I have some SQL query that will allow you to dump out some data, which you can also do through some of the procedures, of course,

 

/* List the OAB public folder Store  */

 

select

                a.instance_id,

                a.instance_name,

                a.instance_description,

                a.instance_location,

                c.actual_max,

                c.actual_free

from rmcore_ResourceInstance a,

                 rmcore_ResourceType b,

                 blockmodel_ResourceCapacity c

where

                b.type_name = 'ExchOABPublicStore07'

                and a.type_id = b.type_id

                and a.instance_id = c.instance_id

 

 

/* List All Organizations and their OAB server */

 

select

                c.CommonName as Org,

                a.instance_name as OrgGUID,

                d.instance_location as Server,

                e.actual_used

from

                [resourcemanager].[dbo].[rmcore_consumerinstance] a,

                [resourcemanager].[dbo].[rmcore_consumertype] b,

                [planmanager].[dbo].[customers] c,

                [resourcemanager].[dbo].[rmcore_resourceinstance] d,

                [resourcemanager].[dbo].[blockmodel_modelallocationdata] e

where

                a.type_id = b.type_id

                and b.type_name = 'ExchOABOwningOrgConsumer07'

                and a.instance_name = replace(c.customerID, '-','')

                and a.instance_id = e.consumer_id

                and e.resource_id = d.instance_id