Stemcell Version Not Found

I was running a script the other day that would pull down the latest cf-deployment and get it running on my local computer using bucc. (Here’s the code for those following along at home.)

I get the STEMCELL_VERSION from the cf-deployment repo with bosh interpolate command. When software updates in the repo, the script will use the newest STEMCELL_VERSION.

The script passes in the STEMCELL_VERSION to the bosh upload-stemcell command like this:

bosh \  upload-stemcell \
  https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent?v=${STEMCELL_VERSION}

Yet recently when I ran the script I got the error:

Task 7 | 18:55:00 | Update stemcell: Downloading remote stemcell (00:00:01)
               L Error: No stemcell found at 'https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent?v=97.19'.

I clicked on the path in the error to see if they had removed the stemcell. Which showed me this message on bosh.io.

Stemcell version is not found.

So what’s wrong with this picture?

Stemcells: The Next Generation

Stemcells are the base operating system, with security and the BOSH agent pre-installed. They make it possible to start with a common base layer for all releases.

Then, when your release needs to be patched, you just need to push a stemcell upgrade and BOSH can do a zero downtime, rolling upgrade. Stemcells are part of this process.

And now the BOSH team is migrating stemcells from trusty to xenial. Ubuntu’s 14.04 patch support will end in April 2019. So it’s great to see that the most important BOSH releases (like cf-deployment) are using the xenial 16.04 version.

TLDR; Update your stemcell version today!

https://www.ubuntu.com/about/release-cycle

What’s my Codename?

Back in my script, the problem was that the URL had the codename in it. It’s easiest to see if you put them side by side, which is how I figured it out.

https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-xenial-go_agent

I was already using bosh interpolate to set the STEMCELL_VERSION.

STEMCELL_VERSION=$(bosh interpolate $CF_DEPLOYMENT/cf-deployment.yml --path /stemcells/alias=default/version)

Yet if we look at that same area, we can come up with the CODE_NAME too.

CODE_NAME=$(bosh interpolate $CF_DEPLOYMENT/cf-deployment.yml --path /stemcells/0/os)

And now we can finally get the manifest to help us build a correct URL:

bosh \
  upload-stemcell \
  https://bosh.io/d/stemcells/bosh-warden-boshlite-${CODE_NAME}-go_agent?v=${STEMCELL_VERSION}

This could be extended further for the choice of infrastructure, bosh-warden-boshlite, etc. Comments welcome below!

Spread the word

twitter icon facebook icon linkedin icon