Skip to content

Month: June 2021

HomeLab: How to obtain a Veeam Not for Resale (NFR) license for your HomeLab protection

In this opportunity I come to show you how to get free Veeam licenses that you can use to protect your “HomeLab” or can be used to practice if you are planning to get certified as a “Veeam Certified Engineer” (VMCE). I am currently protecting my virtual environment with these licenses that can be obtained if you meet one of these requirements:

Who is eligible?

  • Veeam Certified Engineers (VMCE)
  • VMware: vExperts, VMware Certified Professionals (VCPs & VCAPs)
  • Microsoft: Most Valuable Professionals (MVPs), Microsoft Certified Solutions Experts (MCSEs)
  • AWS: AWS Heroes & Certified Professionals
  • Nutanix AHV: ALL Nutanix technical personnel
  • VMware, Microsoft, AWS trainers, bloggers and other certified professionals

To request this free license just access the link “Veeam FREE NFR Key for Veeam Availability Suite” and fill out the form which is shown in the following image:

After filling out the form, you will receive an email with the attached NFR licenses that you can install on your Veeam B&R Server.

Although there is a “Veeam Community” version that is also freely available, this license does not have all the features of the NFR edition. I have included the link of the Veeam portal where you can compare the features available for each type of edition. Here is the link “Veeam Feature comparison”.

I hope you liked this post. If you have any questions or comments about it, leave them in comments. Regards.

Hasta Luego Amigos!

HomeLab: Using vCheck for vSphere Infrastructure Health Accessment

In this opportunity I come to show you how to download and use the vCheck tool that is used to validate the health status of the VMware vSphere infrastructure. This tool is developed by Alan Renouf as a mechanism to identify possible failures or misconfiguration in the vSphere implementation. To learn more about this tool I will use the vCheck documentation as a reference:

This script picks on the key known issues and potential issues scripted as plugins for various technologies written as Powershell scripts and reports it all in one place so all you do in the morning is check your email.

vCheck Github Page

In this area I present to you what is checked when using vCheck. To view the content, just click on the “+” icon.

What is checked in the vSphere version?

  • General Details
  • Number of Hosts
  • Number of VMs
  • Number of Templates
  • Number of Clusters
  • Number of Datastores
  • Number of Active VMs
  • Number of Inactive VMs
  • Number of DRS Migrations for the last days
  • Snapshots over x Days old
  • Datastores with less than x% free space
  • VMs created over the last x days
  • VMs removed over the last x days
  • VMs with No Tools
  • VMs with CD-Roms connected
  • VMs with Floppy Drives Connected
  • VMs with CPU ready over x%
  • VMs with over x amount of vCPUs
  • List of DRS Migrations
  • Hosts in Maintenance Mode
  • Hosts in disconnected state
  • NTP Server check for a given NTP Name
  • NTP Service check
  • vmkernel warning messages ov the last x days
  • VC Error Events over the last x days
  • VC Windows Event Log Errors for the last x days with VMware in the details
  • VC VMware Service details
  • VMs stored on datastores attached to only one host
  • VM active alerts
  • Cluster Active Alerts
  • If HA Cluster is set to use host datastore for swapfile, check the host has a swapfile location set
  • Host active Alerts
  • Dead SCSI Luns
  • VMs with over x amount of vCPUs
  • vSphere check: Slot Sizes
  • vSphere check: Outdated VM Hardware (Less than V7)
  • VMs in Inconsistent folders (the name of the folder is not the same as the name)
  • VMs with high CPU usage
  • Guest disk size check
  • Host over committing memory check
  • VM Swap and Ballooning
  • ESXi hosts without Lockdown enabled
  • ESXi hosts with unsupported mode enabled
  • General Capacity information based on CPU/MEM usage of the VMs
  • vSwitch free ports
  • Disk over commit check
  • Host configuration issues
  • VCB Garbage (left snapshots)
  • HA VM restarts and resets
  • Inaccessible VMs

It is important to mention that vCheck has support for other products as shown in the following image:

Source: Virtu-Al.Net

To get started you need to download the tool from the Github portal where it is continuously developed. To download vCheck directly click on the following link “Download”. Once the script is downloaded, it is necessary to unzip it.

The first time vCheck is run it will start the configuration process, this configuration allows you to create a template with the information that will be used for all future runs of the program. To modify these parameters again you can use the <-config> option as follows:

[blabla@blabla ~]$ pwsh #Powershell core on Linux :)
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/blabla/vCheck> ./vCheck.ps1 -config

In this area I demonstrate the vCheck configuration process. To see the configuration process, just click on the “+” icon.

Configuration process example

