A Python library for interacting with the Zerto Virtual Manager (ZVM) API.
This library provides a comprehensive Python interface to manage and automate Zerto Virtual Replication operations. It includes functionality for:
- Managing Virtual Protection Groups (VPGs)
- Handling VM protection and recovery
- Managing checkpoints and recovery points
- Monitoring alerts and events
- Managing licenses
- Configuring service profiles
- Handling encryption detection
- Managing datastores and VRAs
- Working with server date/time settings
- Managing ZORGs (Zerto Organizations)
git clone https://github.com/your-repo/zerto-python-library.git cd zerto-python-library pip install -r requirements.txt
- requests
- urllib3
- logging
- json
- typing
The library is organized into several modules:
zvml/- Core library componentsalerts.py- Alert management and monitoringcheckpoints.py- Checkpoint operations and managementcommon.py- Common enums and utilitiesencryptiondetection.py- Encryption detection functionalitylicense.py- License managementlocalsite.py- Local site operationsrecovery_reports.py- Recovery reporting functionalityserver_date_time.py- Server time operationsservice_profiles.py- Service profile configurationtasks.py- Task management and monitoringvirtualization_sites.py- Site management operationsvpgs.py- VPG operations and managementvras.py- VRA deployment and managementzorgs.py- ZORG operations
Each example script demonstrates specific functionality:
alerts_example.py - Simple alert monitoring and management (list, dismiss, undismiss):
python examples/alerts_example.py
--zvm_address "192.168.111.20"
--client_id "zerto-api"
--client_secret "your-secret-here"
--ignore_ssl
vpg_vms_example.py - VPG creation and VM management between VPGs:
python examples/vpg_vms_example.py
--zvm_address "192.168.111.20"
--client_id "zerto-api"
--client_secret "your-secret-here"
--ignore_ssl
vpg_failover_example.py - Complete VPG lifecycle including failover testing:
python examples/vpg_failover_example.py
--zvm_address "192.168.111.20"
--client_id "zerto-api"
--client_secret "your-secret-here"
--ignore_ssl
vras_example.py - Interactive VRA deployment and management:
python examples/vras_example.py
--zvm_address "192.168.111.20"
--client_id "zerto-api"
--client_secret "your-secret-here"
--ignore_ssl
zorgs_example.py - ZORG information retrieval and management:
python examples/zorgs_example.py
--zvm_address "192.168.111.20"
--client_id "zerto-api"
--client_secret "your-secret-here"
--ignore_ssl
- Python 3.6+
- Zerto Virtual Replication environment
- Network access to ZVM server
- Keycloak authentication credentials
- Clone the repository
- Install required dependencies
- Configure your Zerto environment credentials
- Run the example scripts to understand basic operations
- Integrate the library into your automation workflows
The library uses Keycloak authentication. You'll need:
- ZVM server address
- Client ID
- Client Secret
- Optional: SSL verification settings
The library includes comprehensive error handling and logging:
- Input validation
- Error status checking
- Detailed error messages
- Operation status logging
Contributions are welcome! Please feel free to submit a Pull Request.
This project includes a legal disclaimer. See the header of each file for details.
For detailed API documentation and examples, please refer to the individual module files and example scripts.