Category: VMware vCenter Server 6.0

VMware PowerCLI – Power On a Virtual Machine

You may use the VMware PowerCLI cmdlet below to power on a VMware virtual machine.

Start-VM -VM SERVER


VMware PowerCLI – Create a Snapshot

You may use the following VMware PowerCLI cmdlet to create a snapshot of a virtual machine (VM) in VMware.

New-Snapshot -VM HOSTNAME -Name “<<>>” -Description “<<>>”


VMware PowerCLI – Exit VMware ESXi Host out of Maintenance Mode

You may use the following VMware PowerCLI script to exit a VMware ESXi host out of maintenance mode.

<# .SYNOPSIS This script will exit a VMware ESXi host out of maintenance mode. .DESCRIPTION This script will exit a VMware ESXi host out of maintenance mode. .EXAMPLE Set-VMHost -VMhost HOST.DOMAIN.COM -State Connected. .AUTHOR Written by Noel Enrique Alvarez on Monday, April 15, 2019. #>

#Request the hostname of the VMware ESXi host
$HOSTNAME = Read-Host “What is the hostname of the VMware ESXi host?”

#Exit the VMware ESXi host out of maintenance mode
Set-VMHost -VMhost $HOSTNAME -State Connected

#End of script


VMware PowerCLI – Place VMware ESXi Host in Maintenance Mode

You may use the following VMware PowerCLI script to place a VMware ESXi host in maintenance mode.

<# .SYNOPSIS This script will place a VMware ESXi host in maintenance mode. .DESCRIPTION This script will place a VMware ESXi host in maintenance mode. .EXAMPLE Set-VMHost -VMhost HOST.DOMAIN.COM -State Maintenance. .AUTHOR Written by Noel Enrique Alvarez on Monday, April 15, 2019. #>

#Request the hostname of the VMware ESXi host
$HOSTNAME = Read-Host “What is the hostname of the VMware ESXi host?”

#Place the VMware ESXi host in maintenance mode
Set-VMHost -VMhost $HOSTNAME -State Maintenance

#End of script


VMware PowerCLI – View Snapshots

You may use the following VMware PowerCLI cmdlets to view all of the snapshots managed by vCenter Server or more specifically a cluster. These are sample commands and further information and documentation may be found here.

Get-VM | Get-Snapshot | Format-List
Get-VM | Get-Snapshot | Format-List VM, Name, SizeGB, Created, Description
Get-VM -Location “CLUSTER01” | Get-Snapshot | Format-List
Get-VM -Location “CLUSTER01”| Get-Snapshot | Format-List VM, Name, SizeGB, Created, Description


VMware vCenter Server 6.0 – Verify the Status of Critical Services Locally

The script below will query the status of the service(s) specified in “C:\Scripts\VMware vCenter Server\Verify_Critical_Services.txt” on the local server. The output of the script will provide the name and status of the service(s) in a formatted list for your viewing. Additionally, it is recommended that the following services be queried as they are critical to the proper functioning of VMware vCenter Server 6.

  • VMware VirtualCenter Server (vpxd)
  • VMware Inventory Service (invsvc)
  • VMware vSphere Web Client (vspherewebclientsvc)

<#
.SYNOPSIS
This script will provide the name and status of the service(s) defined in “C:\Scripts\VMware vCenter Server\Verify_Critical_Services.txt”
.DESCRIPTION
This script will automate the process of providing the status of critical VMware vCenter Server 6 service(s) on the local server
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Wednesday, November 22, 2017.
#>

#Define the service(s) to query
$Services = Get-Content “C:\Scripts\VMware vCenter Server\Verify_Critical_Services.txt”

#Query the status of the service(s) in “C:\Scripts\VMware vCenter Server\Verify_Critical_Services.txt”
ForEach ($Service in $Services)
{Get-Service $Service |
Format-List -Property Name, Status}


VMware vSphere 6 – Create a Template

VMware includes a great solution, templates, for consistent virtual machine deployments. A template is essentially a master image of a virtual machine that typically includes a guest operating system and applications. Using templates allows you to deploy virtual machines with a consistent configuration. Additionally, below is a step list of steps for creating a template.

  • Install the Microsoft Windows 2012 R2 operating system
  • Install VMware Tools
  • Install Windows Updates
  • Run sysprep (C:\Windows\System32\Sysprep\sysprep.exe)
    • System Cleanup Action: Enter System Out-of-Box Experience (OOBE)
    • Generalize
    • Shutdown Options: Shutdown
  • Right click the virtual machine and select Convert to Template….

 


VMware vSphere Update Manager 6.0 – Remediating a VMware ESXi 6.0 Host

The following is a step by step guide for remediating (i.e. patching) a VMware ESXi 6.0 host.

  1. On the home page of the VMware vSphere Client select Hosts and Clusters.01
  2. Select a VMware ESXi 6.0 host from the inventory tree on the left.02
  3. Select the Update Manager tab on the VMware vSphere Client.03
  4. Click Remidiate… in the lower right portion of the Update Manager tab.
  5. On the Remediation Selection dialog box select the baselines or baseline groups to apply and click Next >.05
  6. On the Patches and Extensions dialog box deselect any patches you would like to exclude then click Next >.05
  7. On the Schedule dialog box enter a Task Name:, Task Description: and Remediation Time: then click Next >.07
  8. On the Host Remediation Options dialog box accept the default settings and click Next >.08
  9. On the Ready to Complete dialog box review the configuration settings and click Finish.09
  10. Review the Recent Tasks pane to verify the host was remediated.10
  11. Verify the host is compliant on the Update Manager tab.11

VMware vSphere Update Manager 6.0 – Staging Patches

The following is a step by step guide for staging patches to VMware ESXi 6.0 hosts. This is a useful feature if your VMware ESXi 6.0 hosts are located across lethargic wide area network (WAN) links.

  1. On the VMware vSphere Client home page select Hosts and Clusters.01
  2. From the inventory list select a VMware ESXi 6.0 host.02
  3. On the content area of the VMware vSphere Client select the Update Manager tab.03
  4. On the Update Manager tab content area click Stage….
  5. On the Baseline Selection dialog box select the baselines for the patches to be staged and click Next >.04
  6. On the Patch and Extension Exclusion dialog box deselect any patches or extension you would not like to be staged and click Next >.06
  7. On the Ready to Complete dialog box click Finish to being staging the patches.07
  8. View the Recent Tasks pane to verify the patches have been staged.08

VMware vSphere Update Manager 6.0 – Scanning a VMware ESXi 6.0 Host

The follow is a step by step guide for performing a VMware vSphere Update Manager 6.0 scan on a VMware ESXi 6.0 host.

  1. On the home page of the VMware vSphere Web Client select the Hosts and Clusters view.01
  2. On the inventory tree select the VMware ESXi 6.0 host you would like to scan.02
  3. On the content area of the VMware vSphere Web Client select the Monitor tab then select Update Manager.03
  4. On the content area of the Update Manager section click Scan….
  5. On the Confirm Scan dialog box select both check boxes and click OK.05
  6. On the Recent Tasks pane verify that a Scan entity task completed.06
  7. Review the Update Manager tab to verify if the VMware ESXi 6.0 host is compliant or non-compliant with the attached baseline.07