LATEST VERSION: 1.9 - CHANGELOG
Pivotal Cloud Foundry v1.9

Building a Windows Stemcell

This topic describes how to create a local Concourse pipeline to build a Windows stemcell for use with the BOSH Release for Windows. If you are deploying the BOSH Release for Windows on vSphere, you must follow the procedures in this topic to build a stemcell before performing the steps in Deploying BOSH Windows.

Note: The procedures in this topic are only required for vSphere deployments. If you are using Amazon Web Services (AWS), skip this topic and proceed directly to Deploying the BOSH Release for Windows.

Requirements

Concourse is a pipeline-based continuous integration system. To learn more about Concourse, see the documentation.

You must have the following to create a Concourse pipeline for building a Windows stemcell:

  • A vSphere environment with outbound Internet and root access to an ESXi, which can be nested
  • Access to an S3-compatible blobstore, either through Amazon Web Services (AWS) or a local Minio server
  • The BOSH Release for Windows, downloaded from Pivotal Network

Step One: Prepare Your ESXi

  1. SSH into the ESXi as root, replacing YOUR-ESXI with the IP address or domain name of the ESXi host. When prompted, enter your root password.
    $ ssh root@YOUR-ESXI
    Password:
    
  2. Run the following commands from the ESXi:
    [root@:~] esxcli system settings advanced set -o /Net/GuestIPHack -i 1
    [root@:~] esxcli network firewall ruleset set --ruleset-id=gdbserver --enabled=yes
    

Step Two: Prepare Your Blobstore

You can use AWS or a local Minio server for your S3-compatible blobstore.

AWS

Perform the following steps to prepare and populate an AWS S3 blobstore:

  1. Navigate to the AWS Console.
  2. Click S3 to open the S3 Management Console.
  3. Click Create Bucket.
  4. Enter a globally unique name for your S3 bucket under Bucket Name.
  5. Under Region, select US Standard.
  6. Click Create.
  7. Select the newly created S3 bucket and click Permissions. Ensure that your user has Upload/Delete permissions. If necessary, navigate to the Identity and Access Management (IAM) console to ensure your user has the correct IAM permissions.
  8. Download the following files:
    • The VMWare OVF Tool Linux 64-bit from VMWare
    • The UltraDefrag tool from SourceForge
    • The PSWindowsUpdate PowerShell module from Microsoft
    • The Windows Server 2012 R2 ISO from Microsoft
  9. Rename the PSWindowsUpdate PowerShell module from PSWindowsUpdate.zip to PSWindowsUpdate_v1.zip:
    $ mv PSWindowsUpdate.zip PSWindowsUpdate_v1.zip
  10. Upload the VMWare OVF Tool .bundle file and the PSWindowsUpdate PowerShell module .zip file to your S3 bucket.

Minio

Perform the following steps to prepare and populate a Minio blobstore:

  1. Install Golang.
  2. Install Minio by building it from source:
    $ go get -u github.com/minio/minio
    
  3. Download and install mc, the Minio Client.
  4. Follow the instructions for your operating system in the Minio readme to run a local Minio server. When the server starts, Minio outputs the AccessKey and SecretKey. Record these values.

    Note: You must have at least 5% of your local disk free to run a local Minio server.

  5. With your local Minio server running, add your server to your list of hosts:
    $ mc config host add myminio http://10.0.0.10:9000 YOUR-ACCESS-KEY YOUR-SECRET-KEY
  6. Create a bucket:
    $ mc mb myminio/bosh-windows-bucket
  7. Download the following files:
    • The VMWare OVF Tool Linux 64-bit from VMWare
    • The UltraDefrag tool from SourceForge
    • The PSWindowsUpdate PowerShell module from Microsoft
    • The Windows Server 2012 R2 ISO from Microsoft
  8. Rename the PSWindowsUpdate PowerShell module from PSWindowsUpdate.zip to PSWindowsUpdate_v1.zip:
    $ mv PSWindowsUpdate.zip PSWindowsUpdate_v1.zip
  9. Copy the VMWare OVF Tool .bundle file and the PSWindowsUpdate PowerShell module .zip file into your Minio bucket:
    $ mc cp ~/Downloads/VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle myminio/bosh-windows-bucket
    $ mc cp ~/Downloads/PSWindowsUpdate_v1.zip myminio/bosh-windows-bucket
    

Step Three: Prepare Your Pipeline

  1. Change into the directory where you downloaded the BOSH Release for Windows files from Pivotal Network:

    $ cd ~/bosh-windows

  2. Open the consumer-vars.yml file and replace the REPLACE_ME placeholders as follows:

    • AWS_ACCESS_KEY: Enter your AWS or Minio access key.
    • AWS_SECRET_KEY: Enter your AWS or Minio secret key.
    • S3_OVFTOOL_BUCKET, S3_ULTRADEFRAG_BUCKET, S3_WINDOWS_UPDATE_BUCKET, S3_STEMCELL_OUTPUT_BUCKET, S3_WINDOWS_ISO_BUCKET: Enter the name of the bucket you created in your S3-compatible blobstore. If you followed the steps above to set up a Minio server, the name is bosh-windows-bucket.
    • ESXI_REMOTE_ADDRESS: Enter the IP address of your ESXi host.
    • ESXI_REMOTE_PASSWORD: Enter the root password of your ESXi host.
    • ESXI_DATASTORE: Enter the UUID of the ESXi datastore to store the VM.
    • ESXI_CACHE_DATASTORE: Enter the UUID of the ESXi datastore to store the cache file for Packer. This can be the same value as ESXI_DATASTORE.
    • WINDOWS_PASSWORD: Choose an Administrator password for the outputted stemcell. This is the password you use to log in to the Windows cell through a Remote Desktop Protocol (RDP) client. If the password does not meet the normal Windows complexity rules, the password will remain the default, vagrant.

Step Four: Deploy Concourse

Note: When deploying Concourse locally, your local machine must have Internet access.

  1. Download and install VirtualBox.
  2. Download and install Vagrant.
  3. Perform the following commands to spin up a local Concourse server:

    $ vagrant init concourse/lite
    $ vagrant up
    
    View the Concourse interface by navigating to http://192.168.100.4:8080.

  4. Download the binary of fly, the Concourse CLI, from Concourse, and place it in your $PATH.

  5. Log in to your Concourse server:

    $ fly -t local login -c http://192.168.100.4:8080
    

  6. Set your pipeline:

    $ fly -t local set-pipeline -p bosh-windows-consumer -c bosh-windows-consumer.yml -l consumer-vars.yml
    

  7. If Concourse tells you the pipeline is paused, unpause it:

    $ fly unpause-pipeline -t local -p bosh-windows-consumer
    

  8. Navigate to your Concourse pipeline in a browser at http://192.168.100.4:8080/teams/main/pipelines/bosh-windows-consumer.

  9. Kick off a build by selecting create-stemcell and clicking the plus sign in the upper right. After several hours, the outputted stemcell appears in the bucket you created in your S3-compatible blobstore.

Was this helpful?
What can we do to improve?
View the source for this page in GitHub