-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
Ubuntu 16.04, with vSphere 6.0 (licensed) server
My test environment uses a whole bunch of VMs running on an ESXi server that share the same USB devices for testing things on the network. Each VM is booted in series, tests run, and then it is shut down.
There are times that the vSphere plugin doesn't shut down VMs correctly (and doesn't fail), which in turn means the USB devices needed for testing aren't available to the next VM. It would be nice to be able to verify the hardware state of a booted VM to see if those devices are really connected to the VM or not.
Likewise, with this volume of VMs, it would be nice to be able to have a job step to attach USB devices to the VM before or after it has been booted. It would make it easier to manage the insane number of VMs I am working with.
I also had problems with the plugin not always killing off VMs it'd started. I traced these to the vSphere server itself simply rejecting some of the plugin's requests (the plugin just got errors when it tried to destroy the VM), but the plugin forgot about the VM anyway. There's code changes in version 2.16 of the plugin that should help address that.
An enhancement to add/remove USB stuff might be possible (I'm no expert on that aspect of vSphere) if the vSphere API (and the yavijava library the plugin uses to talk to vSphere) supports it. To do that, one would need to add a new sub-type to the Reconfigure step - see org.jenkinsci.plugins.vsphere.builders.[ReconfigureCpu|https://github.com/jenkinsci/vsphere-cloud-plugin/blob/master/src/main/java/org/jenkinsci/plugins/vsphere/builders/ReconfigureCpu.java] as an example.
What I would suggest is that you try with 2.16 and see if that resolves the "failure to shut down" issue. If it does then the bug reported above is fixed.
If, in addition, you still want an enhancement to add USB device support then you're welcome to raise an enhancement request but, as this plugin is maintained on a voluntary basis, unless you code up the enhancement yourself and raise a pull-request on github, it's unlikely to happen any time soon.