updated description in examples/vpg_setting_export_example_enhanced.py
This commit is contained in:
@@ -10,62 +10,60 @@
|
|||||||
# The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
|
# The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Zerto VPG Settings Export/Import Example Script
|
Zerto VPG Settings Export/Import Example Script
|
||||||
|
|
||||||
This script demonstrates how to export and import Virtual Protection Group (VPG) settings
|
This script demonstrates how to export and import Virtual Protection Group (VPG) settings
|
||||||
using the Zerto Virtual Manager (ZVM) API. It allows for backup and restoration of VPG
|
using the Zerto Virtual Manager (ZVM) API. It allows for backup and restoration of VPG
|
||||||
configurations, which is useful for disaster recovery planning and VPG replication.
|
configurations, which is useful for disaster recovery planning and VPG replication.
|
||||||
|
|
||||||
Key Features:
|
Key Features:
|
||||||
1. VPG Settings Export:
|
1. Export Selection:
|
||||||
- Export settings for specific VPGs or all VPGs
|
- List all available exports with timestamps and status
|
||||||
- Save exported settings to a JSON file
|
- Display VPGs in each export with source and target sites
|
||||||
- Include all VPG configuration parameters
|
- Compare requested VPGs with available ones in the export
|
||||||
- Capture recovery site mappings
|
- Allow user to select which export to use
|
||||||
|
|
||||||
2. Settings Verification:
|
2. Resource Validation:
|
||||||
- List all available exported settings
|
- Check and validate datastores, hosts, folders, and networks
|
||||||
- Read and display detailed settings
|
- Allow user to select replacements for missing resources
|
||||||
- Show summary of exported VPG configurations
|
- Handle both VPG-level and VM-level resource mappings
|
||||||
- Verify export timestamp and status
|
- Support for journal, scratch, and recovery settings
|
||||||
|
|
||||||
3. VPG Settings Import:
|
3. Settings Import:
|
||||||
- Import settings back to create new VPGs
|
- Import validated settings back to create new VPGs
|
||||||
- Restore original VPG configurations
|
- Display detailed import results including:
|
||||||
- Support for multiple VPGs in single operation
|
- Validation failures with error messages
|
||||||
- Validate import results
|
- Import failures with specific errors
|
||||||
|
- Successfully initiated imports with task IDs
|
||||||
|
- Allow user to verify changes before proceeding
|
||||||
|
|
||||||
Required Arguments:
|
Required Arguments:
|
||||||
--zvm_address: Protected site ZVM address
|
--zvm_address: Protected site ZVM address
|
||||||
--client_id: Protected site Keycloak client ID
|
--client_id: Protected site Keycloak client ID
|
||||||
--client_secret: Protected site Keycloak client secret
|
--client_secret: Protected site Keycloak client secret
|
||||||
--ignore_ssl: Ignore SSL certificate verification (optional)
|
--ignore_ssl: Ignore SSL certificate verification (optional)
|
||||||
--vpg_names: Comma-separated list of VPG names to export (optional)
|
--vpg_names: Comma-separated list of VPG names to process (optional)
|
||||||
--output_file: File path to save exported settings (optional)
|
|
||||||
|
|
||||||
Example Usage:
|
Example Usage:
|
||||||
python examples/vpg_setting_export_example.py \
|
python examples/vpg_setting_export_example_enhanced.py \
|
||||||
--zvm_address "192.168.111.20" \
|
--zvm_address "192.168.111.20" \
|
||||||
--client_id "zerto-api" \
|
--client_id "zerto-api" \
|
||||||
--client_secret "your-secret-here" \
|
--client_secret "your-secret-here" \
|
||||||
--vpg_names "VpgTest1,VpgTest2" \
|
--vpg_names "VpgTest1,VpgTest2" \
|
||||||
--output_file "vpg_settings.json" \
|
|
||||||
--ignore_ssl
|
--ignore_ssl
|
||||||
|
|
||||||
Script Flow:
|
Script Flow:
|
||||||
1. Connects to protected site ZVM
|
1. Connect to protected site ZVM
|
||||||
2. Exports VPG settings:
|
2. List available exports and let user select one
|
||||||
- For specified VPGs if vpg_names provided
|
3. Display VPGs in selected export and compare with requested ones
|
||||||
- For all VPGs if no vpg_names specified
|
4. Get peer site resources (datastores, hosts, folders, networks)
|
||||||
3. Saves settings to file if output_file specified
|
5. Validate and update resource mappings:
|
||||||
4. Verifies export by reading settings
|
- VPG-level settings (journal, scratch, recovery)
|
||||||
5. Displays VPG configuration summaries:
|
- VM-level settings (host, datastore, folder, network)
|
||||||
- VPG names
|
6. Save updated settings to file
|
||||||
- Source and target sites
|
7. Allow user to verify changes
|
||||||
- RPO and journal history
|
8. Import settings to recreate VPGs
|
||||||
6. Pauses for manual VPG deletion
|
9. Display import results with task IDs
|
||||||
7. Imports settings to recreate VPGs
|
|
||||||
8. Verifies import success
|
|
||||||
|
|
||||||
Note: This script requires only protected site credentials. It's designed for VPG
|
Note: This script requires only protected site credentials. It's designed for VPG
|
||||||
configuration backup and restore scenarios, allowing you to quickly recreate VPGs
|
configuration backup and restore scenarios, allowing you to quickly recreate VPGs
|
||||||
|
|||||||
Reference in New Issue
Block a user