Connecting and Disconnecting Virtual Devices
You can add and remove virtual devices by using the connectdevice and disconnectdevice options. The selected guest operating system determines which of the available devices you can add to a given virtual machine.
The virtual hardware that you add appears in the hardware list that is displayed in the Virtual Machine Properties wizard. You can reconfigure virtual machine hardware while the virtual machine is running, if the following conditions are met:
The following examples illustrate connecting and disconnecting a virtual device.
The connectdevice option connects the virtual IDE device CD/DVD Drive 2 to the specified virtual machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx connectdevice "CD/DVD Drive 2"
The disconnectdevice option disconnects the virtual device.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx disconnectdevice "CD/DVD Drive 2"