Category Archives: VMware

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

 

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).

VMworld

VMworld 2018 Call for Papers

The Call for Papers for VMworld 2018 is now live, running until March 13th. As with last year, this is for both the US and Europe legs of the event, even though the Barcelona date has been moved to early November. This seems a little odd given the speed of change in tech, submitting a topic eight months before the event, but I’d hope that space is left in the program for new developments and releases to be covered when the show comes across the Atlantic.

If you’re interested in submitting a session, Eric Siebert has some good tips over on vsphere-land.com on how to get it approved. Having never submitted for the conference (with the exception of a vBrownbag appearance), I’m not going to offer any further advice from that point of view, but I do have one request as a regular attendee:

Appropriate Naming

Please, please, title and describe your session appropriately. Whilst phrases like “Deep Dive” or “Customer Story” often draw in the audience, they are going to leave disappointed if they get an introductory level view of the product, or the only reference to the customer is “we sold it to them”. A big crowd leaving bad feedback isn’t going to impress.

At last year’s event I saw some excellent Deep Dives – the vSAN Troubleshooting DeepDive (STO1315BE) and the vSphere 6.5 Host Resources Deep Dive (SER1872BE) are great examples of talks with some awesome in-depth content. However I was in another “Deep Dive” where the presenters spent a sizeable amount of time giving an introduction to the product in question before trundling through marketing slides. I’m not going to name and shame here- I raised it appropriately in the session feedback at the time- but it did feel like I’d wasted an hour out of my schedule. Time at the event is valuable and limited, so attendees try and get the most out of every hour.

Don’t let this detract anyone from attending and registering for sessions- in my experience the majority of sessions are well labelled in the Content Catalog- but if you are thinking of presenting please make sure to describe your session correctly and help improve the experience even more. I’m looking forward to seeing what sessions are going to be on the list this year, and hoping to be there in person (subject to obtaining a conference pass).