Tanzu OM CLI uploads stemcell even if it exists
search cancel

Tanzu OM CLI uploads stemcell even if it exists

book

Article ID: 432645

calendar_today

Updated On:

Products

VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

Multiple attempts to upload the same stemcell results in OM CLI continually re-uploading a stemcell that already exists.

OM documentation states - 

This command will upload a stemcell to the target Ops Manager. Unless the force flag is used, if the stemcell already exists that upload will be skipped.

This results is wasteful cycles by platform automation or other anything leveraging OM. 

Resolution

This issue is reported against OM CLI here : https://github.com/pivotal-cf/om/issues/615
 
The CheckStemcellAvailability method uses the full filename against the listed stemcells from ops manager diagnostic report. In newer versions of Opsmanager, this does not match as the [metadata] prefix is not listed as part of the filename.
 
Ops manager has changed how the stemcells filenames are listed in /api/v0/diagnostic_report output and this has resulted in this regression.
 
A potential workaround is to rename the stemcell to format expected by OpsManager prior to uploading. 

Example:
% mv bosh-stemcell-1.1091-vsphere-esxi-ubuntu-jammy-go_agent.tgz bosh-vsphere-esxi-ubuntu-jammy-go_agent-1.1091.tgz
% om --env=$OM_ENV upload-stemcell -s  bosh-vsphere-esxi-ubuntu-jammy-go_agent-1.1091.tgz                        
processing stemcell
stemcell has already been uploaded

Engineering is currently reviewing a permanent fix to this in OM CLI.