PS /home/blabla/vCheck> ./vCheck.ps1 -config
WARNING: 
GlobalVariables
# Report header [vCheck]: 
# Would you like the report displayed in the local browser once completed ? [$true]: 
# Display the report even if it is empty? [$true]: 
# Use the following item to define if an email report should be sent once completed [$false]: 
# Please Specify the SMTP server address (and optional port) [servername(:port)] [mysmtpserver.mydomain.local]: 
# Would you like to use SSL to send email? [$false]: 
# Please specify the email address who will send the vCheck report [me@mydomain.local]: 
# Please specify the email address(es) who will receive the vCheck report (separate multiple addresses with comma) [me@mydomain.local]: 
# Please specify the email address(es) who will be CCd to receive the vCheck report (separate multiple addresses with comma) []: 
# Please specify an email subject [$Server vCheck Report]: 
# Send the report by e-mail even if it is empty? [$true]: 
# If you would prefer the HTML file as an attachment then enable the following: [$false]: 
# Set the style template to use. [Clarity]: 
# Do you want to include plugin details in the report? [$true]: 
# List Enabled plugins first in Plugin Report? [$true]: 
# Set the following setting to $true to see how long each Plugin takes to run as part of the report [$true]: 
# Report on plugins that take longer than the following amount of seconds [30]: 
WARNING: 
Connection settings for vCenter
# Please Specify the address (and optional port) of the vCenter server to connect to [servername(:port)] [vcsa.local.lab]: vcenter-01v.pharmax.local
WARNING: 
General Information
# Set the number of days of DRS Migrations to report and count on [1]: 
# Set the number of days of Storage DRS Migrations to report and count on [1]: 
WARNING: 
Checking VI Events
# Set the number of days of VC Events to check for errors [1]: 
WARNING: 
Windows vCenter Error Event Logs
# Set the number of days of VC Events to check for errors [1]: 
# Set the number of days of VC Event Logs to check for warnings and errors [1]: 
WARNING: 
Windows vCenter Error Event Logs
# Set the number of days of VC Events to check for errors [1]: 
# Set the number of days of VC Event Logs to check for warnings and errors [1]: 
WARNING: 
vCenter Sessions Age
# Enter maximum vCenter session length in hours [48]: 
# Enter minimum vCenter session length in minutes (IdleMinutes) [10]: 
# Do not report on usernames that are defined here (regex) [DOMAIN\\user1|DOMAIN\\user2]: 
WARNING: 
vCenter License Report
# Display Eval licenses? [$true]: 
WARNING: 
HA configuration issues
# HA Configuration Issues, do not report on any Clusters that are defined here [Example_Cluster_*|Test_Cluster_*]: 
# HA should be set to ... [$true]: 
# HA host monitoring should be set to ... [$true]: 
# HA Admission Control should be set to ... [$true]: 
WARNING: 
HA VMs restarted
# HA VM restart day(s) number [5]: 
WARNING: 
DRS & SDRS Migrations
# Set the number of days of DRS Migrations to report and count on [1]: 
# Set the number of days of Storage DRS Migrations to report and count on [1]: 
WARNING: 
Cluster Slot Sizes
# Minimum number of slots available in a cluster [10]: 
WARNING: 
Datastore Consistency
# Do not report on any Datastores that are defined here (Datastore Consistency Plugin) [local*|datastore*]: 
WARNING: 
Clusters with DRS disabled
# Clusters with DRS Disabled, do not report on any Clusters that are defined here [VM1_*|VM2_*]: 
WARNING: 
QuickStats Capacity Planning
# Max CPU usage for non HA cluster [0.6]: 
# Max MEM usage for non HA cluster [0.6]: 
WARNING: 
s/vMotion Information
# Set the number of days to go back and check for s/vMotions [5]: 
# Include vMotions in report [$true;]: 
# Include Storage vMotions in report [$true;]: 
WARNING: 
DRS Rules
# Display VM affinity rules? [$true]: 
# Display VM anti-affinity rules? [$true]: 
# Display HOSTaffinity rules? [$true]: 
# Set DRS Rule name exception (regex) [ExcludeMe]: 
WARNING: 
Hosts Overcommit state
# Return results in GB or MB? [GB]: 
WARNING: 
Active Directory Authentication
# Show "OK" results? [$false]: 
# Expected Domain name [mydomain.local]: 
# Expected Admin Group [ESX Admins]: 
WARNING: 
NTP Name and Service
# The NTP server which should be set on your hosts (comma-separated) [pool.ntp.org,pool2.ntp.org]: 
WARNING: 
VMKernel Warnings
# Disabling displaying Google/KB links in order to have wider message column [$true]: 
WARNING: 
Syslog Name
# The Syslog server(s) which should be set on your hosts (comma-separated) [udp://syslogserver]: 
WARNING: 
Disk Max Total Latency
# Disk Max Total Latency Settings in Milliseconds [50]: 
# Disk Max Total Latency range to inspect (1-24) Hours [24]: 
WARNING: 
Lost Access to Volume
# Set the number of days of Lost Action Volume to report and count on [1]: 
WARNING: 
Check LUNS have the recommended number of paths
# Set the Recommended number of paths per LUN [2]: 
WARNING: 
ESXi Inode Exhaustion
# Set the ESXi filesystem free Inode threshold in percent [40]: 
WARNING: 
Host Profile Compliance
# Show detailed information in report [$true]: 
# Show compliant servers [$false]: 
WARNING: 
Hosts with Upcoming Certificate Expiration
# How many days to warn before cert expiration (Default 60) [60]: 
WARNING: 
Host Multipath Policy
# The Multipath Policy (PSP Plugin) your hosts should be configured to use [VMW_PSP_RR]: 
WARNING: 
Host Power Management Policy
# Which power management policy should your hosts use? For Balanced enter "dynamic" (this is the ESXi default policy), for High Performance enter "static", for Low power enter "low". [dynamic]: 
WARNING: 
Datastore Information
# Set the warning threshold for Datastore % Free Space [15]: 
# Do not report on any Datastores that are defined here (Datastore Free Space Plugin) [local]: 
WARNING: 
Number of VMs per Datastore
# Max number of VMs per Datastore [5]: 
# Exclude these datastores from report [ExcludeMe]: 
WARNING: 
Datastore OverAllocation
# Datastore OverAllocation % [50]: 
# Exclude these datastores from report []: 
WARNING: 
Datastores with Storage IO Control Disabled
# Do not report on any Datastores that are defined here (Storage IO Control disabled Plugin) [local]: 
WARNING: 
sDRS VM Behavior not Default
# Exclude these VMs from report []: 
WARNING: 
VSAN Datastore Capacity
# Set the warning threshold for VSAN Datastore % Free Space [15]: 
WARNING: 
VSAN Configuration Maximum Disk Group Per Host Report
# Percentage threshold to warn? [80]: 
WARNING: 
VSAN Configuration Maximum Magnetic Disks Per Disk Group Report
# Percentage threshold to warn? [50]: 
WARNING: 
VSAN Configuration Maximum Total Magnetic Disks In All Disk Groups Per Host Report
# Percentage threshold to warn? [50]: 
WARNING: 
VSAN Configuration Maximum Components Per Host Report
# Percentage threshold to warn? [50]: 
WARNING: 
VSAN Configuration Maximum Hosts Per VSAN Cluster Report
# Percentage threshold to warn? [45]: 
WARNING: 
VSAN Configuration Maximum VMs Per Host Report
# Percentage threshold to warn? [50]: 
WARNING: 
VSAN Configuration Maximum VMs Per VSAN Cluster Report
# Percentage threshold to warn? [50]: 
WARNING: 
Checking Standard vSwitch Ports Free
# vSwitch Port Left [5]: 
WARNING: 
Checking Distributed vSwitch Port Groups for Ports Free
# Distributed vSwitch PortGroup Ports Left [10]: 
WARNING: 
vSwitch Security
# Warn for AllowPromiscuous enabled? [$true]: 
# Warn for ForgedTransmits enabled? [$true]: 
# Warn for MacChanges enabled? [$true]: 
WARNING: 
Snapshot Information
# Set the warning threshold for snapshots in days old [14]: 
# Set snapshot name exception (regex) [ExcludeMe]: 
# Set snapshot description exception (regex) [ExcludeMe]: 
# Set snapshot creator exception (regex) [ExcludeMe]: 
WARNING: 
Map disk region event
    # Set the number of days to show Map disk region event for [5]: 
