This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.3.7. ボリュームスナップショットの復元
VolumeSnapshot
CRD コンテンツは、既存のボリュームを以前の状態に復元するために使用されます。
VolumeSnapshot
CRD がバインドされ、readyToUse
値が true
に設定された後に、そのリソースを使用して、スナップショットからのデータが事前に設定されている新規ボリュームをプロビジョニングできます。
前提条件
- 実行中の OpenShift Container Platform クラスターにログインしている。
- ボリュームスナップショットをサポートする Container Storage Interface (CSI) ドライバーを使用して作成される永続ボリューム要求 (PVC)。
- ストレージバックエンドをプロビジョニングするストレージクラス。
手順
以下のように PVC に
VolumeSnapshot
データソースを指定します。pvc-restore.yaml
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: myclaim-restore spec: storageClassName: csi-hostpath-sc dataSource: name: mysnap 1 kind: VolumeSnapshot 2 apiGroup: snapshot.storage.k8s.io 3 accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
以下のコマンドを実行して PVC を作成します。
$ oc create -f pvc-restore.yaml
以下のコマンドを実行して、復元された PVC が作成されていることを確認します。
$ oc get pvc
2 つの異なる PVC が表示されます。