16.3.2. Lifecycle Agent を使用したイメージベースアップグレードの Upgrade ステージへの移行
シードイメージを生成し、Prep ステージを完了したら、ターゲットクラスターをアップグレードできます。アップグレードプロセス中に、OADP Operator は OADP カスタムリソース (CR) で指定されたアーティファクトのバックアップを作成し、その後、Lifecycle Agent がクラスターをアップグレードします。
アップグレードが失敗または停止した場合、Lifecycle Agent は自動的にロールバックを開始します。アップグレード後に問題が発生した場合は、手動でロールバックを実行できます。手動ロールバックの詳細は、「Lifecycle Agent を使用したイメージベースアップグレードの Rollback ステージへの移行」を参照してください。
前提条件
-
Prepステージを完了した。
手順
Upgradeステージに移動するには、次のコマンドを実行して、ImageBasedUpgradeCR のstageフィールドの値をUpgradeに変更します。$ oc patch imagebasedupgrades.lca.openshift.io upgrade -p='{"spec": {"stage": "Upgrade"}}' --type=merge次のコマンドを実行して、
ImageBasedUpgradeCR のステータスを確認します。$ oc get ibu -o yaml以下の例は、進行中のアップグレードを示しています。
status: conditions: - lastTransitionTime: "2024-01-01T09:00:00Z" message: In progress observedGeneration: 5 reason: InProgress status: "False" type: Idle - lastTransitionTime: "2024-01-01T09:00:00Z" message: Prep completed observedGeneration: 5 reason: Completed status: "False" type: PrepInProgress - lastTransitionTime: "2024-01-01T09:00:00Z" message: Prep completed successfully observedGeneration: 5 reason: Completed status: "True" type: PrepCompleted - lastTransitionTime: "2024-01-01T09:00:00Z" message: |- Waiting for system to stabilize: one or more health checks failed - one or more ClusterOperators not yet ready: authentication - one or more MachineConfigPools not yet ready: master - one or more ClusterServiceVersions not yet ready: sriov-fec.v2.8.0 observedGeneration: 1 reason: InProgress status: "True" type: UpgradeInProgress observedGeneration: 1 rollbackAvailabilityExpiration: "2024-05-19T14:01:52Z" validNextStages: - RollbackOADP Operator は、OADP
BackupおよびRestoreCR で指定されたデータのバックアップを作成し、ターゲットクラスターが再起動します。次のコマンドを実行して、CR のステータスを監視します。
$ oc get ibu -o yamlアップグレード後、以下のコマンドを実行して
ImageBasedUpgradeCR のstageフィールドの値をIdleにパッチすることで変更を完了します。$ oc patch imagebasedupgrades.lca.openshift.io upgrade -p='{"spec": {"stage": "Idle"}}' --type=merge重要アップグレード後に
Idleステージに移行すると、変更をロールバックすることはできません。Lifecycle Agent は、アップグレードプロセス中に作成されたすべてのリソースを削除します。
- アップグレードが成功したら、OADP Operator とその設定ファイルを削除できます。詳細は、「クラスターからの Operator の削除」を参照してください。
検証
次のコマンドを実行して、
ImageBasedUpgradeCR のステータスを確認します。$ oc get ibu -o yaml以下の例は、アップグレードが完了した状態を示しています。
status: conditions: - lastTransitionTime: "2024-01-01T09:00:00Z" message: In progress observedGeneration: 5 reason: InProgress status: "False" type: Idle - lastTransitionTime: "2024-01-01T09:00:00Z" message: Prep completed observedGeneration: 5 reason: Completed status: "False" type: PrepInProgress - lastTransitionTime: "2024-01-01T09:00:00Z" message: Prep completed successfully observedGeneration: 5 reason: Completed status: "True" type: PrepCompleted - lastTransitionTime: "2024-01-01T09:00:00Z" message: Upgrade completed observedGeneration: 1 reason: Completed status: "False" type: UpgradeInProgress - lastTransitionTime: "2024-01-01T09:00:00Z" message: Upgrade completed observedGeneration: 1 reason: Completed status: "True" type: UpgradeCompleted observedGeneration: 1 rollbackAvailabilityExpiration: "2024-01-01T09:00:00Z" validNextStages: - Idle - Rollback次のコマンドを実行して、クラスターの復元ステータスを確認します。
$ oc get restores -n openshift-adp -o custom-columns=NAME:.metadata.name,Status:.status.phase,Reason:.status.failureReason以下の例は、復元が完了したケースを示しています。
NAME Status Reason acm-klusterlet Completed <none> apache-app Completed <none> localvolume Completed <none>注記acm-klusterletは RHACM 環境にのみ固有です。