locked
How to set /change the Virtual Machine attribute RRS feed

  • Question

  • I'm trying to create a group of logical disks, based on the fact that they are all 'real' physical disks. Thanks to Kevin and Marnix I'm able to create the sets of disks, however they are dependent on the attribute 'Virtual Machine'. And since I'm (mainly) running on VMWare, and I (at this point) have no MP's for this in place, this attribute is only set for Clusters and Hyper-V machines, but not for VMWare machines. Is there a way to set this attribute (by hand)?

    I can distinguish the Virtual Machines by the type of Network Card, and I've succesfully create a group based on this 'attribute'. The other way to do this then would be to create a group based on another group. This works for default 'Windows Server / Computer' objects, since the Logical disks are a 'child' of this object. Since the attribute I created is part of the Windows Computer_extended Object (by default) there are no children to it and this doesn't work.

    I've found a description on how to create a subset of a group (here ) but I've yet to figure this out.. Basically it's too much XML / SQL for my knowledge at this point... :( (though I'm learning :) ) So any help here would be much appreciated!
    • Edited by Pieter Bovy Monday, December 7, 2009 4:25 PM spelling
    Monday, December 7, 2009 4:20 PM

Answers

  • Hi Pieter,

    I think you can create your own discovery which will redefine (rediscover) this attribute (Virtual Machine = true). You can base this rule, for example, on SYSTEM\CurrentControlSet\Services\vmmouse registry key existence. Here is the example:

    <Discovery ID="DemoMP.RediscoverVMattribute.Discovery.Discovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="Windows!Microsoft.Windows.Computer" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>IsVM</AttributeName>
                  <Path>System\CurrentControlSet\Services\vmmouse</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>86400</Frequency>
              <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/IsVM</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>


     
    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Tuesday, December 8, 2009 3:41 PM
    Tuesday, December 8, 2009 6:43 AM
  • TAke a look:
    Here is my xml:

    <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    Here is yours:

     <Reference Alias="MicrosoftWindowsLibrary6172210">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    and

    <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    'Windows' word before "!" is an Alias to management pack in which class 'Microsoft.Windows.Computer' is defined. In your case this alias will be "MicrosoftWindowsLibrary6172210". So your code will look like:


    <ClassId>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    And you don't need this:
     <EntityTypes>
          <ClassTypes>
            <ClassType ID="Type835f558fe6e048fe9796832a193e9f2b" Accessibility="Public" Abstract="false" Base="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" Hosted="false" Singleton="false">
              <Property ID="AttributeDiscoveryGeneratedByUI72049d13f14248dca0682494b4dfdb3f" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
            </ClassType>
          </ClassTypes>
        </EntityTypes>

    Because we are discover attribute for the class that exists. 

    Here is the 'fixed' code:

    <ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>DemoMP</ID>
          <Version>1.0.0.1</Version>
        </Identity>
        <Name>DemoMP</Name>
        <References>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="MicrosoftWindowsLibrary6172210">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Monitoring>
        <Discoveries>
          <Discovery ID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49" Enabled="true" Target="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="MicrosoftWindowsLibrary6172210!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>IsVM</AttributeName>
                  <Path>System\CurrentControlSet\Services\vmmouse</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>86400</Frequency>
              <ClassId>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/IsVM</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>
        </Discoveries>
      </Monitoring>
      <Presentation>
        <Folders>
          <Folder ID="Folder_e4f63521845e47cc83e00a51cc4838f7" Accessibility="Public" ParentFolder="SystemCenter!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" />
        </Folders>
      </Presentation>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49">
              <Name>ASML Virtual MachineDiscovery</Name>
            </DisplayString>
            <DisplayString ElementID="DemoMP">
              <Name>DemoMP</Name>
            </DisplayString>
            <DisplayString ElementID="Folder_e4f63521845e47cc83e00a51cc4838f7">
              <Name>DemoMP</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
        <LanguagePack ID="RUS" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49">
              <Name>VM Attribute Discovery for vmware Guests</Name>
              <Description />
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>

    Try this and feel free to ask any questions.


    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Tuesday, December 8, 2009 3:41 PM
    Tuesday, December 8, 2009 3:04 PM
  • When you are disabling rule for the group this rule will not run on any group member. If the 'default' rule run on some vmware guest it will return 'VM=false'. We are dont need that. So we are disable this rule for only vmware guests. This rule will run on every Windows Computer EXCEPT vmware guests.
    Hope this help

    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Wednesday, December 9, 2009 10:33 AM
    Tuesday, December 8, 2009 4:45 PM

