Email Alerts not sending in vCenter 6.5

Symptoms

  • vCenter (in my case VCSA 6.5 ) is not sending alert emails even though the mail server appears to be configured properly (in the vSphere Web Client this is on the vCenter node under Configure, Settings, General).
  • Network connectivity between vCenter and port 25 on the SMTP server is fine and has been tested.
  • The logs on the SMTP server show no evidence of emails beings sent.
  • When connecting via SSH to the vCenter Server Appliance the sendmail logs are showing errors such as:
    cat /var/log/messages | grep sendmail

    2018-07-14T04:24:46.569978+00:00 my-vc sendmail[21502]: ……: [email protected], [email protected] (0/0),
      delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30528, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0,
      stat=Deferred: Connection refused by [127.0.0.1]
  • Cause

    The “Connection refused by [127.0.0.1]” in the logs is the giveaway here- the settings in the client have not been applied to the sendmail service and vCenter is trying to connect to the localhost as the SMTP server.

    Solution

    Go to the client and reconfigure the mail server to point at something else (it doesn’t have to be a real hostname). Then change it back to the correct settings. Normal alerts will be resumed automatically straight away.  You can test if it works by temporarily adding an additional trigger with a very low threshold to an existing alert with notification action.

    vCenter Mail Settings in vSphere Web Client

    vCenter Mail Settings in vSphere Web Client


    Thanks to vExpert Laurens van Duijin for sending me down the right path with this issue.

Find VMs being replicated to a datastore with Get-VmdkFolders

I’m using vSphere Replication to replicate a number of VMs to a datastore which is being decommissioned. I can’t reconfigure replication by code (I’ve mentioned that there’s no public API or PowerCLI around the vSphere Replication functionality in vSphere 6.5 before- most recently on Twitter)  and I can’t multi-select VMs in the vSphere Web Client and reconfigure en-mass through the GUI.

There’s also no way of telling which VMs are being replicated to this datastore without going into the reconfigure dialogues for each one individually. That’s a lot of clicking before even starting to update the configuration.

I’ve put together a PowerCLI function takes a little of this pain away by establishing which folders on a given datastore contain VMDK files. I’ve already migrated any Virtual Machines off so any remaining VMDKs on the volume should be associated with a replication process. Additionally in this case the default folder name was used when setting up the replication so all the folder names correspond to a VM.

The function is called “Get-VmdkFolders” (as there’s potentially other uses for it) and is available on GitHub here. With this I now have a list of VMs that need manually reconfiguring.

PS C:\> Get-VmdkFolders "MyReplicationDatastore"
MyVM1
MyVM2
MyVM3
MyVM5
MyVM7

 

VMworld 2018 Early-Bird Registration Available

Registration for VMworld 2018 opened this week (8th May) with Early-Bird discounts available until 15th June for the US event, or 27th July for the European event. This gives prospective attendees a $300 / €200 discount on the regular price which runs up until the day before the respective events. This year VMworld US will again be in Las Vegas at the end of August, with the European leg staying in Barcelona but moving to early November.

I’ve seen no official word on why the EMEA event has moved down the calendar, but this does put it in a different financial quarter to the US event both for VMware and their partners. This should allow for more flexibility with both product releases and marketing budget through the year, especially when combined with the recent partner “Empower” event and Dell Technologies World both sat in the spring.

Full details of the event, along with the registration details are available at vmworld.com. The site features a link at the top of the page to choose between the Las Vegas and Barcelona events.

vSAN Licensing: Expanding Clusters and Setting off Alerts

vSAN licenses are assigned per-cluster, so whilst the total number of vSAN licenses in a vCenter inventory might match the total number of vSAN host CPUs, they may not be assigned correctly to the clusters. This will trigger the critical vCenter alarm “License inventory monitoring”. This will also occur if a cluster is expanded (e.g. additional hosts and vSAN licenses are purchased) as it’s only possible to assign one license key to each cluster.

In the example screenshot here we have 2 vSAN license keys, each valid for 8 CPU. The total 16 CPU capacity matches the 16 CPU in use. However, one cluster has 10 CPUs (i.e. 5 dual socket hosts) and the other only 6 CPU. Therefore one license key is 2 CPU oversubscribed whilst the other has 2 free.

image

The method to resolve this is to use the MyVMware license portal to split and merge your pool of vSAN licenses until you have license keys where the capacities match your cluster sizes, and then re-license the vSAN environment. This VMware KB article explains in detail how to do this divide, and merging is a similar process on the same interface: https://kb.vmware.com/s/article/2006972

In the example screenshot above, this was a case of splitting one of the 8 CPUs into a 6 and a 2, and then merging that 2 with the remaining 8 CPU key to create a 10 CPU key and a 6 CPU key which matched the cluster sizes. The old 8-CPU key that was split was removed from the license inventory.

image

Content Library fails to create when target datastore contains a space

Symptoms

A quick note on an issue I spotted in VMware vSphere 6.5 when creating a new content Library. If the datastore being used for the new library contains a space in it’s name then the Create Content Library process fails. The error given is “The specified parameter was not correct: The provided storage backing xxxxx xx for library xxxxx-xxxx-xxxx-xxx is invalid.”. For example, if a second vSAN cluster has been created and the default name “vsanDatastore (1)” was used for the datastore.

 

image

 

image

Solution

Rename the target datastore to a name which does not contain a space then repeat the Content Library creation process.

 

Notes

This occurred in my environment running vSphere 6.5 (vCenter VCSA build 6.5.0.14000) and hasn’t been thoroughly tested for repeatability (at least by me).