This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Apply Custom Attribute Dynamically

Hi,

We are starting to leverage custom properties more extensively. I am looking for a way to dynamically apply custom attributes to nodes based on their host name. For example a server beginning with PR would automatically be assigned a Production environment attribute, DV assigned a Dev Environment attribute, and so on. The intention is to have this an automated process so as new servers are discovered via polling, an attribute based on the host name can be applied and the node can be categorized accordingly based on the custom environment attribute assigned. It would also be beneficial if I could apply this same configuration to existing systems to ensure consistency

Looking forward to some suggestions on how to handle this.

Many thanks!

  • Basic with no external programming

    you could create custom property

      Environment

    Create an alert which changes custom property action

    pastedImage_0.png

    Trigger Condition

    pastedImage_2.png

    Trigger action

    pastedImage_1.png

    change the frequency of the alert evaluation

    pastedImage_4.png

    Create new alert for each of the prefixes you want.

  • Thank you this worked perfectly!

    Now I am struggling with making this work based on the ESXi server they reside on. Another scenario we have is that we would like to categorize VM's based on the ESXi they live on. We have a physical environment where a VMware cluster spans multiple data centres via Layer2. As such, I am looking for a way to organize VM's based on the ESXi host name on which they reside. In our case our esxi hosts are named according to the data centre they reside. So I was trying to follow a similar process as outlined above, to use 'the name begins with' which works for the VM's based on name, but this does not appear to work for hosts.

    I have tried multiple ways. I tried using the Virtual Host object as a test to ensure it would move hosts based on a certain name rule. Although this same rule works in the context of a node using node object, it does not work for a host, based on host name or DNS name, when specifying Virtual Host object context.

    I am sure I am missing something simple here. But now that I have the VM nodes categorizing based on 'Node' rules, how would I go about categorizing VM's based on the ESXi host (in our case group of hosts) they reside on? Given that I cannot rely on virtual cluster, since a single cluster might span multiple geographical data centres.

    Many thanks for the continued support!

  • Anybody with any thoughts or suggestions on this? Am I simply doing something wrong?

  • Not sure exactly what you want to achieve, maybe try a custom query resource on your page that groups the hosts and guests and then restrict it on hosts for location so you can see what guests are hosted on what locations

    SELECT Hosts.Hostname, VirtualMachines.DisplayName FROM Orion.VIM.VirtualMachines INNER JOIN Orion.VIM.Hosts ON VirtualMachines.HostID=Hosts.HostID

    If for changing a custom property you could try adjusting custom property based on Virtual Machine

    pastedImage_0.png

    This will show you the Host ID if needed

    SELECT Hosts.HostID, Hosts.HostName FROM Orion.VIM.Hosts