WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple

Adding a customized notification banner in the vSphere UI

03.18.2021 by William Lam // 1 Comment

I was recently reminded of an old vCenter Server feature called Message of the Day (MOTD) that I had used quite extensively when I was a customer to easily communicate upcoming patch windows, downtime, updates and other interesting news to my internal users. Back in the day, the vSphere UI was known as the VI Client (C# Client or Thick Client) and once the MOTD is configured, users logging in would see this this custom notification banner across their UI Client.

It has been ages since I had used vCenter's MOTD feature but after sharing this tidbit on Twitter yesterday, I found a mix of folks that were still using this awesome feature including a VMware Cloud on AWS use case to that helped them easily identify a particular environments to users who was just learning about this feature for the first time.

Used this in @vmwarecloudaws to easily identify different environments e.g. Sandbox from Production https://t.co/bu2eaGMJw6 pic.twitter.com/6dMNb940Gb

— Mark McGilly (@MarkMcG_Bel) March 17, 2021

In addition to bringing some awareness to this oldie but goodie feature of vCenter Server, I also wanted to share some details on how you might automate this as I had a few questions about this on Twitter.

Here is a screenshot of my vSphere 7.0 Update 2 environment which has been configured with an MOTD and you can see that it can also properly render emojis, so you can certainly have some fun here 🙂


To configure an MOTD, click on the vCenter Server inventory object and then navigate to Configure->Settings->Message of Day and set or disable the message.


For those that wish to configure the MOTD programmatically, you can do so using the vSphere API with your favorite vSphere SDK of your choice including PowerCLI. You will need to use the UpdateServiceMessage() method which is part of the SessionManager object.

If you wish to view or check whether an MOTD is configured, the following PowerCLI snippet can be used:

Get-AdvancedSetting -Entity $global:DefaultVIServer -Name vpxd.motd | select Value

However, to configure the MOTD, you can NOT use the Set-AdvancedSetting cmdlet as the advanced setting is a read only value and you must use the vSphere API directly.

Using PowerCLI, here is how to view the current MOTD:

$sm = Get-View $global:DefaultVIServer.ExtensionData.Content.SessionManager
$sm.Message

Using PowerCLI, here is how to update/change the MOTD:

$motd = "🚨This is William Lam's environment, it is NOT supported. Use at your own risk 😎"
$sm = Get-View $global:DefaultVIServer.ExtensionData.Content.SessionManager
$sm.UpdateServiceMessage($motd)

Categories // vSphere, vSphere Web Client Tags // motd, vsphere web client

Easily manage ESXi & VCSA SSH login banner & MOTD in vSphere 6.0

02.27.2015 by William Lam // 3 Comments

For customers who have a requirement to configure an SSH login banner and/or message of the day (MOTD) for ESXi or vCenter Server, this usually meant manually editing the /etc/issues (login banner) and /etc/motd (MOTD) configuration files. In vSphere 6.0, this has now been simplified by providing vSphere APIs to allow administrators to easily view and configure SSH login banner and MOTD for both ESXi and VCSA (this does not apply to vCenter Server for Windows).

For ESXi, there are two new ESXi Advanced properties called Config.Etc.issue and Config.Etc.motd and this can also be viewed and edited using the vSphere Web/C# Client as seen in the screenshot below:

esxi-issues-motd
For vCenter Server, there are also two new Advanced Options called etc.issue and etc.motd which can also be viewed and edited using the vSphere Web/C# Client as seen in the screenshot below:

vcsa-motd-issues

What's Displayed

The /etc/issues displays a banner during an SSH login session, this means that you will see the message during the login as highlighted in the screenshot below:

esxi-issues
The /etc/motd displays a banner after a successful SSH login as highlighted in the screenshot below:

esxi-motd

How to Automate

You can use both the vSphere API/CLI to modify the issues and motd configurations. In the examples below, I will be using PowerCLI to demonstrate retrieving and setting the two properties.

Retrieve /etc/issues for VCSA

Get-AdvancedSetting -Entity $vc -Name "etc.issue" | Format-List

Set /etc/issues for VCSA

$msg = "
beware
you
are
entering
the
house
of
Cormac
the
grey
"
Get-AdvancedSetting -Entity $vc -Name "etc.issue" | Set-AdvancedSetting -Value $msg

Retrieve /etc/motd for VCSA

Get-AdvancedSetting -Entity $vc -Name "etc.motd" | Format-List

Set /etc/motd for VCSA

Get-AdvancedSetting -Entity $vc -Name "etc.motd" | Set-AdvancedSetting -Value $msg

Retrieve /etc/issues for ESXi

Get-VmHostAdvancedConfiguration -Name "Config.Etc.issue"

Set /etc/issues for ESXi

$msg = "
beware
you
are
entering
the
house
of
Cormac
the
grey
"
Set-VMHostAdvancedConfiguration -Name "Config.Etc.issue" -Value $msg

Retrieve /etc/motd for ESXi

Get-VmHostAdvancedConfiguration -Name "Config.Etc.issue"

Set /etc/motd for ESXi

Set-VMHostAdvancedConfiguration -Name "Config.Etc.motd" -Value $msg

Categories // ESXi, VCSA, vSphere 6.0 Tags // issues, motd, ssh, vcsa, vcva, vSphere 6.0

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to enable passthrough for USB Network Adapters claimed by ESXi CDCE Driver? 03/30/2023
  • Self-Contained & Automated VMware Cloud Foundation (VCF) deployment using new VLC Holodeck Toolkit 03/29/2023
  • ESXi configstorecli enhancement in vSphere 8.0 Update 1 03/28/2023
  • ESXi on Intel NUC 13 Pro (Arena Canyon) 03/27/2023
  • Quick Tip - Enabling ESXi Coredumps to be stored on USB 03/26/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...