Skip to main content
NetApp Solutions
본 한국어 번역은 사용자 편의를 위해 제공되는 기계 번역입니다. 영어 버전과 한국어 버전이 서로 어긋나는 경우에는 언제나 영어 버전이 우선합니다.

Trident Protect를 사용한 OpenShift 가상화에서 VM에 대한 데이터 보호

기여자

참조 문서의 이 섹션에서는 Trident Protect를 사용하여 VM의 스냅샷 및 백업을 생성하는 방법에 대한 세부 정보를 제공합니다.

OpenShift 가상화 환경의 가상 머신은 OpenShift Container 플랫폼의 작업자 노드에서 실행되는 컨테이너화된 애플리케이션입니다. VM 메타데이터와 VM의 영구 디스크를 보호하여 VM이 손실되거나 손상된 경우 복구할 수 있도록 하는 것이 중요합니다.

를 사용하여 OpenShift 클러스터에 통합된 ONTAP 스토리지를 통해 OpenShift 가상화 VM의 영구 디스크를 백업할 수 "Trident CSI입니다"있습니다. 이 섹션에서는 "Trident 보호"ONTAP 오브젝트 스토리지에 대한 데이터 볼륨을 포함하여 VM의 스냅샷 및 백업을 생성하는 데 사용합니다.

그런 다음 필요한 경우 스냅샷 또는 백업에서 복원합니다.

Trident Protect는 OpenShift 클러스터에서 애플리케이션 및 VM의 스냅샷, 백업, 복원, 재해 복구를 지원합니다. OpenShift 가상화 VM의 경우 Trident Protect로 보호할 수 있는 데이터에는 VM과 연결된 Kubernetes 리소스 객체, 영구 볼륨 및 내부 이미지가 포함됩니다.

다음은 이 단원의 예제에 사용된 다양한 구성 요소의 버전입니다

AppVault 작성

애플리케이션 또는 VM에 대한 스냅샷과 백업을 생성하기 전에 Trident Protect에서 스냅샷과 백업을 저장할 객체 스토리지를 구성해야 합니다. 이 작업은 Bucket CR을 사용하여 수행합니다. 관리자만 Bucket CR을 생성하고 구성할 수 있습니다. 버킷 CR은 Trident Protect에서 AppVault로 알려져 있습니다. AppVault 개체는 스토리지 버킷의 선언적 Kubernetes 워크플로우 표현입니다. AppVault CR에는 백업, 스냅샷, 복원 작업 및 SnapMirror 복제와 같은 보호 작업에 사용되는 버킷에 필요한 구성이 포함되어 있습니다.

이 예에서는 ONTAP S3를 오브젝트 스토리지로 사용하는 것을 보여 줍니다. 다음은 ONTAP S3:1용 AppVault CR을 생성하기 위한 워크플로입니다. ONTAP 클러스터의 SVM에 S3 오브젝트 저장소 서버를 생성합니다. 2. 오브젝트 저장소 서버에 버킷을 생성합니다. 3. SVM에서 S3 사용자를 생성합니다. 액세스 키와 비밀 키를 안전한 위치에 보관합니다. 4. OpenShift에서 ONTAP S3 자격 증명을 저장할 암호를 생성합니다. 5. ONTAP S3에 대한 AppVault 개체를 만듭니다

  • ONTAP S3에 대한 Trident Protect AppVault 구성**

# alias tp='tridentctl-protect'

# cat appvault-secret.yaml
apiVersion: v1
stringData:
  accessKeyID: "<access key of S3>"
  secretAccessKey: "<secret access key of S3>"
# you can also provide base 64 encoded values instead of string values
#data:
# base 64 encoded values
#  accessKeyID: < base 64 encoded access key>
#  secretAccessKey: <base 64 encoded secretAccess key>
kind: Secret
metadata:
  name: appvault-secret
  namespace: trident-protect
type: Opaque

# cat appvault.yaml
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
  name: ontap-s3-appvault
  namespace: trident-protect
