Monitoring and reporting for Veeam Backup & Replication, VMware vSphere and Microsoft Hyper-V in a single System Center Operations Manager Console
Post Reply
nico.weytens
Influencer
Posts: 17
Liked: 2 times
Joined: Jul 02, 2012 8:30 am
Full Name: Nico Weytens
Location: Belgium
Contact:

Dynamic group of datastores larger than 1TB

Post by nico.weytens »

I'm trying my luck on the forum as this is not too urgent, and I'm not sure whether this is related to OpsMgr or nworks. If required I can make an official case for this. Here goes...

I'm trying to create a new group with a dynamic membership of datastores larger than 1 TB. The idea is to target this group when making an override on the free space monitor.
For some reason I don't get the expected members, and I don't see what I'm doing wrong. This is the first dynamic membership I'm creating, so I hope it's not a newbie error :wink: but this seems to be quite straight forward...

We already have a group called nworks VMware Datastores, which comes by default with the MP I guess. The query is ( Object is DATASTORE AND True ). It has 1266 members.
I created a new group called nworks VMWare Datastores > 1024 GB with query ( Object is DATASTORE AND ( diskSize GB Greater than 1024 ) AND True ). To my surprise there are still 1265 members :?: Just clicking random datastores I see all kinds of sizes like 250, 300, 600, 750, 1300 etc.
I started experimenting with the query. Lowering the value to 600GB only seems to give me the datastores larger than 600GB (as expected), but... also gives me the local ESX 63GB disks, and none of the datastores larger than 1TB
When changing the value again, this time to 900GB, the group doesn't have any members at all :?:
As I know we have a couple of 900GB datastores I changed the query to ( Object is DATASTORE AND ( diskSize GB Greater than 899 ) AND True ) . The result is 3 members that are 900GB in size (not sure if we have others), and the larger datastores are missing again.

What's going on here? :|
Alec King
VP, Product Management
Posts: 1445
Liked: 362 times
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by Alec King »

Hi Nico,

At first glance, I think that the group query is not doing a numeric comparison - the values are not being treated as numbers, but as strings. Regular Expression matching might be better to use here. Let me look into this a bit deeper and get back to you...

Cheers
Alec
nico.weytens
Influencer
Posts: 17
Liked: 2 times
Joined: Jul 02, 2012 8:30 am
Full Name: Nico Weytens
Location: Belgium
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by nico.weytens »

Hi Alec, have you had any time to have another look at this (I can make an official support case if you'd prefer it).

I'm just wondering if this is a problem with SCOM storing integers as strings, or a small bug in the nworks MP that could be solved in a future version (or private update :mrgreen:).
I'm rusty with regular expressions, so I'd prefer if I'd be able to use the regular "greather than"/"smaller than" operators.
Alec King
VP, Product Management
Posts: 1445
Liked: 362 times
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by Alec King »

Hi Nico,

Apologies for delay! I have established that SCOM is storing these values as string....which unfortunately means that you must use reg-exp. I haven't yet narrowed down the exact reg-exp required, because I'm a bit rusty there myself! ;-)
I think you could use a reg-exp that checks for <4 characters> in the diskSizeGB - that will give you datastores of 1000 GB and greater. Any smaller datastore will of course be 3 (or less) characters. For greatest accuracy, you can check for 4 numeric characters. I think 'matches regexp ####' might work but I haven't tested it....

And we will be able to change our method for storing these properties in the database, so in next MP update using standard < or > comparisons will work.
If I can help further let me know!
Cheers
Alec
nico.weytens
Influencer
Posts: 17
Liked: 2 times
Joined: Jul 02, 2012 8:30 am
Full Name: Nico Weytens
Location: Belgium
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by nico.weytens »

Then for the time being we'll go for regular expressions :)
Not sure if this is the most optimised code, but in our situation this seems to work fine:
( Object is DATASTORE AND ( diskSize GB Matches regular expression .... ) AND True )

The result is a group of 84 datastores with sizes 1000GB or more. And after reviewing our complete datastore list that number is correct.

Thanks for your time, Alec
Alec King
VP, Product Management
Posts: 1445
Liked: 362 times
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by Alec King »

That's great Nico, thanks for the update!
Did regexp of '####' match it?
Cheers
Alec
nico.weytens
Influencer
Posts: 17
Liked: 2 times
Joined: Jul 02, 2012 8:30 am
Full Name: Nico Weytens
Location: Belgium
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by nico.weytens »

I think you're mistaken, Alec.
When I change the dots to hashes, there aren't any members in the group anymore.
Also when looking at the info about regex on wiki, there's no mentioning of # as some sort of operator.

so I'll keep the formula with ....
Alec King
VP, Product Management
Posts: 1445
Liked: 362 times
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by Alec King »

Aha, OK. There is some differences between SCOM regexp and standard regexp, especially for GroupCalc - I was looking at this MS page http://support.microsoft.com/kb/2702651 which states that [0-9] is matched by '#'.
However, if your '....' check is working, then that's the real test :)

Cheers!
Alec
nico.weytens
Influencer
Posts: 17
Liked: 2 times
Joined: Jul 02, 2012 8:30 am
Full Name: Nico Weytens
Location: Belgium
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by nico.weytens » 1 person likes this post

In the meantime I've further narrowed down the dynamic group, so needed to be extra creative with the query. :wink:
It might be useful to someone, so let me put it public:
(
Object is DATASTORE AND
( Datastore Cluster Name Does not contain VDI ) AND
( diskSize GB Does not match regular expression .... ) AND
( diskSize GB Does not match regular expression [6-9].. )
)


This gives me the datastores < 600GB not belonging to a Datastore Cluster that has "VDI" in its name.
There might be a more optimised regex query, but at least this works for me :)

cheers,
Nico
Alec King
VP, Product Management
Posts: 1445
Liked: 362 times
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Dynamic group of datastores larger than 1TB

Post by Alec King »

Great info Nico, thanks for sharing! :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests