upgrade

Upgrade is an operation available from a specific state of a cluster or hostprovider that updates the object metadata without creating a new object and moves it to another state. The upgrade mechanism allows you to safely apply changes to the object’s current state.

The update operation is described in the new version of the bundle and defines which versions and editions of an object can be upgraded to the current bundle version.

There are two types of upgrades:

  • Switch the current bundle’s prototypes to those of a new bundle.

  • Execute a sequence of subjobs, including prototype switching.

A cluster or host prototype may contain an upgrade property. This property describes how to perform an upgrade from one bundle version to another. A prototype can contain multiple upgrade properties, which describe updates from different versions.

---
- type: cluster
  name: control
  version: 2.4
  description: "Monitoring and Control Software"
  upgrade:
    - name: Upgrade 1
      versions:
        min: 0.4
        max: 2.0
      description: Upgrades the cluster to a new version
      states:
        available: any
        on_success: upgradable
    - name: Upgrade 2
      versions:
        min: 1.0
        max_strict: 3.0
      scripts:
        - name: pre check
          display_name: Pre-check before upgrade prototypes
          script_type: ansible
          script: ansible/pre-check.yaml
        - name: bundle upgrade
          display_name: Upgrade bundle
          script_type: internal
          script: bundle_switch
        - name: post tasks
          display_name: Some operations after prototype upgrades
          script_type: ansible
          script: ansible/post-task.yaml
      config:
        - name: repos
          type: group
          subs:
            - name: url
              display_name: "Repository URL"
              type: string
              default: https://ci.arenadata.io/artifactory/list/ads-centos7-x64-ads/
              required: no
            - name: token
              display_name: "Access token"
              type: password
      from_edition: community
      states:
        available:
          - installed
        on_success: upgradable

When using upgrade, provide the properties described below.

config

The optional config property allows you to define upgrade configuration parameters. A detailed description of this property is provided in the config article.

The config property can be used together with the scripts and scripts_template properties.

description

The optional description property specifies the upgrade description.

display_name

The optional display_name property specifies the upgrade name displayed in the web interface.

from_edition

The optional from_edition property specifies the object editions from which the bundle upgrade is allowed. The default value is community.

To enable upgrading from any object edition, specify the special value any.

upgrade:
  - name: Upgrade 1
    versions:
      min: 0.4
      max: 2.0
    description: Upgrades the cluster to a new version
    states:
      available: [created, installed]
      on_success: upgradable
    from_edition:
      - community
      - enterprise

name

The required name property specifies the name of the upgrade.

scripts

The optional scripts property allows you to statically define a sequence of subjobs executed during the upgrade. A detailed description of the scripts property is provided in the actions article.

When the scripts property is used, the subjob sequence must include the built-in ADCM function bundle_switch, which is used to upgrade prototypes to new versions.

To define upgrade configuration parameters, you can use the config property, which is supported together with the scripts and scripts_template properties. For more information about this property, refer to the config article.

The scripts and scripts_template properties are mutually exclusive.

scripts_template

The optional scripts_template property allows you to dynamically define a sequence of subjobs executed during the upgrade. A detailed description of this property is provided in the actions article.

To define upgrade configuration parameters, you can use the config property. A detailed description of this property is provided in the config article.

states

The required states property defines the following states:

  • available — list of permissible states of the cluster or hostprovider for performing the upgrade. Use the special value any to make the upgrade available regardless of the cluster or hostprovider state.

  • on_success — state of the cluster or hostprovider set after a successful upgrade.

  • on_fail — state of the cluster or hostprovider set after a failed upgrade.

upgrade:
  - name: Upgrade 1
    versions:
      min: 0.4
      max: 2.0
    description: Upgrades the cluster to a new version
    states:
      available: [created, installed]
      on_success: upgradable

versions

The required property versions defines the range of versions appropriate for upgrade.

upgrade:
  - name: Upgrade
    versions:
      min: 0.4
      max: 2.0
    states:
      available: any
      on_success: upgradable
NOTE
The min and max parameters use non-strict comparison (including the boundary values of the cluster or host versions). Use the min_strict or max_strict parameters for strict comparison (excluding the boundary values of the cluster or host versions).
Found a mistake? Seleсt text and press Ctrl+Enter to report it