Category: VMware ESXi 6.0

Microsoft Windows PowerShell – Get Host Architecture

You may use the following Microsoft Windows PowerShell script below to get the architecture, physical or virtual, of a Windows host on a network.

<#
.SYNOPSIS
This script will provide the architure (physical of virtual) of a host.
.DESCRIPTION
This script will provide the architure (physical of virtual) of a host.
.EXAMPLE
systeminfo /s $HOSTNAME | findstr /c:”Model:” /c:”Host Name”
.AUTHOR
Written by Noel Enrique Alvarez on Tuesday, April 23, 2019.
#>

#Requst the hostname of the host
$HOSTNAME = Read-Host “What is the hostname of the server?”

#Provide the architure of the host
systeminfo /s $HOSTNAME | findstr /c:”Model:” /c:”Host Name”


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 ESXi 6.0 – Syslog Collector Configuration

VMware ESXi 6.0 hosts save their log files locally by default. However, you may configure the host to save their logs to a centralized server known as the Syslog Collector. Below are the steps to complete the configuration.

  1. Start the SSH service on the VMware ESXi 6.0 host.
  2. Enter the following command to configure the syslog collect on the host esxcli system syslog config set –loghost=x.x.x.x –logdir-unique=true. The –loghost=x.x.x.x value identifies the Syslog Collector server.
  3. Enter the following command to enable the syslog collector configuration esxcli system syslog reload.
  4. Stop the SSH service on the VMware ESXi 6.0 host.
  5. Configure the firewall to allow the outgoing traffic.
  6. After the host is added to vCenter server verify the logs are located in the following directory on the Syslog Collector server C:\ProgramData\VMware\vCenterServer\data\vmsyslogcollector.

VMware ESXi 6.0 – Dump Collector Testing

The VMware ESXi Dump Collector is a centralized service that can receive and store memory dumps from VMware ESXi 6.0 hosts in the event that they crash unexpectedly. In order to use this feature you must first configure the VMware ESXi Dump Collector Service. Then, you must configure the VMware ESXi 6.0 host to redirect their memory dumps. After the VMware ESXi 6.0 host has been configured to redirect their memory dumps you may use the commands below to verify test the configuration.

  1. Start the SSH service on the VMware ESXi 6.0 host.
  2. Enter the following command  to send a test dump to the collector esxcli system coredump network check.
  3. On the dump collector server, in the %ProgramData%\VMware\VMware ESXi dump collector\Data\ folder, verify that a new dump file is present (i.e. IP address of the VMware ESXi 6.0 host).
  4. Stop the SSH service on the VMware ESXi 6.0 host.

VMware ESXi 6.0 – Dump Collector Configuration

The VMware ESXi Dump Collector is a centralized service that can receive and store memory dumps from VMware ESXi 6.0 hosts in the event that they crash unexpectedly. In order to use this feature you must first configure the VMware ESXi Dump Collector Service on VMware vCenter Server. Then, you use the commands below to configure the VMware ESXi 6.0 host to redirect their memory dumps.

  1. Start the SSH service on the VMware ESXi 6.0 host.
  2. To review the existing  dump collector configuration enter the command esxcli system coredump network get and press Enter.
  3. Configure the VMware ESXi 6.0 host’s dump redirection with the following command esxcli system coredump network set -v vmk0 -i x.x.x.x -o xxxx. The -i option is used to specify the IP address of the dump collector and the -o option is used to indicate the dump collector port number.
  4. Enter the following command to turn on dump redirection esxcli system coredump network set -e true.
  5. Enter the following command to confirm the dump redirection settings esxcli system coredump network get.
  6. Stop the SSH service on the VMware ESXi 6.0 host.

VMware vCenter Server 6.0 – Adding a Host to VMware vCenter Server cluster as a Scheduled Task

The following is a step by step guide for adding a VMware ESXi 6.0 host to a VMware vCenter Server cluster as a scheduled task.

  1. On the home screen of the VMware vSphere Web Client select Host and Clusters.01
  2. Select a cluster, then navigate to the Manage tab and select Scheduled Tasks.02
  3. Select Schedule a New Task and click Add Host….03
  4. On the Name and location portion of the Add Host (scheduled) dialog box enter the hostname or Internet Protocol (IP) address of the VMware ESXi 6.0 host then click Next.04
  5. On the Connection settings page enter the root authentication credentials and click Next.05
  6. On the Security Alert dialog box click Yes.06
  7. On the Host summary page review the configuration of the VMware ESXi 6.0 host and click Next.07
  8. On the Assign license page review the licensing information for the VMware ESXi 6.0 host and click Next.08
  9. On the Lockdown mode page accept the default settings and click Next.09
  10. On the Scheduling options page enter a Task name and Task description.10
  11. On the Scheduling options page click Change.
  12. On the Configure Scheduler dialog box enter a time to add the VMware ESXi 6.0 host to the cluster then click OK.12
  13. On the Scheduling options page click Next.13
  14. On the Ready to complete page click Finish.14
  15. In the Recent Tasks pane verify a the Create scheduled task task completed successfully.15

VMware vCenter Server 6.0 – Creating a Host Profile

The following is a step by step guide for a creating a VMware ESXi 6.0 host profile.

  1. On the home screen of the VMware vSphere Web Client select Policies and Profiles.01
  2. On the Policies and Profiles interface select Host Profiles.02
  3. On the Host Profiles interface click the green plus sign to Extract profile from a host.03
  4. On the Extract Host Profile dialog box select a vCenter Server and VMware ESXi host then click Next.04
  5. On the Extract Host Profile dialog box enter a Name for the host profile then click Next.05
  6. On the Extract Host Profile dialog box click Finish.06
  7. In the Recent Tasks pane verify a Create a host profile task completed completed successfully.07
  8. On the Host Profiles interface verify the host profile has been created.08