Wondering how to add the vSphere Tag for a virtual machine to emails sent out for alerts? I recently came across this Reddit post, so decided to try out the Custom Payload feature from vRealize (Aria) Operations and want to share the steps I took to achieve this setting.
Here‘s how to configure a Payload Template and Notification to include the vSphere Tag:
Creating the custom payload template to include the vSphere Tag
To get started, within your vRealize Operations interface (SaaS or on-premises), go to:
Configure > Alerts
Click on Payload Templates icon
Click Add to create a new template
Give your custom payload template a name,
a description,
and set which outbound method it’s tied to. For my example, it will be email.
In this blog post, I am going to break down a PowerShell code I have created (with help from some colleagues). The functions of this PowerShell code are;
Present a GUI form to the end user
Connect to a vCenter
Select the virtual machine to be cloned
Select the datastore the new VM is to be stored on (display DS free space)
Select the host for this VM to be created against (display free memory on the host)
Set the new VM name
Create an IP reservation in both the Production and DR DHCP Scopes
Below are some functional screenshots of the code’s GUI and also a rough flowchart of what I needed to achieve.
You can skip to the end to find the full code or my github.
TAM Lab Recording
Since posting this blog, I also covered this in a VMware TAM Lab recording which you can watch below.
A little more background on the script
So my customer had a dedicated environment for hosting their custom application, however these applications were built and running inside an old unsupported OS which expected to be running on a particular era of CPU’s to run correctly, for example todays Intel Skylake would cause the OS to panic and not run. As you can also imagine with this type of older OS, there are no VM Tools support either.
Here is the architecture diagram;
Providing DR around this environment was interesting, we could protect the VM using SRM and storage array LUN replication. But this also presented some issues, when the VM boots in DR. “what happens with networking?” hence we setup a DHCP reservation on both Production and DR. Meaning we know the VMs IP regardless of where its booted.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.