---
# System prepended metadata

title: volsync 0.6.0 test

---

# volsync 0.6.0 test

## configs
```
cs.yml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: oadp-operator-catalog
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  #image: registry-proxy.engineering.redhat.com/rh-osbs/iib@sha256:eb920c8defa5564bcd59e6d52007be05e1002b769a072c4a60a2bfa15a677766
  image: brew.registry.redhat.io/rh-osbs/iib@sha256:eb920c8defa5564bcd59e6d52007be05e1002b769a072c4a60a2bfa15a677766
  displayName: OADP Operator Catalog
  publisher: grpc
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: volsync-operator-catalog
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  #image: registry-proxy.engineering.redhat.com/rh-osbs/iib@sha256:565ed904022a24fd9dfc2c9abf0b31e97505534b611e621fa921321dad91bfcc
  image: brew.registry.redhat.io/rh-osbs/iib@sha256:565ed904022a24fd9dfc2c9abf0b31e97505534b611e621fa921321dad91bfcc
  displayName: Volsync Operator Catalog
  publisher: grpc
```
icsp.yml
```
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: brew-registry
spec:
  repositoryDigestMirrors:
  - mirrors:
    - brew.registry.redhat.io
    source: registry.redhat.io
  - mirrors:
    - brew.registry.redhat.io
    source: registry.stage.redhat.io
  - mirrors:
    - brew.registry.redhat.io
    source: registry-proxy.engineering.redhat.com
```
oadp_dpa.yml
```
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: dpa-sample
  namespace: openshift-adp
spec:
  features:
    dataMover: 
      enable: true
      credentialName: restic-secret
  backupLocations:
    - name: default
      velero:
        provider: aws
        default: true
        objectStorage:
          bucket: cvpbucketuswest2
          prefix: velero
        config:
          region: us-west-2
          profile: "default"
        credential:
          name: cloud-credentials
          key: cloud
  configuration:
    restic:
      enable: false
    velero:
      defaultPlugins:
        - openshift
        - aws
        - csi
      featureFlags:
        - EnableCSI
  snapshotLocations:
    - name: default
      velero:
        provider: aws
        config:
          region: us-west-2
          profile: "default"
```
oadp_gp2_csi_storage_class.yaml
```
apiVersion: storage.k8s.io/v1
allowVolumeExpansion: true
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  name: gp2-csi
parameters:
  type: gp2
provisioner: ebs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
 oadp_volumesnapshotclass.yaml
---
apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Retain
driver: ebs.csi.aws.com
kind: VolumeSnapshotClass
metadata:
  annotations:
    snapshot.storage.kubernetes.io/is-default-class: "true"
  labels:
    velero.io/csi-volumesnapshot-class: "true"
  name: csi-aws-vsc-test
---
apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Delete
driver: ebs.csi.aws.com
kind: VolumeSnapshotClass
metadata:
  annotations:
    snapshot.storage.kubernetes.io/is-default-class: "false"
  name: csi-aws-vscoperatorgroup.yml
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: oadp-operator
  namespace: openshift-adp
spec:
  targetNamespaces:
  - openshift-adp
```
restic_secret.yml
```
apiVersion: v1
kind: Secret
metadata:
  name: restic-secret
type: Opaque
stringData:
  # The repository encryption key
  RESTIC_PASSWORD: resticpassword
```
sub.yml
```
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: redhat-oadp-operator
  namespace: openshift-adp
  labels:
    operators.coreos.com/redhat-oadp-operator.openshift-adp: ''
spec:
  channel: stable-1.1
  installPlanApproval: Automatic
  name: redhat-oadp-operator
  source: oadp-operator-catalog
  sourceNamespace: openshift-marketplace
  targetNamespace: openshift-adp
  startingCSV: oadp-operator.v1.1.1
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: volsync-product
  namespace: openshift-operators
  labels:
    operators.coreos.com/volsync-product.openshift-operators: ''
spec:
  channel: stable
  installPlanApproval: Automatic
  name: volsync-product
  source: volsync-operator-catalog
  sourceNamespace: openshift-marketplace
  startingCSV: volsync-product.v0.6.0

```

