In order to manage BOSH stemcells in anynines-deployment, we've made stemcells configurable via the IAAS config. We configure a list of stemcells in iaas.stemcells (see config/iaas-config.yml.example for an example). This has the benefit of having all stemcells configured in one location and having it referenced anywhere it's needed. It also allows to use one type of stemcell in the services and another in the service instances. You can also use ops files to configure a certain type of stemcells for a particular component. This gives you a lot of control while preserving DRY principles by using sensible defaults.

Currently, Ubuntu Xenial is the default stemcell for all services and service instances. This can be changed to any OS supported by anynines-deployment.

Currently supported stemcells

We currently support the Ubuntu Xenial stemcells on all supported CPIs.

We've tested the following versions on our test system:

Linux stemcellsVersions
Ubuntu Xenial621.82

Changing the default stemcell

We use YAML anchors to create a reference to a particular stemcell and use that reference throughout the IAAS config file. Please find the string &a9s-stemcell-default in the IAAS config file (example: config/iaas-config.yml.example) and "move" the string (a so called YAML anchor) to another stemcell. You can also introduce a different stemcell below the stemcell that uses this YAML anchor and assign it the YAML anchor &a9s-stemcell-default. After that, the default stemcell will be the one you configured.

An example for your IaaS config:

    ubuntu-xenial: &a9s-stemcell-default
      os: ubuntu-xenial
      alias: ubuntu-xenial
      version: 621.82
      sha1: 3a1bb216989a52c0d1bd29c862cf064f9c983131

You can then reference such a stemcell like e.g.:

    service: *a9s-stemcell-default

If you want to use a different stemcell or even stemcell version in your service instances only, you can do so by using an Ops file. Please find an example in ops/replace-stemcell-template-uploader.yml You might have to create your own copy of that Ops file with the correct values for your setup.

Adding stemcells

It is possible to add stemcells to anynines deployment's IAAS config by using an Ops file. See ops/add-stemcell-centos.yml for an example.

Example IAAS config

The following YAML text is an example IAAS configuration. It introduces two stemcells (Ubuntu Trusty and Ubuntu Xenial) and allows referring to them by using the YAML anchors (&a9s-stemcell-default and &a9s-stemcell-default-ubuntu-trusty).

    ubuntu-xenial: &a9s-stemcell-default
      os: ubuntu-xenial
      alias: ubuntu-xenial
      version: 621.82
      sha1: 3a1bb216989a52c0d1bd29c862cf064f9c983131
    ubuntu-trusty: &a9s-stemcell-default-ubuntu-trusty
      os: ubuntu-trusty
      alias: ubuntu-trusty
      version: 3541.4
      sha1: de5f52b2ba072042a4891930c1584cfb4b1c506e

In order to refer to them, you can use a YAML alias:

    stemcell: *a9s-stemcell-default

Once you introduced the anchors and an alias, you can refer to these stemcells in different ways:

- os: ((iaas.data_service.stemcells.service.os))
  alias: ((iaas.data_service.stemcells.service.alias))
  version: ((iaas.data_service.stemcells.service.version))
- name: jobname
  vm_type: small
  instances: 1
  azs: [z1, z2, z3]
  stemcell: ((iaas.data_service.stemcells.service.alias))
  - { name: jobname, release: jobrelease }