WARNING: 
Created or cloned VMs
# Set the number of days to show VMs created for [5]: 
WARNING: 
Removed VMs
# Set the number of days to show VMs removed for [5]: 
WARNING: 
VMs with over CPU Count
# Define the maximum amount of vCPUs your VMs are allowed [2]: 
WARNING: 
VMs restarted due to Guest OS Error
# HA VM reset day(s) number due to Guest OS error [5]: 
WARNING: 
Guests with less than X MB free
# VM Disk space left, set the amount you would like to report on MBFree [1024]: 
# VM Disk space left, set the amount you would like to report on MBDiskMinSize [1024]: 
WARNING: 
Checking VM Hardware Version
# Hardware Version to check for at least [8]: 
# Adding filter for dsvas, vShield appliances or any other vms that will remain on a lower HW version [vShield*|dsva*]: 
WARNING: 
VMs in inconsistent folders
# Specify which Datastore(s) to filter from report [local]: 
WARNING: 
No VM Tools
# Do not report on any VMs who are defined here (regex) []: 
WARNING: 
VM Tools Issues
# VM Tools Issues, do not report on any VMs who are defined here []: 
WARNING: 
Removable Media Connected
# VMs with removable media not to report on []: 
WARNING: 
Single Storage VMs
# Local Stored VMs, do not report on any VMs who are defined here [Template_*|VDI*]: 
# Local Datastores, do not report on any VMs within these datastores [Local|datastore1]: 
WARNING: 
VM CPU %RDY
# CPU ready on VMs should not exceed [10.0]: 
WARNING: 
VM CPU Usage
# VM Not to go over the following amount of CPU [75]: 
# VM CPU not allowed to go over the previous amount for how many days? [1]: 
WARNING: 
Backup Garbage
# Names used in backup product snapshots. Defaults include VCB, Veeam, NetBackup, and Commvault [VCB|Consolidate|veeam|NBU_SNAPSHOT|GX_BACKUP]: 
WARNING: 
Find VMs with thick or thin provisioned vmdk
# Report on disk formats that are not "thin" or "thick", which format is not allowed? [thick]: 
# Specify Datastores to filter from report [local]: 
WARNING: 
Virtual machines with incorrect OS configuration
# VMs with incorrect OS Configuration, do not report on any VMs who are defined here [VM1_*|VM2_*]: 
WARNING: 
Virtual machines with less hard disks than partitions
# Do not report on any VMs who are defined here (regex) [VM1_*|VM2_*]: 
WARNING: 
Powered Off VMs
# VMs not to report on [Windows7*]: 
#VmPathName not to report on [-backup-]: 
# Report VMs powered off over this many days [7]: 
WARNING: 
Unwanted virtual hardware found
# Find unwanted virtual hardware [VirtualUSBController|VirtualParallelPort|VirtualSerialPort]: 
WARNING: 
Mis-named virtual machines
# Misnamed VMs, do not report on any VMs who are defined here [VM1_*|VM2_*]: 
WARNING: 
VM Network State
# Only show NICs that are set to Connect at Startup [$true]: 
WARNING: 
Reset VMs
# Set the number of days to show reset VMs [1]: 
WARNING: 
Snapshot activity
# Set the number of days to show Snapshots for [5]: 
# User exception for Snapshot removed [s-veeam]: 
WARNING: 
VMs with CPU or Memory Reservations Configured
# Do not report on any VMs who are defined here []: 
WARNING: 
VM Logging
# The number of logs to keep for each VM [10]: 
# The size logs can reach before rotating to a new log (bytes) [1000000]: 
WARNING: 
VM Tools Not Up to Date
# Do not report on any VMs who are defined here (regex) []: 
# Maximum number of VMs shown [30]: 
WARNING: 
NonPersistent Disks
# Exclude all virtual machines from report [^DV-|^MLB-]: 
WARNING: 
VMs Memory/CPU Hot Add configuration
# Should CPU hot plug be enabled [$true]: 
# Should Memory hot add be enabled [$true]: 
WARNING: 
VM - Display all VMs with CBT unexpected status
# Should CBT be enabled (true/false) [$false]: 
WARNING: 
Site Recovery Manager - RPO Violation Report
# SRM RPO Violations: Set the number of minutes an RPO has exceeded to report on [240]: 
# SRM RPO Violations: Only look for RPO events on VMs with these names: (regex) []: 
# SRM RPO Violations: Report on unresolved RPO violations only? [$true]: 
Specify Credential
Please specify server credential
User: 
User: 
User: 
User: administrator@vsphere.local
Password for user administrator@vsphere.local: ********

