ghettoVCB.jsA little history, first. This project was inspired by a bioinformatics pipeline workflow web app I wrote called scriptQueue that remotely ran fastQC jobs on a compute node through SSH, and pulled the HTML results with SSHFS and display them through the web service. The goal of that project was to allow for additional workflow types and the workflows themselves were to be absolutely and completely flexible.
scriptQueue used the child_process module that comes with NodeJS. With the spawning of a child SSH process, I realized through the events of watching its standard output and process status (running/not running), I was able to keep complete control of not only any arbitrary command line application on the host OS, but on any remote host through SSH piping. Awesome!
Back to ghettVCB.js, which is the topic of this post. Naturally, one of the workflows that came to mind for scriptQueue was a ghettoVCB workflow for my MicroServer ESXi WhiteBox. Since scriptQueue was designed with the workflow concept (both server side and client side) forking the project was as easy as adding a new workflow form client side and workflow route server side. Bam.
For the ghettoVCB workflow, the webapp creates a folder './ghettoVCB' in the apps running path. It then uses SSHFS to mount the remote ESXi script path which contains ghettoVCB.sh. When the "Submit ghettoVCB" button is clicked, the webapp will try and save a configuration file (ghettoVCB.js.conf) and a list of virtual machines to backup (vms_to_backup.conf) on the remote ESXi host through the ghettoVCB mount.
Once the files are saved, the web app will send off a remote child process with the proper command line parameters pointing to ghettoVCB.sh script, the configuration and list of vm files.
Below is a view of the History Grid, which visualizes all the meta-data stored for a child process. This is where mongoDB comes in. I store all standard output and standard error results in the meta-data of the child process in mongoDB through the mongoose API. I also keep tabs on the PID number, its status, start and end dates.
As you can see, the display is a little interesting when we get to the Clone percentage. The normal stdout replaces the same line with an updated number, but the way I currently save output, it appends a new line. No biggy.
So there you have it. That's ghettoVCB.js, a GPL ExtJS 4.1 / NodeJS WebApp GUI for running ghettoVCB.sh on a remote ESXi host.