VMware View: Network card disappeared

Nice problem / feature: With VMware Horizon View / VMware vSphere, network cards and SCSI controllers are HotAdd and HotPlug capable by default. Actually quite nice, but sometimes not desired. For example with VMware View: Users who like to click can remove the network card here, which has a, let's call it, "negative impact" on the connection to their VM.

View

The behavior is also documented at VMware:

http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1012225

The solution can also be found there: The "devices.hotplug" parameter must be set to "false" in the VMX file. With a large number of VMs, however, this is somewhat laborious. Therefore, here is the way via PowerCLI:

$key = "devices.hotplug"
$value = "false"
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue
$vmConfigSpec.extraconfig[0].Key=$key
$vmConfigSpec.extraconfig[0].Value=$value
Get-VM | Get-View | foreach {$_.ReconfigVM($vmConfigSpec)}

This allows all VMs to be adjusted accordingly during operation. However, for the change to take effect, the VM must be shut down and restarted once. Restarting the guest is not sufficient.

Leave a Comment