After setting up the initial configuration we can start running the main script of the tool using the <vCheck.ps1 -Outputpath> command. The “Outputpath” option allows us to set where the report will be saved. When you run the command it will ask you for the vCenter login credentials. In my case I used the default administrator account but it is recommended to use an account with read-only privileges.

PS /home/blabla/vCheck> ./vCheck.ps1 -Outputpath vcheck-reports/                                   

Specify Credential
Please specify server credential
User: administrator@vsphere.local #vCenter credentials
Password for user administrator@vsphere.local: ********

In this area I show you the example of the vCheck collection process. To see the result of the process, just click on the “+” icon.

vCheck Report Processing

Begin Plugin Processing                                                                                                                                                                                                                                                                             [21:54:30] ..start calculating Connection settings for vCenter by Alan Renouf v1.20 [1 of 116]                                                                                                                                                                                                      [21:54:52] ..finished calculating Connection settings for vCenter by Alan Renouf v1.20 [1 of 116]                                                                                                                                                                                                   [21:54:52] ..start calculating General Information by Alan Renouf, Frederic Martin v1.3 [2 of 116]                                                                                                                                                                                                  [21:55:04] ..finished calculating General Information by Alan Renouf, Frederic Martin v1.3 [2 of 116]                                                                                                                                                                                               [21:55:04] ..start calculating Checking VI Events by Alan Renouf v1.2 [3 of 116]                                                                                                                                                                                                                    [21:55:05] ..finished calculating Checking VI Events by Alan Renouf v1.2 [3 of 116]                                                                                                                                                                                                                 [21:55:05] ..start calculating VC Services by Alan Renouf v1.1 [4 of 116]                                                                                                                                                                                                                           [21:55:05] ..finished calculating VC Services by Alan Renouf v1.1 [4 of 116]                                                                                                                                                                                                                        [21:55:05] ..start calculating Windows vCenter Error Event Logs by Alan Renouf v1.2 [5 of 116]                                                                                                                                                                                                      [21:55:05] ..finished calculating Windows vCenter Error Event Logs by Alan Renouf v1.2 [5 of 116]                                                                                                                                                                                                   [21:55:05] ..start calculating Windows vCenter Error Event Logs by Alan Renouf v1.2 [6 of 116]                                                                                                                                                                                                      [21:55:05] ..finished calculating Windows vCenter Error Event Logs by Alan Renouf v1.2 [6 of 116]                                                                                                                                                                                                   [21:55:05] ..start calculating Windows vCenter Warning Event Logs by Alan Renouf v1.2 [7 of 116]                                                                                                                                                                                                    [21:55:05] ..finished calculating Windows vCenter Warning Event Logs by Alan Renouf v1.2 [7 of 116]                                                                                                                                                                                                 [21:55:05] ..start calculating vCenter Sessions Age by Rudolf Kleijwegt v1.2 [8 of 116]                                                                                                                                                                                                             [21:55:05] ..finished calculating vCenter Sessions Age by Rudolf Kleijwegt v1.2 [8 of 116]                                                                                                                                                                                                          [21:55:05] ..start calculating vCenter License Report by Justin Mercier, Bill Wall v1.2 [9 of 116]                                                                                                                                                                                                  [21:55:05] ..finished calculating vCenter License Report by Justin Mercier, Bill Wall v1.2 [9 of 116]                                                                                                                                                                                               [21:55:05] ..start calculating HA configuration issues by John Sneddon v1.1 [10 of 116]                                                                                                                                                                                                             [21:55:06] ..finished calculating HA configuration issues by John Sneddon v1.1 [10 of 116]                                                                                                                                                                                                          [21:55:06] ..start calculating HA VMs restarted by Alan Renouf v1.3 [11 of 116]                                                                                                                                                                                                                     [21:55:06] ..finished calculating HA VMs restarted by Alan Renouf v1.3 [11 of 116]                                                                                                                                                                                                                  [21:55:06] ..start calculating DRS & SDRS Migrations by Alan Renouf, Jonathan Medd v1.3 [12 of 116]                                                                                                                                                                                                 [21:55:06] ..finished calculating DRS & SDRS Migrations by Alan Renouf, Jonathan Medd v1.3 [12 of 116]                                                                                                                                                                                              [21:55:06] ..start calculating Cluster Slot Sizes by Alan Renouf v1.2 [13 of 116]                                                                                                                                                                                                                   [21:55:06] ..finished calculating Cluster Slot Sizes by Alan Renouf v1.2 [13 of 116]                                                                                                                                                                                                                [21:55:06] ..start calculating Cluster Configuration Issues by Alan Renouf v1.1 [14 of 116]                                                                                                                                                                                                         [21:55:06] ..finished calculating Cluster Configuration Issues by Alan Renouf v1.1 [14 of 116]                                                                                                                                                                                                      [21:55:06] ..start calculating Datastore Consistency by Robert Sexstone v1.6 [15 of 116]                                                                                                                                                                                                            [21:55:07] ..finished calculating Datastore Consistency by Robert Sexstone v1.6 [15 of 116]                                                                                                                                                                                                         [21:55:07] ..start calculating Clusters with DRS disabled by Robert van den Nieuwendijk v1.3 [16 of 116]                                                                                                                                                                                            [21:55:07] ..finished calculating Clusters with DRS disabled by Robert van den Nieuwendijk v1.3 [16 of 116]                                                                                                                                                                                         [21:55:07] ..start calculating Cluster Node version by Raphael Schitz, Frederic Martin v1.1 [17 of 116]                                                                                                                                                                                             [21:55:07] ..finished calculating Cluster Node version by Raphael Schitz, Frederic Martin v1.1 [17 of 116]                                                                                                                                                                                          [21:55:07] ..start calculating QuickStats Capacity Planning by Raphael Schitz, Frederic Martin v1.7 [18 of 116]                                                                                                                                                                                     [21:55:07] ..finished calculating QuickStats Capacity Planning by Raphael Schitz, Frederic Martin v1.7 [18 of 116]                                                                                                                                                                                  [21:55:07] ..start calculating s/vMotion Information by Alan Renouf v1.2 [19 of 116]                                                                                                                                                                                                                [21:55:08] ..finished calculating s/vMotion Information by Alan Renouf v1.2 [19 of 116]                                                                                                                                                                                                             [21:55:08] ..start calculating More RAM than free space on Datastore by Olivier TABUT, Bob Cote v1.2 [20 of 116]                                                                                                                                                                                    [21:55:08] ..finished calculating More RAM than free space on Datastore by Olivier TABUT, Bob Cote v1.2 [20 of 116]                                                                                                                                                                                 [21:55:08] ..start calculating DRS Rules by John Sneddon v1.2 [21 of 116]                                                                                                                                                                                                                           WARNING: Retrieving VM group to VMHost group DRS rules with Get-DrsRule is obsolete. Use Get-DrsVMHostRule cmdlet instead                                                                                                                                                                           [21:55:08] ..finished calculating DRS Rules by John Sneddon v1.2 [21 of 116]                                                                                                                                                                                                                        [21:55:08] ..start calculating Clusters Without Host Profile attached by John Sneddon v1.0 [22 of 116]                                                                                                                                                                                              [21:55:08] ..finished calculating Clusters Without Host Profile attached by John Sneddon v1.0 [22 of 116]                                                                                                                                                                                           [21:55:08] ..start calculating Hosts Overcommit state by Alan Renouf v1.4 [23 of 116]                                                                                                                                                                                                               [21:55:09] ..finished calculating Hosts Overcommit state by Alan Renouf v1.4 [23 of 116]                                                                                                                                                                                                            [21:55:09] ..start calculating Hosts Dead LUN Path by Alan Renouf, Frederic Martin v1.2 [24 of 116]                                                                                                                                                                                                 [21:55:09] ..finished calculating Hosts Dead LUN Path by Alan Renouf, Frederic Martin v1.2 [24 of 116]                                                                                                                                                                                              [21:55:09] ..start calculating Host Swapfile datastores by Alan Renouf v1.2 [25 of 116]                                                                                                                                                                                                             [21:55:09] ..finished calculating Host Swapfile datastores by Alan Renouf v1.2 [25 of 116]                                                                                                                                                                                                          [21:55:09] ..start calculating ESXi with Technical Support mode or ESXi Shell enabled by Alan Renouf v1.3 [26 of 116]                                                                                                                                                                               [21:55:09] ..finished calculating ESXi with Technical Support mode or ESXi Shell enabled by Alan Renouf v1.3 [26 of 116]                                                                                                                                                                            [21:55:09] ..start calculating ESXi hosts which do not have Lockdown mode enabled by Alan Renouf v1.1 [27 of 116]                                                                                                                                                                                   [21:55:09] ..finished calculating ESXi hosts which do not have Lockdown mode enabled by Alan Renouf v1.1 [27 of 116]                                                                                                                                                                                [21:55:09] ..start calculating Active Directory Authentication by Bill Wall, Dan Barr v1.2 [28 of 116]                                                                                                                                                                                              [21:55:10] ..finished calculating Active Directory Authentication by Bill Wall, Dan Barr v1.2 [28 of 116]                                                                                                                                                                                           [21:55:10] ..start calculating NTP Name and Service by Alan Renouf, Dan Barr v1.3 [29 of 116]                                                                                                                                                                                                       [21:55:10] ..finished calculating NTP Name and Service by Alan Renouf, Dan Barr v1.3 [29 of 116]                                                                                                                                                                                                    [21:55:10] ..start calculating Host Configuration Issues by Alan Renouf, Dan Barr v1.2 [30 of 116]                                                                                                                                                                                                  [21:55:10] ..finished calculating Host Configuration Issues by Alan Renouf, Dan Barr v1.2 [30 of 116]                                                                                                                                                                                               [21:55:10] ..start calculating Host Alarms by Alan Renouf, John Sneddon v1.3 [31 of 116]
[22:33:17] ..Displaying HTML results

