How to take vCenter server VAMI backup from command line
search cancel

How to take vCenter server VAMI backup from command line

book

Article ID: 373076

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

In certain cases, it may be beneficial to take a VAMI backup of the vCenter server from the command line, for example if access to the VAMI page is not functional. 

Environment

vCenter Server Appliance 7x

vCenter Server Appliance 8x

Cause

The purpose of this KB is to assist with taking a vCenter VAMI backup from the command line. 

Resolution

  • SSH to the vCenter server.


  • Run the following command to initiate the backup (in this example we are using SFTP protocol, change to the desired backup protocol):

    dcli com vmware appliance recovery backup job create --location-type SFTP --location sftp://FQDN_OR_IP_OF_BACKUP_SERVER/BACKUP_LOCATION_DIRECTORY --location-user BACKUP_LOCATION_USER --location-password BACKUP_LOCATION_USER_PASSWORD +username administrator@EXAMPLE_DOMAIN +password VC_ADMIN_PASSWORD


    *NOTE*   The following options will need to be changed in the above command:

    FQDN_OR_IP_OF_BACKUP_SERVER will be the FQDN or IP address of the backup server.

    BACKUP_LOCATION_DIRECTORY will be the path to the directory on the backup server for the backup to be saved to.

    BACKUP_LOCATION_USER will be the username configured for access to the backup server.

    BACKUP_LOCATION_USER_PASSWORD will be the password for the user configured for access to the backup server.

    administrator@EXAMPLE_DOMAIN will be a vCenter server administrator account needed to run dcli commands. The default user of [email protected] can be used for this. 

    VC_ADMIN_PASSWORD will be the password for the vCenter server administrator account needed to run dcli commands.


  • Example output of a successful initiation of a VAMI backup taken from the command line, after running the backup command something similar to the following will be printed on screen:

    start_time: YYYY-MM-DDThh:mm:ssZ
    end_time:
    messages:
       - args:
         default_message: Backup job started.
         id: com.vmware.applmgmt.backup.started

    progress: 0
    id: 20240725-125749-#######
    state: INPROGRESS

    Take note of the backup job ID, in this case it is:

    20240725-125749-#######


  • To get a status on the backup job, run the following command using the ID noted from the previous step:

    dcli com vmware appliance recovery backup job get --id 20240725-125749-####### +username administrator@EXAMPLE_DOMAIN +password VC_ADMIN_PASSWORD


    *NOTE*
    • administrator@EXAMPLE_DOMAIN will be a vCenter server administrator account needed to run dcli commands. The default user of [email protected] can be used for this. 

      VC_ADMIN_PASSWORD will be the password for the vCenter server administrator account needed to run dcli commands.

      Example output of a successful backup:

      start_time: YYYY-MM-DDThh:mm:ssZ
      end_time: YYYY-MM-DDThh:mm:ssZ
      messages:
      progress: 100
      id: 20240725-125749-#######
      state: SUCCEEDED



Additional Information

To get a report on all backup jobs the following command can be used:

dcli com vmware appliance recovery backup job details list +username administrator@EXAMPLE_DOMAIN +password VC_ADMIN_PASSWORD



  • *NOTE*
    • administrator@EXAMPLE_DOMAIN will be a vCenter server administrator account needed to run dcli commands. The default user of [email protected] can be used for this. 

      VC_ADMIN_PASSWORD will be the password for the vCenter server administrator account needed to run dcli commands.