Skip to content

Instantly share code, notes, and snippets.

@gab-satchi
Created August 28, 2019 17:57
Show Gist options
  • Save gab-satchi/b4c5e13029de86c16d11e4a6011b10c0 to your computer and use it in GitHub Desktop.
Save gab-satchi/b4c5e13029de86c16d11e4a6011b10c0 to your computer and use it in GitHub Desktop.
PKS Windows stemcell upgarde investigation

Problem

PKS 1.5 requires a minimum Windows stemcell version 2019.7, however if you provide a greater version (2019.8), cluster creation fails. Full repro here: https://www.pivotaltracker.com/n/projects/2375339/stories/167688170 The root of the problem was the service adapter had 2019.7 hardcoded and always looked for that stemcell when deploying clusters.

On-demand service broker (ODB) does not allow using "latest" for stemcell version so we had to find a way to send the currently uploaded Windows stemcell version from OpsManager to the broker. The Linux stemcell version was always passed using the tile metadata.

Current solution

PKS tile metadata has been updated to include the Windows stemcell versions found in Plans 11,12 and 13. Toggling Windows can be done on a per plan basis, which means any combination of the 3 plans can be selected. As a part of the solution, OpsManager will now either include the uploaded Windows stemcell version or a "0" for each of the 3 plans (for ex: if only Plan 12 is used, OpsManager will send 0:2019.8:0 as the stemcell version.

The service adapter has been updated to parse the stemcell versions sent by OpsMgr and pick a valid version if it exists.

Assumptions

  • None of the uploaded stemcells will have a : in the version. This solution uses a colon as a separator when splitting the single string with all versions.
  • The getWindowsEnabled function works as expected. If it falsly thinks Windows is enabled but a non zero version hasn't been sent to the service adapter, a stemcell version of 0.0.0 would be in the resulting manifest and possibly lead to a deployment error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment