VMware Cloud Community
gbbhat
Contributor
Contributor

Vcenter and PSC 6.5 Backup with API/Script

Hi Team,
We have been successfully running the vcenter backup with the shell script VMware vSphere 6.5 Documentation Library Backup Shell Script​ with few enhancements such as NFS storage end point, logging, email capabilities. As you can see it is a bunch of HTTP GET/POST requests that make up the script. Also, from VAMI(Vcenter Appliance Management Interface Web console) we can manually take backup, which I suspect uses the same API calls (please clarify once.)

I was playing around with the APIs in Postman. My doubts are around the payload that is being sent the job creation API endpoint.

API Endpoint - https://<vcenter address or psc address>/rest/appliance/recovery/backup/job

Http Method - POST

Request Body -

{

    "piece": {

        "location_type": "<Backup Protocol>",

        "comment": "Automatic backup",

        "parts": ["seat"],

        "location": "<backup storage location Backup Protocol URI>",

        "location_user": "Backup Protocol User",

        "location_password": "Backup Protocol User Password"

    }

}

Question:

1. How/Where can I use the "comment" part asked in the body?

2. What is "parts" ? and how/when to use it in real life? (In case of PSC backup it should be a blank list. i.e. "parts":[])

     A little bit about parts -

     There is an API endpoint which gives the available parts for backup

     API Endpoint - https://<vcenter address or psc address>/rest/appliance/recovery/backup/parts

     Http Method - GET

     Response body -

     a. For PSC

{

    "value": [

        {

            "selected_by_default": true,

            "name": {

                "args": [],

                "default_message": "common",

                "id": "com.vmware.applmgmt.backup.common_part_name"

            },

            "description": {

                "args": [],

                "default_message": "Inventory and configuration.",

                "id": "com.vmware.applmgmt.backup.common_part_description"

            },

            "optional": false,

            "id": "common"

        }

    ]

}

    b. For VCenter

{

    "value": [

        {

            "selected_by_default": true,

            "name": {

                "args": [],

                "default_message": "common",

                "id": "com.vmware.applmgmt.backup.common_part_name"

            },

            "description": {

                "args": [],

                "default_message": "Inventory and configuration.",

                "id": "com.vmware.applmgmt.backup.common_part_description"

            },

            "optional": false,

            "id": "common"

        },

        {

            "selected_by_default": true,

            "name": {

                "args": [],

                "default_message": "Stats, Events, Alarms, and Tasks",

                "id": "com.vmware.applmgmt.backup.seat_part_name"

            },

            "description": {

                "args": [],

                "default_message": "Historical data (Statistics, Events and Tasks) in vCenter Server database.",

                "id": "com.vmware.applmgmt.backup.seat_part_description"

            },

            "optional": true,

            "id": "seat"

        }

    ]

}

3. As it is shown in the above response body,

    a. Part ids available for vcenter (2 No.) - seat, common

     b. Part ids available for PSC (1 No.) - common

     Currently the VCenter backup is done using "part":["seat"]

     but as shown in the above response body what happens to the parts in "id":"common" ?

   

     When I restored the backup, the vcenter looked just fine.

     So I am assuming the "part":["seat"] == "part":["seat", "common"]

     is that correct?

Thank you.

0 Kudos
0 Replies