Running jobs via VMware Workstation (15)

11 views
Skip to first unread message

John E Peterson

unread,
Jan 28, 2019, 11:10:06 AM1/28/19
to Jenkins Users
Ok.  We have to run some jobs using VM's controlled on a real PC (Well, a VM on a real PC, not a VMware ESXi vCenter/vSphere host server setup).  All the bits and pieces seem to be there to do this, but no method (and no plugins) to put it all together.

We have Jenkins running on "MyJenkins".
We have VMware Workstation running on "MyVMWorkstation"
We have VM's as MyVM1 and MyVM2 (controlled by VMware Workstation on "MyVMWorkstation")

I'm guessing that maybe this becomes a pipeline thing?  But not sure how to do it?  I know that several years back, VMware removed the ability of vSphere to connect to and control Workstation via the Gateway app.  :-(

We can launch a VM on MyVMWorkstation with a vmrun command line (and do it remotely!).  Such as PsExec \\MyVMWorksation vmrun start MyVM1  Works a charm.  (Well, actually some credential mess to deal with, but I've got that handled).
When the VM launches, it will connect to Jenkins 

What I need Jenkins to do when it detects a job is ready to run:

Send the command as above to MyVMWorkstation to launch MyVM1
Wait for MyVM1 to launch (ie: javaws says "Hey, I'm connected and ready")
Run the job on MyVM1 - just like a normal vSphere setup
When the job is done, execute the original command with "stop" instead of "start" (and actually a restore snapshot command as well)

How do I chain all this together?  It involves sending commands to essentially two "computers" in sequence to make this work.

John E Peterson

unread,
Jan 28, 2019, 3:07:23 PM1/28/19
to Jenkins Users
Cool.  I'm going to talk to myself here.  :-)

If I say "launch by running an command on the master", does that mean that Jenkins will launch a "command" on the PC it is running on (MyJenkins)?   And if that command launches the VM on another system, and once that system comes up and the javaws on the VM would connect as though it was launched via a vSphere cloud and work as it always did?  Documentation is not totally clear on any of this.

If that is the case, this is precisely what I need.

Thanks
Reply all
Reply to author
Forward
0 new messages