Sometimes we would like to recreate ops manager instance through Concourse for Platform Automation even though there is no version change. This could happen when there is a requirement to change the instance_type, rotate an ssh key, etc.
However, the automation toolkit, "om vm-lifecycle upgrade-opsman", does not work as expected. The change is not applied.
There is a recent change in the om tool, v7.10.1, that it will exit early if it is the same regarding the source and target ops manager version.
Bug fixes
Fixed a bug in om vm-lifecycle upgrade-opsman that occurred when both the input and currently-installed versions of Ops Manager were identical 3.0.X+LTS-T versions.
In previous versions of om that had the bug, this scenario would always cause Ops Manager to be reinstalled, even if the --recreate flag wasn't used.
This release restores the intended behavior: printing a message and exiting early if the --recreate flag isn't passed, and reinstalling Ops Manager if it is.
We could observe the following error messages, [stderr], in the concourse log.
0#:0#:01
+ om vm-lifecycle upgrade-opsman --config config/dev/config/opsman.yml --image-file image/ops-manager-###-3.0.##+LTS-T.yml --state-file state/dev/state/state.yml --installation installation/installation-2024####.####.##+UTC.zip --env-file env/dev/env/env.yml
0#:0#:01
0#:0#:01
Executing: "/usr/bin/om --env env/dev/env/env.yml --skip-ssl-validation curl --path /api/v0/info"
0#:0#:01
This could take a few moments...
0#:0#:01
/usr/bin/om[stderr]: Status: 200 OK
0#:0#:01
/usr/bin/om[stderr]: Cache-Control: private, no-store
0#:0#:01
/usr/bin/om[stderr]: Connection: keep-alive
To solve this issue, we could either pick up a new target version or add the “--recreate” flag.
If it is intended to simply refresh configuration such as instance_type or ssh key, this flag, “--recreate” can help here to recreate by force.
davi##@#### Downloads % om vm-lifecycle upgrade-opsman -h
Usage:
om [OPTIONS] vm-lifecycle upgrade-opsman [upgrade-opsman-OPTIONS]
Application Options:
...
[upgrade-opsman command options]
--recreate Force recreate the Ops Manager VM
om import-installation flags:
--installation= Path to installation
--env-file= Ops Manager Environment File
vm management flags:
--state-file= File to output VM identifier info (default: state.yml)
--image-file= VM image or yaml map of image locations depending on IaaS
--config= The YAML configuration file
--vars-file= Load variables from a YAML file for interpolation into config
--vars-env= load vars from environment variables by specifying a prefix (e.g.: 'MY' to load MY_var=value)