[DPP] vSphere Subscription and Cloud Services

  • 1.  How to automate vCenter restore

    Posted May 08, 2024 03:12 AM

    We have taken vCenter backup on FTP. We would like to know if there is a way to AUTOMATE the restore of vCenter Backup. The installer DVD has two option to restore the backup 

    1.  /vcsa-ui-installer      vCenter Server Appliance GUI installer

           2. /vcsa-cli-installer     vCenter Server Appliance CLI installer

     

     We can restore the backup manually from the UI installer but we would like to restore it from CLI. The CLI json templates are available for Install, Migrate and Upgrade but missing for restore. Please let us know if there is a way to restore vCenter through CLI.



  • 2.  RE: How to automate vCenter restore

    Posted Jan 22, 2025 04:25 PM

    Yeah, it's possible to restore a vCenter backup using the CLI, but there's no predefined JSON template for it. You'll need to create your own JSON file. Basically, you just mount the vCenter installer ISO, go to the /vcsa-cli-installer directory, and run the restore process from there.

    Here's an example of a restore.json you can use:

    json
    { "esxi": { "hostname": "your-esxi-hostname-or-ip", "username": "your-esxi-username", "password": "your-esxi-password", "datastore": "datastore-name", "network": "network-name", "deployment_option": "small" }, "appliance": { "deployment_option": "small", "name": "vcenter-server", "backup_location": "ftp://your-ftp-server/path-to-backup", "backup_username": "ftp-username", "backup_password": "ftp-password", "backup_encryption_password": "encryption-password-if-you-used-one" } }

    Once you've got the JSON ready, just run this command:

    bash
    ./vcsa-cli-installer restore restore.json --accept-eula --no-ssl-certificate-verification

    That'll trigger the restore process. Make sure the FTP server is reachable, and if your backup was encrypted, don't forget to include the password. If something goes wrong, check the logs for errors.