All replies

  • Hi Pieter,

    I think you can create your own discovery which will redefine (rediscover) this attribute (Virtual Machine = true). You can base this rule, for example, on SYSTEM\CurrentControlSet\Services\vmmouse registry key existence. Here is the example:

    <Discovery ID="DemoMP.RediscoverVMattribute.Discovery.Discovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="Windows!Microsoft.Windows.Computer" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>IsVM</AttributeName>
                  <Path>System\CurrentControlSet\Services\vmmouse</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>86400</Frequency>
              <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/IsVM</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>


     
    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Tuesday, December 8, 2009 3:41 PM
    Tuesday, December 8, 2009 6:43 AM
  • Alexey, thank you for your help so far! I'm struggling to get this to work in my environment. I'm trying to transplant this code into the MP I created for the discovery of the 'custom' Virtual Server attribute to populate my group of physical servers. I'm sure I'm missing something...
    If I replace the part of the discovery, SCOM tells me it still fails to import the MP. I upped the version number, removed the references to DisplayStrings that are no longer used and still it fails. What am I missing?

    Here's my code with the transplant:

    <?xml version="1.0" encoding="utf-8"?><ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>DemoMP</ID>
          <Version>1.0.0.1</Version>
        </Identity>
        <Name>DemoMP</Name>
        <References>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="MicrosoftWindowsLibrary6172210">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="Type835f558fe6e048fe9796832a193e9f2b" Accessibility="Public" Abstract="false" Base="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" Hosted="false" Singleton="false">
              <Property ID="AttributeDiscoveryGeneratedByUI72049d13f14248dca0682494b4dfdb3f" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
            </ClassType>
          </ClassTypes>
        </EntityTypes>
      </TypeDefinitions>
      <Monitoring>
        <Discoveries>
          <Discovery ID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49" Enabled="true" Target="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="Windows!Microsoft.Windows.Computer" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>IsVM</AttributeName>
                  <Path>System\CurrentControlSet\Services\vmmouse</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>86400</Frequency>
              <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/IsVM</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>
        </Discoveries>
      </Monitoring>
      <Presentation>
        <Folders>
          <Folder ID="Folder_e4f63521845e47cc83e00a51cc4838f7" Accessibility="Public" ParentFolder="SystemCenter!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" />
        </Folders>
      </Presentation>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="DemoMP">
              <Name>DemoMP</Name>
            </DisplayString>
            <DisplayString ElementID="Folder_e4f63521845e47cc83e00a51cc4838f7">
              <Name>DemoMP</Name>
            </DisplayString>
            <DisplayString ElementID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49">
              <Name>ASML Virtual MachineDiscovery</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>

    I'm feeling like such a dumbass.. I know SCOM has a steep learning curve, but I'm doing my best... :( So once again: HELP! :)
    Tuesday, December 8, 2009 2:48 PM
  • TAke a look:
    Here is my xml:

    <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    Here is yours:

     <Reference Alias="MicrosoftWindowsLibrary6172210">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    and

    <ClassId>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    'Windows' word before "!" is an Alias to management pack in which class 'Microsoft.Windows.Computer' is defined. In your case this alias will be "MicrosoftWindowsLibrary6172210". So your code will look like:


    <ClassId>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>

    And you don't need this:
     <EntityTypes>
          <ClassTypes>
            <ClassType ID="Type835f558fe6e048fe9796832a193e9f2b" Accessibility="Public" Abstract="false" Base="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" Hosted="false" Singleton="false">
              <Property ID="AttributeDiscoveryGeneratedByUI72049d13f14248dca0682494b4dfdb3f" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
            </ClassType>
          </ClassTypes>
        </EntityTypes>

    Because we are discover attribute for the class that exists. 

    Here is the 'fixed' code:

    <ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>DemoMP</ID>
          <Version>1.0.0.1</Version>
        </Identity>
        <Name>DemoMP</Name>
        <References>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="MicrosoftWindowsLibrary6172210">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Monitoring>
        <Discoveries>
          <Discovery ID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49" Enabled="true" Target="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="MicrosoftWindowsLibrary6172210!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>IsVM</AttributeName>
                  <Path>System\CurrentControlSet\Services\vmmouse</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>86400</Frequency>
              <ClassId>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                  <Setting>
                    <Name>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]/IsVirtualMachine$</Name>
                    <Value>true</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/IsVM</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>
        </Discoveries>
      </Monitoring>
      <Presentation>
        <Folders>
          <Folder ID="Folder_e4f63521845e47cc83e00a51cc4838f7" Accessibility="Public" ParentFolder="SystemCenter!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" />
        </Folders>
      </Presentation>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49">
              <Name>ASML Virtual MachineDiscovery</Name>
            </DisplayString>
            <DisplayString ElementID="DemoMP">
              <Name>DemoMP</Name>
            </DisplayString>
            <DisplayString ElementID="Folder_e4f63521845e47cc83e00a51cc4838f7">
              <Name>DemoMP</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
        <LanguagePack ID="RUS" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="AttributeDiscoveryGeneratedByUI7e4489165f3d47e4904d4f15276fee49">
              <Name>VM Attribute Discovery for vmware Guests</Name>
              <Description />
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>

    Try this and feel free to ask any questions.


    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Tuesday, December 8, 2009 3:41 PM
    Tuesday, December 8, 2009 3:04 PM
  • BTW, after this discovery rule will be Okay and starts to do its work you should create the group that will contain all vmware guests and disable 'original' rule (which discover MS Virtual Machines) for that group. Take a note that our rule runs every day (<Frequency>86400</Frequency>  = 24 hours).
    http://OpsMgr.ru/
    Tuesday, December 8, 2009 3:29 PM
  • Yes! I got to buy you a beer or a coffee or something :).

    Thank you for your help, and the educating explanation.. Give a man a fish and he will eat for a day, give a man a fishing rod and he'll never be hungry again.. great! You made even me understand this.. ;)

    Tuesday, December 8, 2009 3:40 PM
  • Oh, one more question:

    Why do you advise to disable the 'default' discovery rule for this group? I also have a Hyper-V environment I'm monitoring with SCOM (though that's in the PoC phase). I could see where both discoveries could get in each others way. Do you advise to create two separate groups (VMWare & HyperV) and enable / disable the two discoveries on the groups? Or could I change the discovery to include another regkey so that it would also set the HyperV clients correctly, and I could dispense with the 'default'  rule all together?

    Tuesday, December 8, 2009 4:34 PM
  • When you are disabling rule for the group this rule will not run on any group member. If the 'default' rule run on some vmware guest it will return 'VM=false'. We are dont need that. So we are disable this rule for only vmware guests. This rule will run on every Windows Computer EXCEPT vmware guests.
    Hope this help

    http://OpsMgr.ru/
    • Marked as answer by Pieter Bovy Wednesday, December 9, 2009 10:33 AM
    Tuesday, December 8, 2009 4:45 PM