VMware Aria Operations – Backup & Export Configuration

In this blog we have covered the 2 methods of taking Backup of your VMware Aria Operations (vRealize Operations Manager) configuration.

VMware Aria Operations introduced a feature called Content Management in version 8.2 back in October 2020.

Content Management helps the Customers to Backup and Export their configuration of VMware Aria Operations which can be further used to restore the configuration like Dashboards, Views, Report Templates, Supremetrics and a lot more in case you run into issues with the deployment.

We have covered two methods of taking a Backup and Export of VMware Aria Operations Configuration – First one, using the Content Management Tab under Administration in VMware Aria Operations UI and Second one, using a Python Script which makes use of the native APIs of Aria Operations.

Python script which we have developed has been tested on Python 3.10.10 version and Aria Operations 8.10 version. This script can also be scheduled as a Scheduled Task to take periodic configuration backups.

Method -1: Content Management Tab under Administration in VMware Aria Operations UI

Method -2: Python Script which uses native APIs of Aria Operations

#!/usr/local/bin python3

import requests, json, urllib3, datetime, time, os, zipfile, shutil

from requests.auth import HTTPBasicAuth
from datetime import datetime


urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

base_url = 'https://vrops80-weekly.cmbu.local/suite-api/api'
token_url = base_url + '/auth/token/acquire'
headers =  {"Content-Type":"application/json", "Accept":"application/json"}
body = {
    "username": "admin",
    "password": "VMware1!",
    "authSource": "local"
    }

token_api_response = requests.post(token_url, headers=headers, json=body, verify=False)

token_api_response = token_api_response.json()

vRealize_ops_token = token_api_response["token"]

print("vRealize Ops Token: " + vRealize_ops_token)

content_export_request_url = base_url + '/content/operations/export/'

headers = {"Content-Type":"application/json", "Accept":"application/json", "EncryptionPassword": "Aman@123456789", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}

body = {
  "scope" : "CUSTOM",
  "contentTypes" : [ "DASHBOARDS", "VIEW_DEFINITIONS", "REPORT_DEFINITIONS", "REPORT_SCHEDULES", "CONFIG_FILES", "ALERT_DEFINITIONS", "SYMPTOM_DEFINITIONS", "RECOMMENDATION_DEFINITIONS",  "NOTIFICATION_RULES", "PAYLOAD_TEMPLATES", "POLICIES", "CUSTOM_GROUPS", "SUPER_METRICS", "COMPLIANCE_SCORECARDS", "AUTH_SOURCES", "USERS", "USER_GROUPS", "ROLES", "INTEGRATIONS", "HTTP_PROXIES", "OUTBOUND_SETTINGS", "COST_DRIVERS", "SDMP_CUSTOM_SERVICES", "SDMP_CUSTOM_APPLICATIONS", "DISCOVERY_RULES", "APP_DEF_ASSIGNMENTS", "CUSTOM_PROFILES", "GLOBAL_SETTINGS"  ],
  "Password" : "12345"
  }

content_export_response = requests.post(content_export_request_url, headers=headers, json=body, verify=False)

content_export_response = content_export_response.json()

print("Sleeping for 60 seconds")

time.sleep(60)

export_zip_url = base_url + '/content/operations/export/zip'

headers = {"Content-Type":"application/json", "Accept":"application/json", "Authorization": "vRealizeOpsToken " + vRealize_ops_token}

export_zip_response = requests.get(export_zip_url, headers=headers, verify=False)

current_datetime = datetime.now()
str_current_datetime = str(current_datetime)
file_name = "./vROpsContentBackup/" + str_current_datetime+".zip"
print(file_name)
with open(file_name, 'wb') as zipFile:
    zipFile.write(export_zip_response.content)

For the detailed process to Backup and Export VMware Aria Operations Configuration please watch our video:

I hope this blog was informative for you, stay tuned for our upcoming blogs. Happy Learning!!

#vmware #aria #operations #vROps #manager #content #management #public #private #hybrid #cloud #backup #export

Leave a Reply