The below playbook will query the Copies for a Specific Asset defined by namespace_name
ansible-playbook ~/workspace/ansible_ppdm/30.2-playbook_get_k8s_asset_copies.yml -e "namespace_name=wordpress"
We run the example restore Playbook to restore the latest copy to a new namespace test1:
ansible-playbook ~/workspace/ansible_ppdm/40.2-playbook_restore_k8s_asset_copies.yml -e "namespace_name=wordpress" -e "target_namespace_name=test1"
with the activity id from aboves command, we montitor the activity:
ansible-playbook ~/workspace/ansible_ppdm/31.1-playbook_get_activities.yml -e "activity_id=<activity_id from above>"
We can see that the Restore failed with the following:
“code”: “ARK0012”, “detailedDescription”: “The restore of this Kubernetes namespace was unsuccessful because the specified configuration is unsupported.”, “extendedReason”: “Unable to setup Restore Volumes. Cannot find PersistentVolume bound to PVC ‘mariadb’. Volume binding mode ‘WaitForFirstConsumer’ is not supported.”, “reason”: “Unable to restore namespace ‘wordpress’ to Kubernetes cluster ‘api.openshift.demo.local’ because of an unsupported configuration.”, “remediation”: “To troubleshoot this issue: If the volumes are being provisioned by a VMware CSI driver, verify that the binding mode of the persistent volumes is immediate. Export the job logs and review the log files for more information. If the issue persists, contact Dell Customer Support.”
WaitForFirstConsumer Binding Mode would wait to create the PV until the cProxy POD is Scheduled. In case of FCD´s ( Cloud Native Storage ), the cProxy leverages VADP, so no volume will be mounted. RedHat defaults to WaitForFirstConsumer, and as a Consequence, we need to restore to a Storage class with Binding Mode Immediate.
A new Storage Class is provided in the lab with same configuration, but leveraging a Immediate Binding Mode. Apply the storageclass with:
oc apply -f thin-csi-immediate.yaml
and aset the thin-csi to not being the default sc
oc patch sc thin-csi -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
oc get sc
The restore playbook allows us to specify an alternate_storageclass to restore to.
ansible-playbook ~/workspace/ansible_ppdm/40.2-playbook_restore_k8s_asset_copies.yml -e "namespace_name=wordpress" -e "target_namespace_name=test2" -e "alternate_storageclass=thin-csi-immediate"
Montiro the activity as before with
ansible-playbook ~/workspace/ansible_ppdm/31.1-playbook_get_activities.yml -e "activity_id=<activity_id from above>"