Once the command finishes, an< .html> file will be created with the result of the report. vCheck has the feature of being able to schedule the report to be sent by e-mail on a recurring basis.. So, you can have a weekly report of how is the health of your virtual infrastructure.

Here are several examples of report generated with vCheck

I hope you liked this tool. If you have any questions or comments about this post, leave them in comments. Regards.

HomeLab – Automated VMware Infrastructure Documentation

In this blog I will be talking about how to automate the creation of documentation reports of our virtual infrastructure. There are several commercial solutions to generate this type of report but I will be talking about “As Built Report” a free tool that uses powershell as a base to build the reports.

The “As Built Report” tool uses the VMware.PowerCLI modules that we explained previously in our blog. If you want to know more about PowerCLI follow this link here. An important fact about “As Built Report” is that it is not only used to generate reports on VMware but also supports the following products:

  • VMware vSphere, NSX & SRM
  • Cisco UCS Manager
  • Nutanix Prism Element
  • Pure Storage FlashArray
  • Rubrik
  • Zerto
  • Dell/EMC VxRail
  • Cohesity DataPlatform
  • etc…

First of all to use this tool we need to validate the requirements that in general consist of the following:

  • Windows PowerShell 5.1 o later
  • VMware.PowerCLI

To install the “As Built Report” powershell module use the command <Install-Module> followed by the module name AsBuiltReport.

