Overview

BOSH can deploy jobs on Windows VMs. There is open source tooling and documentation available to build AWS, Azure,
vSphere and Openstack stemcells for Windows.

In general Windows BOSH Releases work in the same way as a standard BOSH release. The main difference is that the monit file for Linux Releases is structured differently on Windows. Below are specific concerns for jobs on Windows.

The above monit file will execute the file C:\var\vcap\jobs\say-hello\bin\start.ps1 with the environment variable FOO set to BAR. The BOSH agent ensures the process is running by executing within a service wrapper.

Also, note that Pre-Start, Post-Start, Drain, and Post-Deploy scripts (described in the job lifecycle) must be powershell scripts and end with the .ps1 extension, i.e., pre-start.ps1, post-start.ps1, drain.ps1, and post-deploy.ps1.

Release job can have a stop script that will run when the job is restarted or stopped. This script allows the job to clean up and get into a state where it can be safely stopped.

The stop script replaces the standard mechanism for shutting down a BOSH job. If you use a stop script, winsw will not stop your job automatically. Instead it is the responsibility of the stop script to clean up resources and kill any processes that are part of the job. Winsw will wait for both the stop script and the main job process to exit before reporting to Windows that the service has terminated. For more details on how winsw handles a stop script, see winsw documentation.

To use a stop script, a change to the job's monit and spec file must be made. The actual script source is placed in the jobs template directory. eg: jobs/job_name/templates

Stdout and Stderr are currently not preserved. It is recommended to use the Windows EventLog.