A. Mikkelsen

VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Browsing Posts in Troubleshooting

If you need a good guide to Interpreting the statistic from ESXTOP then take a look at this guide from VMware.

http://communities.vmware.com/docs/DOC-9279

I’m using it to troubleshoot performance issues (poor response times) from clients in different locations, when using the remote console.

Restarting the Management agents on ESX Server 3.x

  1. Login to the ESX host using SSH (or from COS)
  2. Type service mgmt-vmware restart.
    CAUTION
    Before restarting the Management Agent make sure that Automatic Startup/Shutdown is Disabled
    For more info see
    Restarting hostd (mgmt-vmware) on ESX Server Hosts Restarts Hosted Virtual Machines Where Virtual Machine Startup/Shutdown is Enabled (1003312)
  3. Type service vmware-vpxa restart.
  4. Exit the SSH session or logout of COS

Just found this very interesting article http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013109 describing a problem with Windows 2008 and ESX 4 virtual hardware version 7.

In short the article states that you might have the disks go offline in a Windows 2008 VM if you

  • Upgrade virtual hardware from version 4 to 7
  • Installing a new VM with virtual hardware 7

There is two ways to get around this (taken from the VMware KB 103109)

————————

This can be resolved by changing the SAN Automount Policy on the system. See the Microsoft article http://support.microsoft.com/kb/973834 to change the SAN Policy to online.
The SAN policy is defined within the VDS environment of the system and is represented by the following values:
  • VDS_SP_UNKNOWN = 0×0
  • VDS_SP_ONLINE = 0×1
  • VDS_SP_OFFLINE_SHARED = 0×2
  • VDS_SP_OFFLINE = 0×3
On Windows Server 2008 Enterprise and Windows Server 2008 Datacenter, the default SAN policy is VDS_SP_OFFLINE_SHARED. On all other Windows Server 2008 editions, the default SAN policy is VDS_SP_ONLINE.
To query current SAN policy from the command line, start DISKPART and issue a SAN command:
C:\>DISKPART.EXE
DISKPART> san
SAN Policy : Offline Shared

DISKPART> exit

Alternatively, you can set the disk to Online after the hardware version upgrade.
To set the disk to Online:
  1. Log in to your system as an Administrator.
  2. Click Computer Management > Storage > Disk Management.
  3. Right-click the disk and choose Online.

Yesterday I by mistake extended a disk on a VM that had snapshots.
Using vmkfstools.
Kind of like this thread (http://communities.vmware.com/thread/238035).

This resulted in the following PowerOn error:

Failed to power on Servername on Host in Cluster:

Cannot open the disk ‘/vmfs/volumes/LUN/Folder/VM.vmdk’
Reason: The parent virtual machine disk has been modified since the child was created

The server was a database server so I had no choice than to fix it.

I tried the following with no luck:

  • Reverting to snapshot didn’t help – (Don’t try this if you don’t have a good backup)
  • Shrinking the vmdk again using vmkfstools – (This has not been possible since ESX 3.0)

Then I tried to use VMware Converter to do a V2V and in the first try (all defaults) that didn’t help the VM started with a BSOD.I tried again using the Converter but this time I changed one default parameter.In the “View/Edit Options” tap, remove the check mark in “Reconfigure destination virtual machine” and click YES to the warning.Removing the reconfigure option saved my day.
The VM started and I was able to restore the latest files from backup.


Last week I upgraded a Virtual Center server from Win2003 & MSSQL 2000 (32-bit) to Win2008 & MSSQL 2005 (64-bit).

During the installation of vCenter it asked for a 32-bit ODBC even though all the new systems was running 64-bit.
After a some time on Google i found that Windows 64-bit also includes a 32-bit version of the ODBC.

To set up a 32-bit DSN launch the 32-bit version of the Data Source Administrator. It is located at:
%systemdrive%\Windows\SysWoW64\Odbcad32.exe

Also se
http://www.vmwarewolf.com/32-bit-odbc-dsn-for-vsphere/

Over the past few months we have seen a few Windows servers with a black screen.
Meaning

  • You can’t see the logon promt
  • You get a black screen when you connect with RDP

We found that the problem was caused by a change in the Windows color scheme.

The solution is to copy the color scheme from a simular Windows servers registry and add it the VM/server that has the problem using registry to connect to a remote server.

  1. On a simular windows server locate “[HKEY_USERS\.DEFAULT\Control Panel\Colors]” and export it to a file.
  2. Using the same Registry Editor connect to the remote server.
  3. Import the registry file just created or change the color scheme manually.
  4. Reboote the affected server to change the color scheme.

Default color scheme for a Windows 2003 server.
Default color scheme for a Windows XP.
Default color scheme for a Windows 2000 server.
Default color scheme for a Windows 2008 server.

Today a one of my customers encountered an error when trying to revert to an snapshot.
They recived the following error:
“error encountered trying to restore cpu state from file /vmfs/volumes/…./xxxxx.vmsn”

After a bit of googleing if came up with the problem.
The error occures when a VM with snapshots (taken when VM is PoweredOn) is migrated or moved to a host with another CPU stepping – and the VM is reverted to ine of theise snapshots.

To correct the problem you have to complete the following steps:

  • Revert to the snapshot you want to use.
  • Make sure the VM is powered off.
  • Edit the VM’s .vmx file and remove the line “checkpoint.vmstate”
  • Power on the VM
  • Delete the snapshot

If you still want a snapshot of the VM in it’s current state

  • Shutdown the VM
  • When its powered off create a new snapshot
  • Power on the VM again to start work with it

This solution has to be applied to all VM’s with snapshots taken while the VM was powered on.

To night I had problems with uninstalling VMware Tools in a VM after updating to the latest ESX release.

The uninstaller kept asking me to insert the “VMWare Tools” disk and click OK”.
In the popup window there is pull-down field labeled “Use Source” and in this field is the number one (“1″).

If I tried to browse to the the “VMware Tools.msi” it returns an error: “The file ‘X:\VMware Tools.msi’ is not a valid installation package for the product VMware Tools…”

The solution I used to get around this problem was simply:

  1. Open the registry
  2. Locate “[HKEY_CURRENT_USER\Software\Microsoft\Installer\Products\8E24D35BB278E034284D0860A513CF1E” and delete it.
    (If you don’t want to delete it, just rename it or make a backup first)
  3. Run the VMware Tools installation again.

And wola it nor works :-)

Right after lunch today I had a host (3.5 U3) crach with a kernel panic.

It shouldn’t be a problem for clusters running HA, but on this cluster I had disabled HA bacause of an error and hadn’t had the time to depug :-( .
So my VM’s couldn’t be started on a new host and I’m not going to manually register 116 VM’s on another host – so I was forced to find a soultion.

I did a bit of googleing and found VMware KB10196.
I followed the steps and everything is now working – AND HA IS ENABLED :-)

This is the steps i followed:

  1. Reboot the host into “VMware ESX servere (Debug mode)”
  2. Log in with a user with root permissions and run the following commands.
    esxcfg-boot -p (reloads the PCI data)
    esxcfg-boot -b (sets up boot information)
    esxcfg-boot -r (refreshes initrd)
  3. Now just reboot the host.

After the reboot the host should work as normal. From the VC Client you can verify that the host is connected to VC.

Powered by WordPress Web Design by SRS Solutions © 2010 A. Mikkelsen Design by SRS Solutions