PS /home/blabla> Install-Module -Name AsBuiltReport

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
PS /home/blabla>   

An optional requirement is to build a configuration file that allows you to set the organization parameters that are used to generate the report. This process generates a JSON file which is used as a template so that you do not have to fill in repetitive information when generating reports. To view the configuration procedure, simply click on the “+” icon.

AsBuiltReport JSON Configuration File

The powershell cmdlet New-AsBuiltConfig allows you to generate a template that will be used as the basis of the report. This template sets the non-technical parameters of the report.

PS C:\WINDOWS\system32> New-AsBuiltConfig

---------------------------------------------
 <        As Built Report Information      >
---------------------------------------------
Enter the name of the Author for this As Built Report [jocolon]: Jonathan Colon
---------------------------------------------
 <           Company Information           >
---------------------------------------------
Would you like to enter Company information for the As Built Report? (y/n): y
Enter the Full Company Name: Zen PR Solutions
Enter the Company Short Name: ZENPR
Enter the Company Contact: Jonathan Colon
Enter the Company Email Address: jcolonf@zenprsolutions.com
Enter the Company Phone: XXX-XXX-XXXX
Enter the Company Address: Puerto Rico
---------------------------------------------
 <            Email Configuration          >
---------------------------------------------
Would you like to enter SMTP configuration? (y/n): n
----------------------------------------------
 <       As Built Report Configuration      >
----------------------------------------------
Would you like to save the As Built Report configuration file? (y/n): y
Enter a name for the As Built Report configuration file [AsBuiltReport]: HomeLab VMware Report
Enter the path to save the As Built Report configuration file [C:\Users\jocolon\AsBuiltReport]:

Name                           Value
----                           -----
Email                          {Port, Credentials, Server, To...}
Company                        {FullName, Contact, Phone, Email...}
UserFolder                     {Path}
Report                         {Author}


PS C:\WINDOWS\system32>

Once the process is completed, a JSON file will be created with the following content:

{
    "Email":  {
                  "Port":  null,
                  "Credentials":  null,
                  "Server":  null,
                  "To":  null,
                  "From":  null,
                  "UseSSL":  null,
                  "Body":  null
              },
    "Company":  {
                    "FullName":  "Zen PR Solutions",
                    "Contact":  "Jonathan Colon",
                    "Phone":  "787-203-2790",
                    "Email":  "jcolonf@zenprsolutions.com",
                    "ShortName":  "ZENPR",
                    "Address":  "Puerto Rico"
                },
    "UserFolder":  {
                       "Path":  "C:\\Users\\jocolon\\AsBuiltReport"
                   },
    "Report":  {
                   "Author":  "Jonathan Colon"
               }
}