spec:
  providerConfig:
    azure:
      accountName: ""
      bucketName: ""
      endpoint: ""
    gcp:
      bucketName: ""
      projectID: ""
    s3:
      bucketName: trident-protect
      endpoint: <lif for S3 access>
      secure: "false"
      skipCertValidation: "true"
  providerCredentials:
    accessKeyID:
      valueFromSecret:
        key: accessKeyID
        name: appvault-secret
    secretAccessKey:
      valueFromSecret:
        key: secretAccessKey
        name: appvault-secret
  providerType: OntapS3

# oc create -f appvault-secret.yaml -n trident-protect
# oc create -f appvault.yaml -n trident-protect

ONTAP S3 Appvault가 생성되었습니다

OpenShift Virtualization에서 VM을 생성합니다

다음 스크린 샷은 템플릿을 사용하여 콘솔에서 VM(demo - powerror in namespace demo)을 생성하는 것을 보여줍니다. 루트 디스크는 기본 스토리지 클래스를 자동으로 선택하므로 기본 스토리지 클래스가 적절하게 설정되어 있는지 확인합니다. 이 설정에서 기본 저장소 클래스는 SC-ZoneA-SAN입니다. 추가 디스크를 만들 때 SC-ZoneA-SAN 스토리지 클래스를 선택하고 " Optimized storage settings 적용" 확인란을 선택합니다. 그러면 액세스 모드가 rwx로 설정되고 볼륨 모드가 Block으로 설정됩니다.

참고 Trident는 SAN(iSCSI, NVMe/TCP 및 FC)에 대한 블록 볼륨 모드에서 rwx 액세스 모드를 지원합니다. (NAS의 기본 액세스 모드입니다.) 나중에 VM의 실시간 마이그레이션을 수행해야 하는 경우 rwx 액세스 모드가 필요합니다.

기본 스토리지 클래스입니다

Fedora VM을 생성합니다

템플릿 기본값

사용자 지정

디스크를 추가합니다

디스크가 추가되었습니다

VM, Pod 및 PVC가 생성되었습니다

앱을 만듭니다
  • VM용 Trident 보호 앱을 만듭니다**

이 예에서 데모 네임스페이스에는 하나의 VM이 있으며 앱을 만들 때 네임스페이스의 모든 리소스가 포함됩니다.

# alias tp='tridentctl-protect'
# tp create app demo-vm --namespaces demo -n demo --dry-run > app.yaml

# cat app.yaml
apiVersion: protect.trident.netapp.io/v1
kind: Application
metadata:
  creationTimestamp: null
  name: demo-vm
  namespace: demo
spec:
  includedNamespaces:
  - namespace: demo
# oc create -f app.yaml -n demo

앱이 생성되었습니다

백업을 생성합니다
  • 주문형 백업 생성**

데모 네임스페이스의 모든 리소스를 포함하는 이전에 생성된 애플리케이션(데모 VM)에 대한 백업을 생성합니다. 백업을 저장할 appvault 이름을 입력합니다.

# tp create backup demo-vm-backup-on-demand --app demo-vm --appvault ontap-s3-appvault -n demo
Backup "demo-vm-backup-on-demand" created.

필요 시 백업이 생성되었습니다

  • 일정에 백업 생성**

보존할 백업의 세분화 수준 및 수를 지정하여 백업에 대한 스케줄을 생성합니다.

# tp create schedule backup-schedule1 --app demo-vm --appvault ontap-s3-appvault --granularity Hourly --minute 45 --backup-retention 1 -n demo --dry-run>backup-schedule-demo-vm.yaml
schedule.protect.trident.netapp.io/backup-schedule1 created

#cat backup-schedule-demo-vm.yaml
apiVersion: protect.trident.netapp.io/v1
kind: Schedule
metadata:
  creationTimestamp: null
  name: backup-schedule1
  namespace: demo
spec:
  appVaultRef: ontap-s3-appvault
  applicationRef: demo-vm
  backupRetention: "1"
  dayOfMonth: ""
  dayOfWeek: ""
  enabled: true
  granularity: Hourly
  hour: ""
  minute: "45"
  recurrenceRule: ""
  snapshotRetention: "0"
status: {}
# oc create -f backup-schedule-demo-vm.yaml -n demo

백업 일정이 생성되었습니다

