Running Jenkins Jobs on Windows Virtual Machine
I'm doing just that in my environment using the vSphere Cloud Plugin. Here's a basic step-by-step guide:
- Install the plugin
- Configure your ESX/ESXi server as a new "vSphere Cloud"
- Create a new Jenkins node, of type "Slave virtual computer running under vSphere Cloud" (which becomes available after Installing the plugin).
- When configuring the new node, optionally specify a snapshot name. This will revert the VM to this snapshot when the node launches.
- Use the node in a pipeline script:
node("node-name-or-label") { ...your code here... }
I use the method above with about 10 Windows nodes, reverting each to a "Clean" snapshot to start each build with a known state.