Troubleshooting

Recreating a missing VMDK and descriptor file

  1. Log in to the console of the ESX host.
  2. Go to the directory that contains the virtual disk with the missing header/descriptor file
  3. Identify the kind of SCSI controller the virtual disk is using this command:
    less *.vmx | grep –i virtualdev
  4. Run this command to identify and record the exact size of the flat file:# ls -l *.vmdk
  5. Run the vmkfstools command to create a new virtual disk.# vmkfstools -c filesize -a scsi type filename.vmdk
    see the example belowvmkfstools -c 4294967296 -a lsilogic temp.vmdkThis command uses the following flags:

    -c <size> (This is the size of the virtual disk.)
    -a <virtual controller> (Whether the virtual disk was configured to work with BusLogic or LSILogic.)

    If you are short on disk space, you can create the temporary disk as type thin. The associated -flat file consumes almost no space (1Mb) instead of the amount specified with -c (as we are not keeping the new -flat file, this is not a problem). The consequence is that the header file will contain an extra line that must be removed manually. The command looks like this:

    # vmkfstools -c 4294967296 -a lsilogic -d thin temp.vmdk

    The files temp.vmdk and temp-flat.vmdk are created as a result.

  6. Check if vmdk was created with this command :  ls –ltr *.vmdk
  7. Delete temp-flat.vmdk as it is not needed. Run the command:# rm temp-flat.vmdk
     
  8. Rename temp.vmdk to the name that is required to match the orphaned -flat file
     
    # mv temp.vmdk win2003x86.vmdk
     
  9. Use nano to edit the descriptor
    1. Find the line # Extent description
      RW ####### VMFS “temp–flat.vmdk
      and change the name of the -flat to match the orphaned -flat file you have.
    2. Find the line with ddb.thinProvisioned and remove it.
      (if -d thin was used and the original was not a thin disk)
  10.   The Virtual machine is now ready to power on

See the KB article 1002511

How to Power off an unresponsive VM on an ESX host

Powering off an unresponsive virtual machine on an ESX host

1) Determine the host on which the virtual machine is running.
This information is available in the virtual machine’s Summary tab when viewed in the vSphere Client page.

2) Login to that Host using ssh client

3) Type vmware-cmd -l (shows full path to runing vms on this host)

4) Then type vmware-cmd (path to the vm) getstate see the example below.
 vmware-cmd vmfs/volumes/49be35b9-b234a901-5406-002219b69217/Windows-2003-32-bit/win2003x86.vmx getstate

To stop the VM use the vmware-cmd command see the example below.

5) On the ESX host type vmware-cmd /vmfs/volumes/49be35b9-b234a901-5406-002219b69217/Windows-2003-32-bit/win2003x86.vmx stop

6) The type vmware-cmd /vmfs/volumes/49be35b9-b234a901-5406-002219b69217/Windows-2003-32-bit/win2003x86.vmx getstate

7) If the VM getstate output is still on then use the stop hard command see the example below.

vmware-cmd /vmfs/volumes/49be35b9-b234a901-5406-002219b69217/Windows-2003-32-bit/win2003x86.vmx stop hard

This article pertains to ESX and does not apply to ESXi.  
For more information see the KB Article: 1004340
For ESXi hosts, see Powering off a virtual machine on an ESXi host (1014165).

Performance Troubleshooting for VMware vSphere 4

Performance problems can arise in any computing environment. Complex application behaviors, changing demands, and shared infrastructure can lead to problems arising in previously stable environments. Troubleshooting performance problems requires an understanding of the interactions between the software and hardware components of a computing environment. Moving to a virtualized computing environment adds new software layers and new types of interactions that must be considered when troubleshooting performance problems.

The attached document is the first installment in a guide covering performance troubleshooting in a vSphere environment. It uses a guided approach to lead the reader through the observable manifestations of complex hardware/software interactions in order to identify specific performance problems. For each problem covered, it includes a discussion of the possible root-causes and solutions. Topics covered include performance problems arising from issues in the CPU, memory, storage, and network subsystems, as well as in the VM and ESX host configuration. Guidance is given on relevant performance metrics to observe using the vSphere Client and esxtop in order to isolate specific performance issues.

This first installment of Performance Troubleshooting for VMware vSphere 4 covers performance troubleshooting on a single VMware ESX 4.0 host. It focuses on the most common performance problems which affect an ESX host. Future updates will add more detailed performance information, including troubleshooting information for more advanced problems and multi-host vSphere deployments.

Download it HERE