Updating an Appliance¶
We recommend that you update your Anapaya appliance in a timely manner to stay current with the latest enhancements and fixes. This guide provides a general step-by-step procedure to update your Anapaya appliance with the Anapaya appliance installer. For a more extensive explanation of the update procedure, refer to the Software Updates documentation. Upgrading between minor versions is generally safe, and automatic rollback in case of failure is supported.
Note
Make sure to consult the version specific release and upgrade notes referenced on the Release Notes page. They will mention known issues that potentially might affect your upgrade, or additional steps that need to be taken during an upgrade.
Prerequisites¶
- Access to software packages
To download the software packages, you require an access token that is provided as part of your software license. If you do not have access to that token, consult with your Anapaya Customer Sucess Engineer.
- Access to appliance API
To access the appliance API you need to know the configured API address and a set of credentials to authenticate to the appliance. Further you need to have network connectivity to the appliance such that you can reach it at the configured address. If you perform the update form a shell on the appliance itself, it is the localhost address
127.0.0.1
.Note
In the case where you perform the upgrade form a shell on the appliance itself where the host has no internet access, the keys, the signatures and the packages need to be downloaded on a host with internet access and copied to the appliance.
- Credentials
In case authentication was configured on the appliance, credentials need to be specified when interacting with the management API by extending the curl command with the
-u <username>:<password>
argument.curl -u <username>:<password> <url>
- Up-to-date public keys
Ensure that the set of public key used for code verification is up-to-date with the currently published set on https://releases.anapaya.net/keys.json
curl https://releases.anapaya.net/keys.json > reference_keys.json curl -k https://$APPLIANCE_API/api/v1/software/keys > keys.json diff <(jq --sort-keys . reference_keys.json) <(jq --sort-keys . keys.json)
If the keys differ please follow instructions in the Updating installed public keys section to update them.
Update the anapaya-scion package¶
To update the anapaya-scion package, first download the package its signature then upload both files to the appliance and finally trigger the installation.
Note
The variables ($VERSION
, $APPLIANCE_API
, $ACCESS_TOKEN
) in the commands can either be
replaced directly or set as environment variables
export APPLIANCE_API=127.0.0.1
export VERSION=v0.33.5
Download the
anapaya-scion
package of the desired version from cloudsmith.iowget https://dl.cloudsmith.io/$ACCESS_TOKEN/anapaya/stable/raw/names/anapaya-scion/versions/$VERSION/anapaya-scion-$VERSION.tar.gz
Download the
anapaya-scion
package signature from the Anapaya websitecurl https://releases.anapaya.net/anapaya-scion-$VERSION.tar.gz.signatures.json > signatures.json
Upload the package signatures to the appliance installer
curl -k https://$APPLIANCE_API/api/v1/software/signatures/scion/$VERSION -X POST -d @signatures.json
Upload the package to the appliance installer
curl -k https://$APPLIANCE_API/api/v1/software/scion/packages/local -X POST --data-binary "@anapaya-scion-$VERSION.tar.gz"
Trigger the installation
curl -k https://$APPLIANCE_API/api/v1/software/scion/install -X POST -d '{"version": "'"$VERSION"'"}'
Note
In case of a failed installation of an
anapaya-scion
package, a rollback to the original version is triggered automatically and no interaction is required.Tip
You can check the installation progress by running the following command:
watch curl -k https://$APPLIANCE_API/api/v1/software/scion/install/$ID
The
$ID
corresponds to the installation identifier of the installation that you have triggered. You will find it in the output of the triggered installation.Finally, check if the installation has completed and the new version is installed.
curl -k https://$APPLIANCE_API/api/v1/software/scion/installed
Rollback was triggered¶
When a rollback is triggered due to a failed installation of the new version, investigate the reason by looking at the logs of the installer:
journalctl -u appliance-installer.service
Note
Sometimes, the installation of a package fails due to a lock that cannot be acquired by the installer. In that case, a rollback is triggered. To verify that the rollback was triggered because of this known issue, you can check the installer logs for the following error:
Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend)
If that is the case, an installation can just be retried.
Update the anapaya-system package¶
Updating an anapaya-system package is analogous to the process for the anapaya-scion package, with the difference that no rollbacks are supported.
To update the anapaya-systems package, first download the package its signature then upload both files to the appliance and finally trigger the installation.
Note
The $VARIABLES
($VERSION
, $APPLIANCE_API
, $ACCESS_TOKEN
)
in the commands can either be replaced directly or set as environment variables
export APPLIANCE_API=127.0.0.1
export VERSION=v2.5.0
Download the
anapaya-system
package of the desired version from cloudsmith.iowget https://dl.cloudsmith.io/$ACCESS_TOKEN/anapaya/stable/raw/names/anapaya-system/versions/$VERSION/anapaya-system-$VERSION.tar.gz
Download the
anapaya-system
package signature from the Anapaya websitecurl https://releases.anapaya.net/anapaya-system-$VERSION.tar.gz.signatures.json > signatures.json
Upload the package signatures to the appliance installer
curl -k https://$APPLIANCE_API/api/v1/software/signatures/system/$VERSION -X POST -d @signatures.json
Upload the package
curl -k https://$APPLIANCE_API/api/v1/software/system/packages/local -X POST --data-binary "@anapaya-system-$VERSION.tar.gz"
Trigger the installation
curl -k https://$APPLIANCE_API/api/v1/software/system/install -X POST -d '{"version": "'"$VERSION"'"}'
Finally, check if the installation has completed and the new version is installed.
curl -k https://$APPLIANCE_API/api/v1/software/system/installed