Version Upgrade and Rollback
This section describes how to upgrade or roll back HCE.
During an OS upgrade or rollback, RPM packages will be updated to the versions of the target OS. The blacklist and whitelist configured in osmt.conf will not be applied.
Upgrading the OS Version
- Confirm that the repository is configured correctly.
Check whether the parameters in the /etc/yum.repos.d/hce.repo file are configured correctly. The correct configuration is as follows:
[base] name=HCE $releasever base baseurl=https://repo.huaweicloud.com/hce/$releasever/os/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/hce/$releasever/os/RPM-GPG-KEY-HCE-2 [updates] name=HCE $releasever updates baseurl=https://repo.huaweicloud.com/hce/$releasever/updates/$basearch/ ......
Incorrect configuration may result in OSMT upgrade failures or unexpected upgrades.
- Update the OSMT version.
There is a mapping between OSMT versions and HCE versions. HCE installs by default the OSMT of the current OS. When upgrading HCE, you also need to update the OSMT to the matched version.
Run dnf update osmt -y --releasever [Target OS version] to update the OSMT version. For example, to upgrade HCE from 2.0 to 2.1, run dnf update osmt -y --releasever 2.1 to update OSMT to the latest version.You can also run dnf install osmt -y --releasever [Target OS version] to install OSMT if it is deleted by mistake. For example, you can run dnf install osmt -y --releasever 2.1 to install the latest OSMT.
- Upgrade the HCE version.
osmt update --releasever [Target version] --reboot_config [Restart configuration]
Choose an appropriate upgrade method. For more upgrade options, see osmt update -h.- To upgrade HCE from 2.0 to 2.1, run the following command:
osmt update --releasever 2.1
The upgrade is only applied after a reboot.
- Upgrade HCE from 2.0 to 2.1 and restart the OS immediately.
osmt update --releasever 2.1 --reboot_config always
- Upgrade HCE from 2.0 to 2.1 and restart the OS at 2022-12-30 23:00:00.
osmt update --releasever 2.1 --reboot_config "2022-12-30 23:00:00"
- To upgrade HCE from 2.0 to 2.1, run the following command:
- Check whether the upgrade was successful.
Run cat /etc/hce-latest and view the hceversion field. If the --releasever value is the version you specified, the upgrade was successful.
- (Optional) Delete backup files.
After verifying the OS functions, run osmt remove to delete the backup files.
The operation of deleting backup files cannot be undone. Ensure that no exception occurs after the upgrade before you run osmt remove.
Rolling Back the OS Version
- Choose an appropriate rollback method.
- To roll back and not restart the OS, run the following command:
- To roll back and restart the OS immediately, run the following command: (Then skip step 2.)
osmt rollback --reboot_config always
- Run reboot to restart the OS.
The rollback is only applied after a restart.
- Check whether the rollback was successful.
Run cat /etc/hce-latest and view the hceversion field. If the hceversion value is the source version, the rollback was successful.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot