Sunday, August 26, 2012

version, build, release date of Various VMware products like (ESX, ESXi, vCenter Server, etc..)

Release/Build Info of ESX, ESXi, vCenter Server, etc..

v-Sphere land has a great consolidated table - URL below.

Friday, July 13, 2012

Daily Health Reports for vCenter by Alan (

Have you ever thought.. get "Granular Report" of your VC - Full view of VC on HTML report!!
You should visit below..

Report contains below - Damn easy via Power CLI..
  • 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

Virtual CD - becomes "Show Stopper" for Manual / DRS vMotion - How to solve

Virtual CD - becomes "Show Stopper" for Manual / DRS vMotion - How to solve

1) Tool Based Disconnect (As per docs - host wise)
2) Power CLI based Disconnect (By ESX, Cluster, Datacenter) - Single Shot

Method1 - Tool Based
There is a tool by "Eric Sloof" - This Tool Scans all Virtual Machines and shows if they have a CD connected to it. After scanning the VM’s you can disconnect all the CD’s with a click of  a button.

Method2 - Script Based -I like this way - Power of Reach to ESX / Cluster / Data Center

Execute Script on one ESX Host & disconnect Virtual CD for All VM's on ESX
(Get-VM -Location ( Get-VMHost "ESX host name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }

Execute script on Whole cluster:
(Get-VM -Location ( Get-Cluster "Cluster Name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }

Why not by Datacenter:
(Get-VM -Location ( Get-Datacenter "Datacenter Name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }

Monday, June 11, 2012

ESX host Maintenance mode from ESX CLI

1) login to ESX host to execute below.

To enter Maintenance Mode, at the ESX console:
vimsh -n -e /hostsvc/maintenance_mode_enter

To exit Maintenance Mode :
vimsh -n -e /hostsvc/maintenance_mode_exit

To display whether the ESX Server is currently in maintenance mode or not type:
vimsh -n -e"hostsvc/hostsummary" | grep inMaintenanceMode

Using system libcrypto, version 90810F
inMaintenanceMode = false

(False - means "not in maintenance mode" / True - Means "in maintenance mode") 

Failed write command to write-quiesced partition

ESX box may see below errors, due to some storage box side issues.
you may observe mostly on all the ESX hosts of the VC Cluster - kind of below errors.

ALERT: ScsiDeviceIO: 2352: Failed write command to write-quiesced partition naa.50a9800064656c5a4a5a654e35594123:1 
Extract from /var/log/vmkernel - below
/var/log/vmkernel cpu21:4342)NMP: nmp_CompleteCommandForPath: Command 0x2a (0x4102ff3ac040) to  NMP device "naa.50a9800064656c5a4a5a654e35594123" failed on physical path "vmhba1:C0:T1:L1" H:0x8 D:0x0 P:0x0 Possible sense data: 0x0 0x0 0x0.

/var/log/vmkernel cpu21:4342)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:
NMP device "naa.50a9800064656c5a4a5a654e35594123" state in doubt; requested fast path state update...

/var/log/vmkernel cpu21:4342)ScsiDeviceIO: 1672: Command 0x2a to
device "naa.50a9800064656c5a4a5a654e35594123" failed H:0x8 D:0x0 P:0x0 Possible sense data: 0x0 0x0 0x0.

There may be nothing much on ESX side to resolve these errors, Involve your storage vendor to solve this - refer at below VMware KB for more details.

How to identify your DATA STORE name from NAA ID - Example below
# esxcfg-scsidevs -m | grep -i "naa.50a9800064656c5a4a5a654e35594123"

How to identify you LUN ID from Data Store Name
Select ESX at VC - configuration - storage - right click - Properties

Friday, June 8, 2012

Migration / vmotion - of vm fails at 82%
vmotion of vm fails by throwing error -> "Source detected that destination failed to resume"

Scenario 1 (APD - "All Paths Dead issue" on either Source / Target ESX)
APD may be generally caused by improper removal of RDM's
(without removing from VM - remove/unmask at Storage end)

1) grep -i apd /var/log/vmkernel (execute on Source & Target ESX)
2) If you find any APD entries (similar to below) - your "vmkernel/COS OS"
   will busy in negotiating / trying to reheal the Dead paths and causing vMotion failures.

WARNING: NMP: nmp_DeviceAttemptFailover: Retry world failover device "naa.6090a06830772d1a80b95495e700708b"
WARNING: vmw_psp_rr: psp_rrSelectPath: Could not select path for device "naa.6090a06830772d1a80b95495e700708b"
WARNING: NMP: nmp_DeviceAttemptFailover: Retry world failover device "naa.6090a06830772d1a80b95495e700708b"

failed to issue command due to Not found (APD), try again...

Solution - # esxcfg-rescan vmhba1 && esxcfg-rescan vmhba2 (vmhbaX in your case)
Hope - This issue is resolved in ESX/ESXi 4.1 Update 1 & default with ESXi 5.0.
If no go; Unfortunately - only way to Resolve "APD issue" is restart ESX box
As the VM's does not migrate from the APD issue Host - you need downtime for all the VM's

Tip  - Take diligent mesaures while removing LUN's from Storage end (remove from OS/VM properly)

More info -

Scenario 2 (Incorrect h/w version of VM)
/var/log/vmware/hostd.log of "SOURCE ESX" contains below

ResolveCb: Failed with fault: (vmodl.fault.SystemError) {
reason = "Source detected that destination failed to resume."
msg = ""

/var/log/vmware/hostd.log of "TARGET ESX" contains below

Upgrade is required since hwVersion in config file is 3

Solution - right click on VM - upgrade virtual Hardware

Scenario 3 - UUID of NFS data store is different on source and target ESX hosts
# vdf -h (check on source and target ESX host)
if UUID is different (migration fails), generally UUID difference is caused by the way you add host to VC

you may add host by (ip / hostname / hostname.domain / FQDN)
To resolve UUID issues - follow below vmware KB..

Vmtools install failed - on windows - internal error 2318.

Sometimes You may experience a vmtools / vmware-tools installation failed,
It prompts you to uninstall existing first to continue with vmtools upgrade,
and if you try to uninstall existing vmtools - it exits with various reasons
(may happen due to existing vmtools files / registry was corrupted)

Here is the trick for you to uninstall / clean the Registry.

1) Right click on Windows VM / guest at VC - Choose install / upgrade VMware tools
2) Select Manual installation
3) Goto RDP / console of VM - ensure you find virtual CD at MyComputer
4) Find drive letter for your Virtual CD (Ex : D:) -> Go to command prompt ->
     D:\> setup.exe /c (if your OS is 32bit) or setup64.exe /c (if 64 bit OS)
5) Now you try to reinstall the VMware tools - it should proceed to install.

           Vmtools Silent installation method

Windows Guest
When it comes to mass deploy / large scale of VM's (vmware tools update) - it will be cumbersome for you to click on each VM and update VMware tools. Here is the way you can use "Silent install method" via SSH log on script / Power CLI.

To perform a silent, non GUI with suppressed reboot VMware Tools installation in a Windows guest operating system:

Run the command:

setup.exe /S /v /qn REBOOT=R

Note: The installer might indicate if a reboot is necessary by exiting with ERROR_SUCCESS_REBOOT_REQUIRED.

Alternatively, in vCenter Server, right-click on a virtual machine, click Install/Upgrade VMware Tools, and enter /S /v /qn REBOOT=R the Advanced field.

Source - VMware KB --> 1018377