Tag Archives: vCenter

vSphere Reports in Microsoft Teams

By joining PowerCLI to interrogate a VMware vSphere environment and the Webhook API to post Microsoft Teams messages, we can send informational reports on the state of a virtual environment to channels in Teams.

In this example I have a weekly report on the number of hosts and VMs in an environment. This is fairly straightforward, but more complicated information surfaced by PowerCLI could easily be included.

vistatsinteams

Setting up the WebHook

The Webhook allows messages to be pulled into the Teams channel of choice. You’ll need to setup an Incoming Webhook on your channel of choice.

To do this

  1. Right-click on the Teams Channel and choose Connectors
  2. Find Webhook in the list and click on the adjacent Confugure button.
  3. Enter a name, and choose an icon for the Webhook as prompted. Click on Create and a URL will be generated- this is needed for the script below.

Storing vCenter credentials

As this will be run as a scheduled task we need to store credentials so that the script doesn’t try to prompt for a password. There’s a number of ways of doing this- here I’ve used the Get-Credential cmdlet to prompt for the username and password and then the Export-CliXml cmdlet to save those credentials to a file.

 $Credential = Get-Credential

$Credential |

Export-CliXml -Path C:\Users\myuser\readonlyuser.cred

For the vCenter operations in the script below (counting hosts and VMs) then a user account with Read-Only access is sufficient.

The Script

Finally the script. This can be run manually or set as a scheduled task. The URL of the webhook created above needs to be entered as the value of the $TeamsWebhookURI variable at the top, along with the vCenter credentials and the name of the vCenter.

#Set the Webhook URI to send the message to
$TeamsWebhookURI="https://outlook.office.com/webhook/[email protected]/IncomingWebhook/zzzzzzzzz/zzzzz-zzzz"
#Use pre-defined credentials
$credential = import-clixml -Path C:\Users\myuser\readonlyuser.cred
#What is the address of the vCenter?
$vCenter="vcenter.mydomain.com"
#Connect to vCenter
Connect-VIServer -Server $vCenter -Credential $credential
#Count the VMs and hosts
$poweredoff = @(get-vm | Where-object{$_.PowerState -ne "PoweredOn" } | measure-Object -Line).Lines
$poweredon = @(get-vm | Where-object{$_.PowerState -eq "PoweredOn" } | measure-Object -Line).Lines
$hostCount=(Get-VMHost | Measure-Object).Count
#Disconnect from vCenter
Disconnect-viserver -Server $vCenter -Confirm:$false

#Build the JSON for the Body of the message
$JSONBody = [PSCustomObject][Ordered]@{
"@type" = "MessageCard"
"@context" = "http://schema.org/extensions"
"summary" = "Weekly Infrastructure Stats"
"themeColor" = '0078D7'
"sections" = @(
@{
"activityTitle" = "Virtual Infrastructure"
"activitySubtitle" = "Statistics"
"activityImage" = "https://mydomain.com/infoicon.svg"
"facts" = @(
@{
"name" = "Num. of Hosts: "
"value" = $hostcount
},
@{
"name" = "Powered On VMs: "
"value" = $poweredon
},
@{
"name" = "Powered Off VMs: "
"value" = $poweredoff
},
@{
"name" = "Total VMs: "
"value" = ($poweredon+$poweredoff)
}
)
"markdown" = $true
}

)
}
$TeamMessageBody = ConvertTo-Json $JSONBody -Depth 100

#Build the API call
$parameters = @{
"URI" = $TeamsWebhookURI
"Method" = 'POST'
"Body" = $TeamMessageBody
"ContentType" = 'application/json'
}
#Make the API Call
Invoke-RestMethod @parameters

The input arguments had entities that did not belong to the same datacenter.

Symptoms

Trying to vMotion (in my case a cross-vCenter vMotion from a 6.5 system to 6.7) a VM the error “The input arguments had entities that did not belong to the same datacenter.” occurred. Other VMs were migrating fine.

image

Cause

The CD Drive in the source VM was mapped to (although not connected to) a Content Library ISO file.

Solution

Point the source VM CD drive at “Client Device” and retry the vMotion.

image

vSphere 6.0- time to upgrade

vCenter-logoIf you’re running VMware vCenter and ESXi 6.0 it’s time to start planning to upgrade as General Support ends on 12 March 2020- one year from now and five years from it’s release. Thankfully the upgrade from 6.0 to 6.5 or 6.7 is usually quite straightforward, and VMware have put a lot of work into streamlining this process.

Looking at the Product Lifecycle Matrix other notable products in the VMware stable worth keeping an eye on include NSX for vSphere (NSXv) 6.2, Site Recovery Manager (SRM) 6.0 and 6.1, and vSAN 6.0-6.2.

VMworld 2018 US: HCI1469BU- The Future of vSAN and Hyperconverged Infrastructure

This “HCI Futures” session at VMworld US was hosted by two VPs from the Storage and Availability Business Unit, plus a customer guest. It covered the new features recently added to the vSAN environment with the release of 6.7 Update 1, alongside discussion of the possible future direction of VMware in the Hyper-Converged Infrastructure space. I caught up with the session via the online recording.