필요 시 및 일정에 따라 생성된 백업

백업에서 복원합니다
  • VM을 동일한 네임스페이스로 복원합니다**

이 예에서는 백업 demo-vm-backup-on-demand에 Fedora VM용 데모 앱을 사용한 백업이 포함되어 있습니다.

먼저 VM을 삭제하고 PVC, Pod 및 VM 개체가 네임스페이스에서 "demo"인지 확인합니다.

Fedora - VM이 삭제되었습니다

이제 백업 이동 없이 복원 객체를 만듭니다.

# tp create bir demo-fedora-restore --backup demo/demo-vm-backup-on-demand -n demo --dry-run>vm-demo-bir.yaml

# cat vm-demo-bir.yaml
apiVersion: protect.trident.netapp.io/v1
kind: BackupInplaceRestore
metadata:
  annotations:
    protect.trident.netapp.io/max-parallel-restore-jobs: "25"
  creationTimestamp: null
  name: demo-fedora-restore
  namespace: demo
spec:
  appArchivePath: demo-vm_cc8adc7a-0c28-460b-a32f-0a7b3d353e13/backups/demo-vm-backup-on-demand_f6af3513-9739-480e-88c7-4cca45808a80
  appVaultRef: ontap-s3-appvault
  resourceFilter: {}
status:
  postRestoreExecHooksRunResults: null
  state: ""

# oc create -f vm-demo-bir.yaml -n demo
backupinplacerestore.protect.trident.netapp.io/demo-fedora-restore created

Bir이 생성되었습니다

VM, Pod 및 PVC가 복구되었는지 확인합니다

복원된 VM이 생성되었습니다

  • VM을 다른 네임스페이스로 복원합니다**

먼저 앱을 복원할 새 네임스페이스를 만듭니다. 이 예에서는 demo2입니다. 그런 다음 백업 복구 객체를 생성합니다

# tp create br demo2-fedora-restore --backup demo/hourly-4c094-20250312154500 --namespace-mapping demo:demo2 -n demo2 --dry-run>vm-demo2-br.yaml

# cat vm-demo2-br.yaml
apiVersion: protect.trident.netapp.io/v1
kind: BackupRestore
metadata:
  annotations:
    protect.trident.netapp.io/max-parallel-restore-jobs: "25"
  creationTimestamp: null
  name: demo2-fedora-restore
  namespace: demo2
spec:
  appArchivePath: demo-vm_cc8adc7a-0c28-460b-a32f-0a7b3d353e13/backups/hourly-4c094-20250312154500_aaa14543-a3fa-41f1-a04c-44b1664d0f81
  appVaultRef: ontap-s3-appvault
  namespaceMapping:
  - destination: demo2
    source: demo
  resourceFilter: {}
status:
  conditions: null
  postRestoreExecHooksRunResults: null
  state: ""
# oc create -f vm-demo2-br.yaml -n demo2

BR이 생성되었습니다

VM, Pod 및 PVC가 새 네임스페이스 demo2에 생성되었는지 확인합니다.

새 네임스페이스의 VM입니다

스냅샷을 생성합니다
  • 주문형 스냅샷 생성** 앱에 대한 스냅샷을 생성하고 저장할 appvault를 지정합니다.

# tp create snapshot demo-vm-snapshot-ondemand --app demo-vm --appvault ontap-s3-appvault -n demo --dry-run
# cat demo-vm-snapshot-on-demand.yaml
apiVersion: protect.trident.netapp.io/v1
kind: Snapshot
metadata:
  creationTimestamp: null
  name: demo-vm-snapshot-ondemand
  namespace: demo
spec:
  appVaultRef: ontap-s3-appvault
  applicationRef: demo-vm
  completionTimeout: 0s
  volumeSnapshotsCreatedTimeout: 0s
  volumeSnapshotsReadyToUseTimeout: 0s
status:
  conditions: null
  postSnapshotExecHooksRunResults: null
  preSnapshotExecHooksRunResults: null
  state: ""

# oc create -f demo-vm-snapshot-on-demand.yaml
snapshot.protect.trident.netapp.io/demo-vm-snapshot-ondemand created

