Wednesday, March 16, 2011

VMware vSphere 4.1 – USB Pass-through

USB Devices Supported for Passthrough from an ESX/ESXi Host to a Virtual Machine

Device Model Vendor ID:Product ID Device Display Name
SafeNet Sentinel Software Protection Dongle (purple) 04B9:8000 Rainbow SafeNet Sentinel
SafeNet Sentinel Software Protection SuperPro Dongle (gray) 04B9:3000 Rainbow USB UltraPro
SecuTech Unikey Software Protection Dongle 0403:C580 Future Devices HID UNIKEY
MAI KEYLOK II Software Protection Dongle 07F2:0001 Microcomputer Applications USB Device
MAI KEYLOK Fortress Software Protection Dongle (Designed to work only with Windows operating systems.)

Note: This dongle is not designed for Linux systems. If you connect it to Linux systems, the connection resets frequently and can cause unexpected behavior.
0471:485e Philips KEYLOK Device
Aladdin HASP HL Drive 0529:0001 (13fe:1a00 Hub, 13fe:1d00 Drive) Aladdin Knowledge HASP HL 3.21, Kingston drive
Aladdin HASP HL Basic Software Protection Dongle 0529:0001 Aladdin Knowledge HASP HL 3.21
Aladdin HASP HL Pro Software Protection Dongle 0529:0001 Aladdin Knowledge HASP HL 3.21
Aladdin HASP HL Max Software Protection Dongle 0529:0001 Aladdin Knowledge HASP HL 3.21
Aladdin HASP HL Net Software Protection Dongle 0529:0001 Aladdin Knowledge HASP HL 3.21
Aladdin HASP HL NetTime Software Protection Dongle 0529:0001 Aladdin Knowledge HASP HL 3.21
Kingston DataTraveler 101 II 4GB 0930:6545 Toshiba DT 101 II
Lexar JD FireFly 2GB 05dc:a701 Lexar Media JD FireFly
Western Digital My Passport Essential 250GB 2.5 HDD 1058:0704 Western Digital External
Cables To Go USB 2.0 7-Port Hub Model# 29560 04cc:1521 Not applicable

 
USB pass-through has been part of the likes of VMware Workstation for quite some time, but is new to vSphere with the 4.1 release 

To connect a USB device to a virtual machine (VM) in vSphere you need to first add a USB Controller to the VM.
Select the virtual machine in the vSphere inventory, then right click it and click Edit Settings.


Click the Add button and then select USB Controller from the list. (You can only add a single USB Controller to a VM).


Now you can connect a USB device – but if the device does not show up then it not supported.
Click Edit Settings again and then click the Add button and then select USB Device.


Select the USB device that you want to connect to the VM from the available device(s). Here you can see that I already have one device connected to a VM already.


Tuesday, February 8, 2011

VMware “Cannot open the disk ‘XXXXXX.vmdk’ or one of the snapshot disks it depends on.”

From time to time, I want to copy just the minimum files for a VMware virtual machine: the two .vmdk files and the .vmx file. After moving those files to a new location or deleting a snapshot file, attempting to boot the virtual machine returns the following error message:

Cannot open the disk ‘XXXXXX.vmdk’ or one of the snapshot disks it depends on.

Reason: The system cannot find the file specified.

I’ve found that following the steps below fixes the problem and allows me to boot the virtual machine as it existed at the time of creation. DO NOT USE these steps if you need to retain any changes to the machine:

Open the *.vmx file in a text editor and find the line that refers to the old snapshot file, which will look something like:

scsi0:0.fileName = “XXXXXX-000002.vmdk”

or

ide0:0.fileName = “XXXXXX-000002.vmdk”

Change the value to the filename of the ~1kb .vmdk file (which happens to be the same as the name of the VM). For example, if your virtual machine was named “Windows XP Professional”, the line would read:

scsi0:0.fileName = “Windows XP Professional.vmdk”

Power on the VM. It should boot normally, but because the snapshot file is missing, the machine will boot to an earlier state.

Friday, January 7, 2011

Unable to add an ESX host to vCenter

While this issue has been discussed at length both in the communities and in knowledge base articles (ex. http://kb.vmware.com/kb/1003409), I cannot find a single KB article that lists every step I would perform to fix the issue and the order in which I would perform them.
There are two different kinds of ESX to vCenter connectivity problems that I would like to discuss:
  1. Initially adding an ESX host
  2. Reconnecting a disconnected ESX host
In my experience, the first problem is almost always caused by a DNS or network connectivity issue. To solve this, first try to add the ESX host by IP address instead of FQDN. If this works, ensure the ESX host and vCenter Server have the appropriate DNS servers, that they can resolve through them (i.e. nslookup) to other hosts, and most importantly that they can resolve to each other. If/When DNS is working properly, try to connect between the ESX host and vCenter server via ping and SSH.
In the case of a disconnected ESX host, the second problem listed above, simply restarting the management services fixes the issue most of the time:
# service mgmt-vmware restart
# service vmware-vpxa restart
The important thing to note is that after restarting the management services you may need to wait several minutes in order to confirm whether or not the issue is resolved (i.e. the host reconnects to vCenter). If this fails, in some rare cases closing out of the VI session and establishing a new connection resolves the issue. If the issue is still not resolved, disconnect the ESX host from vCenter and then manually remove the vmware-vpxa rpm from the host:
# rpm -e `rpm -qa | grep vpxa`
Finally, reconnect the ESX host. As a last-ditch effort, if the host is still listed as disconnected or remains "In Progress" during the "Add Host" function, restart the vCenter Server service.
While the KB articles suggest a variety of other options, the above steps have always resolved the issue for me.