This repository contains Ansible playbooks for automating interactions with BlueXP Disaster Recovery as a Service (DRaaS). The provided playbooks allow you to manage access tokens, discover virtual machines, retrieve and edit replication plans, and get detailed information about virtual machines.
By accessing, downloading, installing or using the content in this repository, you agree the terms of the License laid out in License file.
Note that there are certain restrictions around producing and/or sharing any derivative works with the content in this repository. Please make sure you read the terms of the License before using the content. If you do not agree to all of the terms, do not access, download or use the content in this repository.
Copyright: 2025 NetApp Inc.
Before using these playbooks, ensure you have the following:
- Ansible installed on your machine.
- Valid credentials for BlueXP DRaaS.
- Refresh token and relevant IDs for your BlueXP account.
Purpose: Obtains an access token from BlueXP using the provided refresh token. This token is used for authenticating subsequent API calls.
Purpose: Discovers new virtual machines (VMs) to be added to the replication plan and refreshes existing VMs.
Purpose: Retrieves detailed information about all current replication plans. The gathered information is used for editing replication plans.
Purpose: Allows adjustments to the current replication plan in BlueXP DRaaS.
Purpose: Retrieves detailed information about all available VMs in the source vcenter.
All required variables are defined in the vars/env/extravars file. Ensure this file is updated with your specific details before running the playbooks.
- token: "" # Available at https://services.cloud.netapp.com/refresh-token
- clientid: "Mu0V1ywgYteI6w1MbD15fKfVIUrNXGWC" # No need to change this - Same for all api calls.
- agentid: "" # BlueXP Connector Agent ID
- authorization: "Bearer " #Put you access token after
Bearer, this will be obtained by running "access_token.yaml" playbook. - accountid: "" # BlueXP account ID
- replicationplanid: "" # Replication plan ID obtained through
get-replicationtask. - vcenterid: "" # Source VCenter ID - obtained Through
get-replicationtask.
Set Up Variables: Update the vars/env/extravars file with your specific values.
- Run
draas_runner.pyto get the access token:# This python script will automate the full cycle. You still can run the .yaml files separately (make sure to add the needed vars manually as this script automatically gather/restore the needed vars.) python3 draas_runner.py # After running this automation you can test the failover through the created ReplicationPlan, then you need to cleanup the test failover.
-
Run
access_token.yamlto get the access token:ansible-playbook access_token.yaml
-
Run
discovery.yamlto discover and refresh VMs:ansible-playbook discovery.yaml
-
Run
add-src-site.yamlto add a source to a site "info will be stored at vars/src_site.json".ansible-playbook add-src-site.yaml
-
Run
add-dest-site.yamlto add a dest to a site "info will be stored at vars/dest_site.json".ansible-playbook add-dest-site.yaml
-
Run
add-src-vcenter.yamlto add a source vcenter to a site. where you want run a failover for. "info will be stored at vars/src_vcenter.json" :ansible-playbook add-src-vcenter.yaml
-
Run
add-dest-vcenter.yamlto add a destination vcenter to a site. "info will be stored at vars/dest_vcenter.json":ansible-playbook add-dest-vcenter.yaml
-
Run
create_resourcegroupe.yamlto create a resource groupe "info will be stored at vars/src_site.json".ansible-playbook create_resourcegroupe.yaml
-
Run
create_replicationplan.yamlto create a replication plan (need the rg id) "info will be stored at vars/src_site.json".ansible-playbook create_resourcegroupe.yaml
-
Run
get-replicationplan.yamlto retrieve replication plans:ansible-playbook get-replicationplan.yaml
-
Run
edit-replication.yamlto edit the replication plan:ansible-playbook edit-replication.yaml
-
Run
get-vms.yamlto get all VMs details in a specified vCenter:ansible-playbook get-vms.yaml
-
Run
get-vm-details.yamlto get a specified VM information:ansible-playbook get-vm-details.yaml
-
Run
get-sitesto get all sites and their vCenters:ansible-playbook sites.yaml
-
Run
get-vcentersto get all vCenters information:ansible-playbook sites.yaml
Ensure that all necessary credentials and IDs are correctly set in the vars/env/extravars file before running the playbooks and the Python runner.
- Ayman Soliman - NetApp Solutions Engineering Team
- Pradeep Kumar - NetApp Solutions Engineering Team
- Niyaz Mohamed - NetApp Solutions Engineering Team