Skip to content

dell/powerprotect-data-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dell PowerProtect Data Manager — Automation Solutions

Platform Python PowerShell License API Docs

A collection of automation solutions for Dell PowerProtect Data Manager covering asset management, protection policies, backup, recovery, Kubernetes data protection, and lifecycle operations — all via the PPDM REST API.


Contents


Prerequisites

Requirement Version
Python 3.x
PowerShell 7.x
requests pip install requests
urllib3 pip install urllib3
cryptography (secure_login_helper only) pip install cryptography
kubernetes (K8s scripts, optional) pip install kubernetes

All scripts accept -h / --help for a full argument reference:

python adhocbck.py -h

Quick Start

Most scripts share the same connection pattern: server, user, password, and an action flag.

# Ad-hoc backup of a VM by name (monitors until completion)
python adhocbck.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -a backup -n myvm01 -t vmw_vm

# Create a daily VM protection policy
python addpolicy.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -a create -n VMpolicy1 -asset testvm* \
  -storage_name DD2 -dm TSDM \
  -freq daily -stime 09:00:00 -d 2 -ret "3 days"

# Kubernetes self-service backup of a namespace
python ppdm_k8s_self_service.py -ppdm 10.0.0.1 -p "myPassword!" \
  -a backup -ns my-app -cl k8s_prod1

# Deploy a new PPDM appliance from a config file
python Python/ppdm_deploy/ppdm_deploy.py --config Python/ppdm_deploy/config.json

Tip: Avoid passing passwords in plain text — use the PPDM_PASSWORD environment variable or the Fernet-encrypted credential helper. See Authentication Helper.


Python Scripts

Protection Policies and Backup

Script Description
addpolicy.py Create or list VM and Kubernetes protection policies. Supports hourly, daily, weekly, and monthly schedules with configurable retention.
updateprotectionpolicyschedule.py Display or update the backup schedule of an existing protection policy for a given asset.
policy2dd.py Show the Data Domain storage mapping for one or all protection policies — displays DD name, NIC, and storage unit per policy stage.
adhocbck.py Run ad-hoc backups for VMware VMs, Hyper-V VMs, Nutanix VMs, NativeEdge VMs, PowerMax storage groups, PowerStore volume groups, or Kubernetes namespaces. Monitors activity to completion. Supports saving the activity ID to a file for pipeline chaining.

Example — create a daily VM protection policy:

python addpolicy.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -a create -n VMpolicy1 -asset testvm* \
  -storage_name DD2 -dm TSDM \
  -freq daily -stime 09:00:00 -d 2 -ret "3 days"

Example — ad-hoc backup with activity monitoring:

python adhocbck.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -a backup -n myvm01 -t vmw_vm

Supported asset types for adhocbck.py:

Flag Asset Type
vmw_vm VMware Virtual Machine (default)
hyperv_vm Hyper-V Virtual Machine
nutanix_vm Nutanix Virtual Machine
nativeedge_vm Dell NativeEdge VM
pmax PowerMax Storage Group
pstore PowerStore Volume Group
k8s Kubernetes Namespace

Recovery

Script Description
restorevmorig.py List available backups for a protected VM and restore to its original location using a specified backup ID.
filelevelrestore.py Perform file-level recovery (FLR) from a VM backup — mount a copy and retrieve individual files.

Example — restore a VM to its original location:

# List available backups first
python restorevmorig.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -n myvm01 -a get_backups

# Restore using a backup ID
python restorevmorig.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -n myvm01 -a recover -bckid <backup-id>

Kubernetes

Script Description
ppdm_k8s_self_service.py Self-service backup and restore for Kubernetes namespaces. Supports restore-to-namespace (RTN), restore-to-existing (RTE), and cross-cluster restore. Outputs results as text, JSON, or YAML.
ppdm_k8s_reporting.py Backup statistics report for protected Kubernetes namespaces — PVC counts, backup history, protection capacity, and unprotected namespace detection. Outputs as table, JSON, YAML, or CSV.
ppdm_exclude_pvc.py List, exclude, or include specific Persistent Volume Claims (PVCs) from Kubernetes backup policies. Supports batch exclusion via annotations and both the Python kubernetes client and native kubectl.
credsmgmt.py Add or remove Kubernetes service-account token credentials in PPDM used for cluster authentication.

Example — back up a Kubernetes namespace:

python ppdm_k8s_self_service.py -ppdm 10.0.0.1 -p "myPassword!" \
  -a backup -ns my-app -cl k8s_prod1

Example — restore a namespace to an alternate cluster:

python ppdm_k8s_self_service.py -ppdm 10.0.0.1 -envpassword \
  -a rte -ns my-app -cl k8s_prod1 \
  -alt-cluster k8s_dr1 -target-ns my-app-restored

Example — backup report (JSON output to file):

python ppdm_k8s_reporting.py -ppdm 10.0.0.1 -envpassword \
  -cl k8s_prod1 -o json -f report.json

Deployment and Upgrade

Folder / Script Description
ppdm_deploy/ Automated initial deployment and configuration of a freshly deployed PPDM appliance. Drives the first-run wizard via the REST API using a JSON config file.
ppdm_upgrade/ Automated PPDM upgrade — upload the upgrade package, run pre-checks, start the upgrade, and monitor progress.

Example — deploy a new PPDM appliance:

# Copy and edit the config template first
cp Python/ppdm_deploy/config-minimal.json my-config.json

# Run the deployment
python Python/ppdm_deploy/ppdm_deploy.py --config my-config.json

See the README.md inside each subfolder for full config reference.


Asset and Infrastructure Management

Script Description
assetmgmt.py Discover and list assets by inventory source type (vCenter, K8s, Data Domain). Triggers discovery jobs and monitors completion.
removeassetsrc.py List or remove inventory / asset sources (vCenter, Data Domain, Kubernetes clusters) by name, ID, or type.
certmgmt.py List or accept TLS certificates for PPDM-registered hosts (e.g. OpenShift API endpoints, vCenter).

Example — accept a certificate for a newly registered host:

python certmgmt.py -s 10.0.0.1 -usr admin -pwd "myPassword!" \
  -a accept -host api.mycluster.example.com

Authentication Helper

Two options are available to avoid passing passwords in plain text.

Option 1 — Environment Variable (simplest)

Scripts that support -envpassword / --env-password read the password from the PPDM_PASSWORD environment variable:

# Set once in your shell session
export PPDM_PASSWORD="myPassword!"          # Linux / macOS
$env:PPDM_PASSWORD = "myPassword!"         # PowerShell

# Then run any supporting script without -pwd
python ppdm_k8s_self_service.py -ppdm 10.0.0.1 -envpassword \
  -a backup -ns my-app -cl k8s_prod1

python ppdm_k8s_reporting.py -ppdm 10.0.0.1 -envpassword \
  -cl k8s_prod1 -o json

Scripts that support this flag include ppdm_k8s_self_service.py, ppdm_k8s_reporting.py, and ppdm_exclude_pvc.py.

Option 2 — Encrypted Credential File (persistent)

secure_login_helper.py encrypts PPDM credentials using Fernet symmetric encryption so scripts never need a plain-text password on the command line.

# Create encrypted credential files
python secure_login_helper.py \
  --secure-file-path c:\creds \
  --password "myPassword!" \
  --ppdm 10.0.0.1

# Clear plain-text password file after encryption
python secure_login_helper.py \
  --clear-password-file c:\creds\ppdm.pwd \
  --secure-file-path c:\creds

Requires: pip install cryptography


Documentation


Authors

Releases

No releases published

Packages

 
 
 

Contributors