OnDemand 스냅샷

  • 스냅샷에 대한 일정 생성** 스냅샷에 대한 일정을 생성합니다. 보존할 스냅샷 수와 세분화를 지정합니다.

# tp create Schedule snapshot-schedule1 --app demo-vm --appvault ontap-s3-appvault --granularity Hourly --minute 50 --snapshot-retention 1 -n demo --dry-run>snapshot-schedule-demo-vm.yaml

# cat snapshot-schedule-demo-vm.yaml
apiVersion: protect.trident.netapp.io/v1
kind: Schedule
metadata:
  creationTimestamp: null
  name: snapshot-schedule1
  namespace: demo
spec:
  appVaultRef: ontap-s3-appvault
  applicationRef: demo-vm
  backupRetention: "0"
  dayOfMonth: ""
  dayOfWeek: ""
  enabled: true
  granularity: Hourly
  hour: ""
  minute: "50"
  recurrenceRule: ""
  snapshotRetention: "1"
status: {}

# oc create -f snapshot-schedule-demo-vm.yaml
schedule.protect.trident.netapp.io/snapshot-schedule1 created

스냅샷에 대한 스케줄입니다

예약된 스냅샷

스냅샷에서 복원합니다
  • 스냅샷에서 동일한 네임스페이스로 VM 복원** demo2 네임스페이스에서 VM demo-Fedora를 삭제합니다.

VM 삭제

VM의 스냅샷에서 스냅샷 이동 없는 복원 객체를 생성합니다.

# tp create sir demo-fedora-restore-from-snapshot --snapshot demo/demo-vm-snapshot-ondemand -n demo --dry-run>vm-demo-sir.yaml

# cat vm-demo-sir.yaml
apiVersion: protect.trident.netapp.io/v1
kind: SnapshotInplaceRestore
metadata:
  creationTimestamp: null
  name: demo-fedora-restore-from-snapshot
  namespace: demo
spec:
  appArchivePath: demo-vm_cc8adc7a-0c28-460b-a32f-0a7b3d353e13/snapshots/20250318132959_demo-vm-snapshot-ondemand_e3025972-30c0-4940-828a-47c276d7b034
  appVaultRef: ontap-s3-appvault
  resourceFilter: {}
status:
  conditions: null
  postRestoreExecHooksRunResults: null
  state: ""

# oc create -f vm-demo-sir.yaml
snapshotinplacerestore.protect.trident.netapp.io/demo-fedora-restore-from-snapshot created

선생님

VM 및 해당 PVC가 데모 네임스페이스에서 생성되었는지 확인합니다.

VM이 동일한 네임스페이스에서 복원되었습니다

  • 스냅샷에서 다른 네임스페이스로 VM 복원**

이전에 백업에서 복구된 demo2 네임스페이스의 VM을 삭제합니다.

VM, PVC를 삭제합니다

스냅샷에서 스냅샷 복구 객체를 생성하고 네임스페이스 매핑을 제공합니다.

# tp create sr demo2-fedora-restore-from-snapshot --snapshot demo/demo-vm-snapshot-ondemand --namespace-mapping demo:demo2 -n demo2 --dry-run>vm-demo2-sr.yaml

# cat vm-demo2-sr.yaml
apiVersion: protect.trident.netapp.io/v1
kind: SnapshotRestore
metadata:
  creationTimestamp: null
  name: demo2-fedora-restore-from-snapshot
  namespace: demo2
spec:
  appArchivePath: demo-vm_cc8adc7a-0c28-460b-a32f-0a7b3d353e13/snapshots/20250318132959_demo-vm-snapshot-ondemand_e3025972-30c0-4940-828a-47c276d7b034
  appVaultRef: ontap-s3-appvault
  namespaceMapping:
  - destination: demo2
    source: demo
  resourceFilter: {}
status:
  postRestoreExecHooksRunResults: null
  state: ""

# oc create -f vm-demo2-sr.yaml
snapshotrestore.protect.trident.netapp.io/demo2-fedora-restore-from-snapshot created

SR이 생성되었습니다

VM 및 해당 PVC가 새 네임스페이스 demo2에서 복구되었는지 확인합니다.