## namespace annotation
```
[whayutin@thinkdoe oadp_tmp]$ oc get namespace openshift-adp -o yaml
apiVersion: v1
kind: Namespace
metadata:
  annotations:
    openshift.io/sa.scc.mcs: s0:c30,c20
    openshift.io/sa.scc.supplemental-groups: 1000910000/10000
    openshift.io/sa.scc.uid-range: 1000910000/10000
    volsync.backube/privileged-movers: "true"
  creationTimestamp: "2023-01-04T21:15:28Z"
  labels:
    kubernetes.io/metadata.name: openshift-adp
    olm.operatorgroup.uid/45d0d1ab-27d3-4bd1-bf82-b2b0144956b8: ""
    pod-security.kubernetes.io/audit: privileged
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/warn: privileged
  name: openshift-adp
  resourceVersion: "1177426"
  uid: 72edcefc-6f4a-44eb-9419-d10975b4c5d9
spec:
  finalizers:
  - kubernetes
status:
  phase: Active

```

## backup status
```
[whayutin@thinkdoe mysql]$ oc get backup/mysql-persistent-6332315 -n openshift-adp -o yaml
apiVersion: velero.io/v1
kind: Backup
metadata:
  annotations:
    velero.io/source-cluster-k8s-gitversion: v1.24.0+dc5a2fd
    velero.io/source-cluster-k8s-major-version: "1"
    velero.io/source-cluster-k8s-minor-version: "24"
  creationTimestamp: "2023-01-04T21:18:52Z"
  generation: 6
  labels:
    velero.io/storage-location: dpa-sample-1
  name: mysql-persistent-6332315
  namespace: openshift-adp
  resourceVersion: "1185043"
  uid: 93218720-6bbd-458b-8a1f-85e7325bccb4
spec:
  csiSnapshotTimeout: 10m0s
  defaultVolumesToRestic: false
  includedNamespaces:
  - mysql-persistent
  storageLocation: dpa-sample-1
  ttl: 720h0m0s
  volumeSnapshotLocations:
  - dpa-sample-1
status:
  completionTimestamp: "2023-01-04T21:26:03Z"
  csiVolumeSnapshotsAttempted: 2
  csiVolumeSnapshotsCompleted: 2
  expiration: "2023-02-03T21:18:52Z"
  formatVersion: 1.1.0
  phase: Completed
  progress:
    itemsBackedUp: 84
    totalItems: 84
  startTimestamp: "2023-01-04T21:18:52Z"
  version: 1


```
```
 /tmp/oc get vsb -n mysql-persistent
NAME        AGE
vsb-lw9cn   2m39s
vsb-zhsj5   6s

```

## restore status
```
[whayutin@thinkdoe mysql]$ oc get restore/mysql-persistent-6332315 -n openshift-adp -o yaml
apiVersion: velero.io/v1
kind: Restore
metadata:
  creationTimestamp: "2023-01-04T21:26:43Z"
  generation: 11
  name: mysql-persistent-6332315
  namespace: openshift-adp
  resourceVersion: "1187490"
  uid: 65ca118b-09ca-45bd-94e0-942a6ba8efa0
spec:
  backupName: mysql-persistent-6332315
  excludedResources:
  - nodes
  - events
  - events.events.k8s.io
  - backups.velero.io
  - restores.velero.io
  - resticrepositories.velero.io
  restorePVs: true
status:
  completionTimestamp: "2023-01-04T21:28:43Z"
  phase: Completed
  progress:
    itemsRestored: 49
    totalItems: 49
  startTimestamp: "2023-01-04T21:26:43Z"
  warnings: 5


[whayutin@thinkdoe mysql]$ oc get vsr -n mysql-persistent
NAME        AGE
vsr-7fxqt   72s
vsr-9zrrg   75s
```




## Result
S * U * C * C * E * S * S

 * required for success
 ```
 oc annotate --overwrite namespace/openshift-adp volsync.backube/privileged-movers='true'
 ```



## datamover logs
https://termbin.com/iwmbv