Upgrade VR, SRM, or VLSR using REST API
search cancel

Upgrade VR, SRM, or VLSR using REST API

book

Article ID: 447762

calendar_today

Updated On:

Products

VMware Live Recovery

Issue/Introduction

VMware vSphere Replication (VR), VMware Site Recovery Manager (SRM), and VMware Live Site Recovery (VLSR) appliances are normally upgraded through the Appliance Management Interface on port 5480.

This article describes how to upgrade a VR, SRM, or VLSR appliance from the command line by using the REST API.

Environment

VMware vSphere Replication 8.x

VMware Site Recovery Manager 8.x

VMware Live Site Recovery 9.0.x

VMware Live Recovery 9.0.x

VCF Protection and Recovery 9.1.x

Resolution

Before proceeding, verify that the target version is supported and take a snapshot or backup of the appliance according to the applicable product upgrade documentation.

  1. Define the appliance connection information

    APPLIANCE_HOSTNAME="<VR_SRM_OR_VLSR_HOSTNAME>"
    USERNAME="admin"
    PASSWORD="<admin_password>"


  2. Run the following command to authenticate to the appliance and obtain a session ID:

    SESSION_ID=$(curl -sk -X POST "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/session" -H 'Content-type: application/json' -u "$USERNAME":"$PASSWORD" | python3 -c 'import sys,json; print(json.load(sys.stdin)["session_id"])')

    Confirm that a session ID was returned:

    echo "$SESSION_ID"

  3. Check the current update repository configuration

    curl -k -X GET "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/repository" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json'


  4. Configure the update repository


    Option 1: Use the appliance CD-ROM


    Mount the appropriate VR, SRM, or VLSR upgrade ISO to the virtual CD/DVD drive of the appliance before running the following command:

    curl -k -X PUT "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/repository" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json' -d '{ "mounted_iso": true, "password": "", "url": "", "username": "" }'

    Option 2: Use an HTTP or HTTPS repository


    If the repository requires authentication, run:

    curl -k -X PUT "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/repository" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json' -d '{ "mounted_iso": false, "password": "<password>", "url": "<repository_URL>", "username": "<username>" }'

    If the repository does not require authentication, leave the username and password values empty:

    curl -k -X PUT "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/repository" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json' -d '{ "mounted_iso": false, "password": "", "url": "<repository_URL>", "username": "" }'

    The repository URL must point to the update directory from the extracted VR, SRM, or VLSR upgrade ISO. Do not configure the URL to point directly to the ISO file.

    Example:

    http://<repository_server>/<path>/update

  5. Retrieve the available updates

    curl -k -X POST "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/actions/retrieve-updates" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json'

    The command returns a task similar to the following:

    {"id":"DrConfigConfigurationTask:DrConfigConfigurationTask1:","description":null,"type":"retrieveUpdate","status":"RUNNING","error":null,"result":null,"progress":0,"start_time":<epoch_time>,"complete_time":null,"_meta":null}

    In this example, the task ID is:

    DrConfigConfigurationTask:DrConfigConfigurationTask1:

    The trailing colon (:) is part of the task ID and must be included in subsequent commands.

  6. Display the available update version

    Replace <TASK_ID> with the task ID returned in Step 5:

    curl -k -X GET "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/tasks/<TASK_ID>" -H "x-dr-session: $SESSION_ID" | python3 -c 'import sys,json; print(json.load(sys.stdin)["result"][0]["version"])'

    Example output:

    9.0.2.16600

  7. Install the update

    Replace <VERSION> with the version returned in Step 6:

    curl -k -X POST "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/appliance/update-manager/updates/<VERSION>/actions/install" -H "x-dr-session: $SESSION_ID" -H 'Content-type: application/json'

    The command returns an installation task similar to the following:

    {"id":"DrConfigConfigurationTask:DrConfigConfigurationTask2:","description":"Downloading Appliance Upgrade","type":"installUpdate","status":"RUNNING","error":null,"result":null,"progress":50,"start_time":<epoch_time>,"complete_time":null,"_meta":null}

    In this example, the installation task ID is:

    DrConfigConfigurationTask:DrConfigConfigurationTask2:

    The trailing colon (:) is part of the task ID.

  8. Monitor the installation progress

    Replace <TASK_ID> with the installation task ID returned in Step 7:

    curl -k -X GET "https://$APPLIANCE_HOSTNAME/api/rest/configure/v2/tasks/<TASK_ID>" -H "x-dr-session: $SESSION_ID"

    Review the following fields in the response:

    status
    progress
    error
    description


    Continue running the command until the task reports successful completion or returns an error.

    The appliance might reboot or temporarily become unavailable during the upgrade. Do not interrupt the upgrade task or power off the appliance.

Additional Information

The REST API used in this article is available under:

/api/rest/configure/v2


The -k curl option disables TLS certificate validation. It is included in these examples for appliances that use self-signed certificates.

When using an HTTP or HTTPS repository, verify that:

  • The appliance can connect to the repository server.
  • The repository URL points to the update directory extracted from the upgrade ISO.
  • The required files can be downloaded from the appliance.
  • Any required repository credentials are correct.

The product name VMware Site Recovery Manager (SRM) applies to the 8.x releases. Starting with version 9.x, the product is named VMware Live Site Recovery (VLSR).