The New-AsBuiltReportConfig command allows you to set the technical parameters of the report such as the verbose level and type of information collected.

PS C:\WINDOWS\system32> New-AsBuiltReportConfig VMware.vSphere -FolderPath C:\Users\jocolon\AsBuiltReport\ -Filename ReportConfig

Once the process is completed, a JSON file will be created with the following content:

{
    "Report": {
        "Name": "VMware vSphere As Built Report",
        "Version": "1.0",
        "Status": "Released"
    },
    "Options": {
        "ShowLicenseKeys": false,
        "ShowVMSnapshots": true
    },
    "InfoLevel": {
        "_comment_": "0 = Disabled, 1 = Summary, 2 = Informative, 3 = Detailed, 4 = Adv Detailed, 5 = Comprehensive",
        "vCenter": 3,
        "Cluster": 3,
        "ResourcePool": 3,
        "VMHost": 3,
        "Network": 3,
        "vSAN": 3,
        "Datastore": 3,
        "DSCluster": 3,
        "VM": 2,
        "VUM": 3
    },
    "HealthCheck": {
        "vCenter": {
            "Mail": true,
            "Licensing": true
        },
        "Cluster": {
            "HAEnabled": true,
            "HAAdmissionControl": true,
            "HostFailureResponse": true,
            "HostMonitoring": true,
            "DatastoreOnPDL": true,
            "DatastoreOnAPD": true,
            "APDTimeOut": true,
            "vmMonitoring": true,
            "DRSEnabled": true,
            "DRSAutomationLevelFullyAuto": true,
            "PredictiveDRS": false,
            "DRSVMHostRules": true,
            "DRSRules": true,
            "vSANEnabled": false,
            "EVCEnabled": true,
            "VUMCompliance": true
        },
        "VMHost": {
            "ConnectionState": true,
            "HyperThreading": true,
            "ScratchLocation": true,
            "IPv6": true,
            "UpTimeDays": true,
            "Licensing": true,
            "SSH": true,
            "ESXiShell": true,
            "NTP": true,
            "StorageAdapter": true,
            "NetworkAdapter": true,
            "LockdownMode": true,
            "VUMCompliance": true
        },
        "vSAN": {},
        "Datastore": {
            "CapacityUtilization": true
        },
        "DSCluster": {
            "CapacityUtilization": true,
            "SDRSAutomationLevelFullyAuto": true
        },
        "VM": {
            "PowerState": true,
            "ConnectionState": true,
            "CpuHotAdd": true,
            "CpuHotRemove": true,
            "MemoryHotAdd": true,
            "ChangeBlockTracking": true,
            "SpbmPolicyCompliance": true,
            "VMToolsStatus": true,
            "VMSnapshots": true
        }
    }
}

Finally, we generate the report using the <New-AsBuiltReport> command with the vCenter information parameters and referencing the JSON file we have created as templates.

PS C:\WINDOWS\system32> New-AsBuiltReport -Report VMware.vSphere -Target vcenter-01v.zenprsolutions.local -Username administrator@vsphere.local -Password XXXXX -Format Word,Text,HTML -OutputFolderPath 'C:\Users\jocolon\OneDrive\Desktop\' -EnableHealthCheck -AsBuiltConfigFilePath 'HomeLab VMware Report.json' -ReportConfigFilePath 'ReportConfig.json'

VMware vSphere As Built Report 'VMware vSphere As Built Report' has been saved to 'C:\Users\jocolon\OneDrive\Desktop\'.
PS C:\WINDOWS\system32>

Once the process of collecting the information from the vCenter is finished, the command saves the report as specified with the <OutputFolderPath> parameter. The following image shows the generated report in the <Word,Text,HTML> format.

Below I show you some images showing the result of the report collected from the vCenter <vcenter-01v>:

Summary

In this lab we learned how easy it is to create documentation about our virtual infrastructure by using freely available tools. “As Built Report” is a robust tool that facilitates the manual process of creating or updating our documentation.

How To Install and Use VMware PowerCLI on ArchLinux

In this blog I will be showing you how to install the PowerCLI tool specifically on the ArchLinux operating system. Archlinux is an advanced Linux distribution that is characterized by being simple and lightweight. Additionally it offers the user full control in managing and modifying everything related to the system.

Well, to install and use PowerCLI we have to install Powershell first. PowerShell is a cross-platform automation and configuration tool. PowerShell has a large number of commands oriented to system administration. But at the same time, PowerShell is a full-featured programming language that allows writing functional programs. There are many Powershell-based administration tools from different manufacturers such as:

  • VMware PowerCLI
  • Cisco UCS PowerTool
  • NetApp PowerShell Toolkit
  • DELL\EMC Unity-Powershell 
  • Amazon AWS Tools for PowerShell

As you can see Powershell is a tool highly used by infrastructure manufacturers and is offered as a method for automation or rapid deployment of software-based infrastructure. Powershell is my second preferred programming language with Python at the top of my list.

