Configure an SMTP server in vCenter is not difficult at all, and all you have to do is put the server and the sender address in some boxes then click OK. Since is so easy you might think the configuration only takes 30 seconds; and you are right, if the vCenter server is joined to a windows domain and the email system also integrates with AD. Exchange users are so lucky right now!
For those that don’t have an AD infrastructure, or they just don’t want to put the vCenter server in a domain, there are alternatives, and I’ll show them to you as we move along. First I want to start configuring the vCenter mail settings with an Exchange e-mail system, since is simpler and probably more common.
To begin, open vCenter, go to the Home page and click the vCenter Server Settings icon. You can also use the Tools menu by going to Administration > vCenter Server Settings.
Here click the Mail menu and type the SMTP server and sender account in those boxes then hit OK.
If is not working make sure on the Exchange Default Receive Connector you have the Anonymous users box checked.
For some of you this might not be a valid option if you have and Edge server, but there is a solution, and a simple one actually; create another Receive Connector. Just right-click on the white space and choose New Receive Connector.
Give it a name, and under Select the intended use for this Receive connector make sure you choose Internal.
On the Remote Network settings page click the Edit button. We need to modify the IP rage that this connector can receives packets from, since we will allow anonymous access. In the boxes type the IP address of your VMware vCenter server. This means that only packets can come from this IP address will be allowed on the Exchange server.
Click the New button to create the Receive connector.
Now open the properties of the newly created Receive connector and make sure you check the Anonymous users box on the Permission Groups tab. Test and see if you get emails when something happens in your VMware vCenter environment. For this you can configure alarms.
How let’s get to the other scenario where you don’t have Microsoft Exchange. For this I will use hMailerServer, which is a free mail server for Windows, and is pretty good. Download the package and install it using the default settings. When you get to the Specify main password screen, type a password and make sure you remember it, or you won’t be able to configure the hMailServer settings.
Click Finish to launch the administration console.
If you want, you can save the password by clicking the Edit button. Another great option is to check the Automatically connect on start-up box, so you do not get this Connect window every time you want to open the hMailServer administration console. When you’re done click the Connect button, then provide your password.
The first thing you want to do after the administration console is up, is to create a domain. Click the Add domain button from the Welcome screen, then type a domain name in the Domain box. Hit Save when done.
The second thing is to create mailbox accounts. Click the Accounts folder under your domain name, then hit the Add button. In the Address box type the mailbox account name you want to create then provide a password in the Password box. Click Save when done. Repeat this operation to create another mailbox account.
Next we need to configure the SMTP protocol, but before that some DNS entries need to be created on the DNS server. Here I’m using a Windows DNS server that has the vkernel.local zone created. Right-click the zone name and choose New Alias (CNAME).
In the Alias name box type just smtp. The target host is the machine where hMailServer is installed; in my lab here I’ve installed hMailServer on the VMware vCenter server so I will point to this host. Click OK when done.
Another DNS entry that we need to create is an MX Record. Right-click the zone name and choose New Mail Exchanger (MX). On the Fully qualified domain name (FQDN) of mail server box type the FQDN of the host where you installed hMailServer; again, in my case this is the vCenter server. Click OK.
Back on our hMailServer administration console, expand Settings > Protocols and click the SMTP protocol. On the Delivery of e-mail tab in the Local host name box type smtp.domain.com; and in my case is smtp.vkernel.local. This is the entry we just created in DNS. Since we are using a local domain, and not a public one, we need to use an SMTP relay server if we want to send reports to an external e-mail address and not be market as Spam. I’m using Socketlabs services for this. Type your SMTP relay server and authentication credentials then click Save.
Expand Settings > Advanced > IP Ranges and click the My computer object. On the Allow deliveries from leave only Local to local e-mail addresses and Local to external e-mail addresses boxes enabled. I disabled POP3 since I’m not going to use it, but I will configure my Thunderbird client with IMAP to see if logs are delivered on my local mailbox; that’s why I leave it checked. Click the Save button when done.
On the vCenter server configure the Mail settings like you did before with the Exchange server. In the SMTP server box type the name of the machine where hMailServer resides, in this case is the vCenter server. You can put localhost here but if your hMailServer is on another box, make sure you type the name of that machine. I tried using smtp.vkernel.local, but for some reason it doesn’t work. If you just type a host by using its NameBIOS name, you might need to edit the hosts file so vCenter can find it.
And here is the result. I created a vCenter alarm that sends reports whenever a VM is shut down. Reports are sent to my internal mailbox, but also on my Gmail address.
Want content like this delivered right to your