The trailing zero of stemcell version in BOSH manifest will be eaten if not enclosed
search cancel

The trailing zero of stemcell version in BOSH manifest will be eaten if not enclosed

book

Article ID: 293808

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

The available Stemcells on BOSH might have version number with trailing zero (0). For example,
$ bosh ss
Using environment 'x.x.x.x' as client 'ops_manager'

Name                                     Version  OS            CPI                   CID
bosh-vsphere-esxi-ubuntu-jammy-go_agent  1.360*   ubuntu-jammy  f629e85100fdd2f461a3  sc-fffe37c5-b537-4940-8da9-cb1acc34a8b3
If the Stemcell version number is not enclosed in BOSH manifest, then the trailing 0 will be trimmed during deployment. 
---
name: testvm
stemcells:
- alias: jammy
  os: ubuntu-jammy
  version: 1.360
$ bosh -d testvm deploy testvm.yml
Using environment 'x.x.x.x' as client 'ops_manager'

Using deployment 'testvm'

+ stemcells:
+ - alias: jammy
+   os: ubuntu-jammy
+   version: '1.36'
As a result, the operation would fail with complaining the Stemcell version doesn't exist. 
Task 56 | 00:47:23 | Preparing deployment: Preparing deployment (00:00:00)
                   L Error: Stemcell version '1.36' for OS 'ubuntu-jammy' doesn't exist
Task 56 | 00:47:23 | Error: Stemcell version '1.36' for OS 'ubuntu-jammy' doesn't exist

Task 56 Started  Wed Mar 20 00:47:23 UTC 2024
Task 56 Finished Wed Mar 20 00:47:23 UTC 2024
Task 56 Duration 00:00:00
Task 56 error

Updating deployment:
  Expected task '56' to succeed but state is 'error'

Exit code 1


Environment

Product Version: 2.10

Resolution

As explained in the Github issue, this is not a bug of BOSH CLI, but a design of YAML. In order to avoid such kind of error,  the Stemell version number needs to be enclosed with single or double quotes in BOSH manifest. For example,
---
name: testvm
stemcells:
- alias: jammy
  os: ubuntu-jammy
  version: "1.360"