HCI is a rapidly growing architecture, with both industry wide figures from IDC and VMware’s own figures seeing massive spending increases. In the week of this VMworld, the 4-year old vSAN product is now boasting 15,000 customers. We are told customers are embarking on journeys into the Hybrid Cloud and looking for operational consistency between their On-Premises and Public Cloud environments.

The customer story incorporated into this breakout session was provided by Honeywell. They were an early adopter of vSAN in 2014, starting with the low-risk option of  hosting their management cluster on the technology. Since then they have replaced much of their traditional SAN infrastructure and are now boasting 1.7 Petabytes of data on vSAN, with compression and de-duplication giving them savings of nearly 700TB of disk.

VMware is pushing along several paths to enhance the product- the most obvious is including new storage technologies as they become available. All-flash vSAN is now commonplace, with SSDs replacing traditional spinning disk in the capacity tiers. Looking to the future, the session talked of the usage of NVMe and Persistent Memory (PMEM) developments – storage latency becoming significantly less than network latency for the first time. This prompts a move away from the current 2-tier model to one which incorporates “Adaptive Tiering” to make best use of the different storage components available.

image

In the Public Cloud- in particular the VMware on AWS offering- there have been customers who want to expand storage faster than compute. In the current model this hasn’t been possible due to the fixed-capacity building blocks that HCI is known for. This is being addressed by adding access to Amazon’s Elastic Block Storage (EBS) in 6.7U1 as a storage target for the environment. vSAN Encryption using the Amazon KMS is also included, along with the ability to utilise the Elastic DRS features when using AWS as a DRaaS provider for a vSphere environment.

vSAN is also moving away from it’s position as “just” the storage for Virtual Machines. Future developments include the introduction of file storage- and the ability to do some advanced data management- classifying, searching, and filtering the data.

With all this data being stored, VMware is looking to enhance the data protection functionality in the platform. Incorporation of native snapshots with replication to secondary storage (and cloud) for DR purposes increase the challenge to “traditional” storage vendors- and although it was played down in this talk also encroach further into the backup space which is populated by a large group of VMware partners.

Cloud Native applications are also being catered for with Kubernetes integration- using application-level hooks to leverage snapshots, replication, encryption, and backups all through the existing vCenter interface.

If you want to watch the recording of this session to get more information it’s available on the VMworld site: https://videos.vmworld.com/searchsite/2018?search=HCI1469BU. To sign up to the vSAN Beta which is covering some of the Data Protection, Cloud Native Storage, and File Services visit http://www.vmware.com/go/vsan-beta

VMworld 2018 US: VIN2992BU- vSphere Client Roadmap

This session at VMworld US 2018 covered the past, present, and some of the future of the VMware vSphere Client. I caught up with the session via the online recording.

vSphere has moved from having a Windows-only desktop client (known as the “C#” or “fat” client), through a flash-based client to the new modern HTML5 client. The fat client is no longer supported by the current vSphere platforms and the Flash client will be deprecated with the “next numbered release” of vSphere- i.e. that version will be the last one to ship with the Flash client and from then on the HTML5 client will be the interface.

vSphere Client Evolution 2016-2018- Slide from VMworld 2018 US: VIN2992BU

vSphere Client Evolution 2016-2018

The HTML5 client has been around since appearing as a “fling” back in March 2016, becoming part of the supported release in November of that year with vSphere 6.5, and has picked up additional features with each subsequent release. With the new vSphere 6.7 Update 1 release this is now fully functional.

New features in 6.5U1 to round off this functionality include the integration of VMware Update Manager (VUM) and Platform Services Controller (PSC) management. There’s improvements around the creation workflow for alarm definitions, and for the implementation of vCenter High Availability (VCHA).

Also new is improvements to the search, including filtering. The presenters discussed  how the traditional tree-view used in the client could make it difficult to locate one of 35,000 VMs and a more targeted search was a better approach. There wasn’t a huge amount of talk prospective future developments in the clients in this talk but one of the items mentioned was the interest in integrating natural language searching in a future release.

The HTML5 client fling is still available, and can be used by vCenters running versions 6.0 or 6.5, but not 6.7. At the date the slides were made there had been 70,000 deployments of this fling and it had featured 70 update releases in the 2 years it has been available.

There was some information given about the feedback options in use- notably the use of the CEIP program to collect usage analytics from admins who have signed up to the scheme. This anonymised data is being used by VMware to drive future developments and prioritise features.

Around 30 minutes into the presentation the sound drifts off for about 5 minutes as there is a discussion with members of the audience. As a tip- always try and give the audience microphones or at least repeat their question for the recordings.

If you’re watching the recording then stick around as the final section covered the modern plugin framework which allows 3rd party developers (your backup, storage vendors etc.) to produce JavaScript-based plugins for the HTML5 client. VMware is offering a certification for these plugins to ensure compliance and the new plugin architecture allows vendors to deploy new versions outside of vSphere’s own release lifecycle.

If you want to watch the recording of this session to get more information it’s available on the VMworld site: https://videos.vmworld.com/searchsite/2018?search=VIN2992BU