The first thing we have to do is to install Powershell and for this I will use the program “yay” which is a tool in Archlinux to install programs from the unofficial repository “Arch User Repository”. With the command <yay -S powershell-bin> we can install the Powershell program to the system. To see the installation procedure, just click on the “+” icon.

yay -S powershell-bin

[rebelinux@blabla ~]$ yay -S powershell-bin
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  powershell-bin-7.1.3-1

:: Downloaded PKGBUILD (1/1): powershell-bin
  1 powershell-bin                           (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: powershell-bin
==> Making package: powershell-bin 7.1.3-1 (Sat 05 Jun 2021 08:08:03 PM AST)
==> Retrieving sources...
  -> Downloading powershell_7.1.3-1.ubuntu.18.04_amd64.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   647  100   647    0     0   1473      0 --:--:-- --:--:-- --:--:--  1473
100 65.1M  100 65.1M    0     0  1182k      0  0:00:56  0:00:56 --:--:-- 1201k
==> Validating source files with sha256sums...
    powershell_7.1.3-1.ubuntu.18.04_amd64.deb ... Passed
==> Making package: powershell-bin 7.1.3-1 (Sat 05 Jun 2021 08:09:00 PM AST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found powershell_7.1.3-1.ubuntu.18.04_amd64.deb
==> Validating source files with sha256sums...
    powershell_7.1.3-1.ubuntu.18.04_amd64.deb ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting powershell_7.1.3-1.ubuntu.18.04_amd64.deb with bsdtar
==> Sources are ready.
==> Making package: powershell-bin 7.1.3-1 (Sat 05 Jun 2021 08:09:01 PM AST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "powershell-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: powershell-bin 7.1.3-1 (Sat 05 Jun 2021 08:09:05 PM AST)
==> Cleaning up...
[sudo] password for rebelinux: 
loading packages...
warning: powershell-bin-7.1.3-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) powershell-bin-7.1.3-1

Total Installed Size:  170.21 MiB
Net Upgrade Size:        0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                  [########################################################################################] 100%
(1/1) checking package integrity                                                                                                                [########################################################################################] 100%
(1/1) loading package files                                                                                                                     [########################################################################################] 100%
(1/1) checking for file conflicts                                                                                                               [########################################################################################] 100%
(1/1) checking available disk space                                                                                                             [########################################################################################] 100%
:: Processing package changes...
(1/1) reinstalling powershell-bin                                                                                                               [########################################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[rebelinux@blabla ~]$

There is another more advanced installation method that also allows you to install Powershell from the command line. I leave here the required commands. To see the installation procedure, just click on the “+” icon.

Manual installation of Powershell

git clone https://aur.archlinux.org/powershell-bin.git
cd powershell-bin
makepkg -si

To access the Powershell application the <pwsh> command is used to call the interpreter. From the interpreter we can run Powershell commands that are commonly called “Cmdlets”.

[rebelinux@blabla ~]$ pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/rebelinux> 

The next step to run PowerCLI is to install its module by using the <Install-Module -name VMware.PowerCLI> command from the Powershell interpreter.

PS /home/blabla> Install-Module -name VMware.PowerCLI  

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
PS /home/blabla>  

To connect to the vCenter we use the “cmdlet” <Connect-VIServer> specifying the IP address or DNS name of the server.

PS /home/blabla> Connect-VIServer vcenter-01v.zenprsolutions.local -Verbose -Username administrator@vsphere.local -Password XXXXXX

Name                            Port User
----                            ---- ----
vcenter-01v.zenprsolutions.local 443  VSPHERE.LOCAL\Administrator

PS /home/blabla> 

I will use a basic command to do connection testing against vCenter. In this test I will use the <Get-Cluster> command to check the currently created clusters.

PS /home/blabla> Get-Cluster

Name                           HAEnabled  HAFailover DrsEnabled DrsAutomationLevel
                                          Level
----                           ---------  ---------- ---------- ------------------
RegionA01-EDGE                 False      1          True       FullyAutomated
RegionHQ-MGMT                  False      1          True       FullyAutomated
RegionA01-COMP                 True       1          True       FullyAutomated

PS /home/blabla> 

Another basic example is to use the <Get-Datastore> command to validate which datastores currently exist in the virtual DataCenter. In the output of the <Get-Datastore> command you can see the free and used space in the datastores configured in the DataCenter.

PS /home/blabla> Get-Datastore

Name                               FreeSpaceGB      CapacityGB
----                               -----------      ----------
SSD-VM-HIGH-CAPACITY-PERF-KN           173.708         894.000
NVME-VM-HIGH-PERF-01                     0.017         476.750
SSD-VM-HIGH-CAPACITY-PERF-MK           251.536         931.250
HDD-VM-MED-PERF-02                   2,232.268       3,726.000
HDD-VM-MED-PERF-01                   2,509.246       3,726.000
esx-00f                                110.801         111.750
NVME-VFLASH-01                           0.840         238.250
HDD-VM-ISO-LOW-PERF                    606.936         931.250
NFS_SNAP_OFFLOAD                        29.258          50.000
SRM_PlaceHolder                         97.170          99.750
SERVER_DATASTORE                        92.444          99.750

PS /home/blabla> 

Hasta Luego Amigos!