VM이 새 네임스페이스에서 복원되었습니다

네임스페이스에서 특정 VM을 선택하여 스냅샷/백업 및 복구 생성

이전 예에서는 네임스페이스 내에 단일 VM이 있었습니다. 백업에 전체 네임스페이스를 포함함으로써 해당 VM과 관련된 모든 리소스를 캡처했습니다. 다음 예에서는 동일한 네임스페이스에 다른 VM을 추가하고 레이블 선택기를 사용하여 이 새 VM에 대한 앱을 만듭니다.

  • 데모 네임스페이스에 새 VM(데모-CentOS VM)을 만듭니다**

데모 - 데모 네임스페이스의 CentOS VM입니다

  • 데모 - CentOS VM 및 관련 리소스에 레이블을 지정합니다.*

라벨 데모 - CentOS VM, PVC

  • DEMO-CentOS VM 및 PVC에 레이블이 있는지 확인합니다.*

데모 - CentOS VM 레이블

데모 - CentOS PVC 라벨이 있습니다

  • 라벨 선택기를 사용하여 특정 VM(데모-CentOS)에 대해서만 앱을 생성합니다**

# tp create app demo-centos-app --namespaces 'demo(category=protect-demo-centos)' -n demo --dry-run>demo-centos-app.yaml

# cat demo-centos-app.yaml

apiVersion: protect.trident.netapp.io/v1
kind: Application
metadata:
  creationTimestamp: null
  name: demo-centos-app
  namespace: demo
spec:
  includedNamespaces:
  - labelSelector:
      matchLabels:
        category: protect-demo-centos
    namespace: demo
status:
  conditions: null

# oc create -f demo-centos-app.yaml -n demo
application.protect.trident.netapp.io/demo-centos-app created

데모 - CentOS PVC 라벨이 있습니다

필요 시 스케줄에 따라 백업 및 스냅샷을 생성하는 방법은 앞에서 설명한 방법과 동일합니다. 스냅샷 또는 백업을 생성하는 데 사용되는 Trident-Protect 앱은 네임스페이스의 특정 VM만 포함하므로 이 앱에서 복원하면 특정 VM만 복원됩니다. 백업/복구 작업의 예는 다음과 같습니다.

  • 해당 앱을 사용하여 네임스페이스에서 특정 VM의 백업을 만듭니다**

이전 단계에서는 레이블 선택기를 사용하여 데모 네임스페이스에 CentOS VM만 포함하도록 앱을 만들었습니다. 이 앱에 대한 백업(이 예에서는 필요 시 백업)을 생성합니다.

# tp create backup demo-centos-backup-on-demand --app demo-centos-app --appvault ontap-s3-appvault -n demo
Backup "demo-centos-backup-on-demand" created.

특정 VM의 백업이 생성되었습니다

  • 특정 VM을 동일한 네임스페이스로 복원** 특정 VM(CentOS)의 백업이 해당 앱을 사용하여 생성되었습니다. 이 위치에서 백업 위치 복원 또는 백업 복원이 생성된 경우 이 특정 VM만 복원됩니다. CentOS VM을 삭제합니다.

CentOS VM이 있습니다

CentOS VM이 삭제되었습니다

demo-CentOS-backup-on-demand에서 백업 데이터 이동 없이 복구를 생성하고 CentOS VM이 다시 생성되었는지 확인합니다.

#tp create bir demo-centos-restore --backup demo/demo-centos-backup-on-demand -n demo
BackupInplaceRestore "demo-centos-restore" created.

CentOS VM Bir을 생성합니다

CentOS VM이 생성되었습니다

  • 특정 VM을 다른 네임스페이스로 복원** demo-CentOS-backup-on-demand에서 다른 네임스페이스(demo3)로 백업 복구를 생성하고 CentOS VM이 다시 생성되었는지 확인합니다.

# tp create br demo2-centos-restore --backup demo/demo-centos-backup-on-demand --namespace-mapping demo:demo3 -n demo3
BackupRestore "demo2-centos-restore" created.

CentOS VM Bir을 생성합니다

CentOS VM이 생성되었습니다