This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Remotely Upgrading a Photon OS Machine

The following section describes how to remotely upgrade a Photon OS installation.

1 - Remotely Update a Single Photon OS Machine With Photon Management Daemon

After you have a configured the Photon Management Daemon on a machine, you can remotely update any installed package on that machine. You can use the root user credentials.

The update process uses pmd-cli which is supported from Photon Management Daemon. You can initiate the update process from any machine that has Photon Management Daemon CLI installed.

Prerequisites

  • Have an installed Photon Management Daemon on the client.
  • Have in installed Photon Management Daemon CLI (pmd-cli) on a machine from which you perform the updates.

Procedure

  1. To initiate remote update, log in to a machine that has Photon Management Daemon CLI installed over SSH.

  2. Identify packages that can be updated on the client machine.

    • List the available updates for the machine.
pmd-cli --server-name <machine-IP-address> --user root pkg list updates
  1. Verify the currently installed version of a package, for example sed.
pmd-cli --server-name <machine-IP-address> --user root pkg installed sed

The installed version number shows as earlier than the one listed under the available updates.

  1. Initiate the update, in this example of the sed package, enter password, and wait for the command to complete.
pmd-cli --server-name <machine-IP-address> --user root pkg update sed
  1. (Optional) Verify that the client machine package was updated successfully.
    • Log in to the machine that was updated over SSH.
    • List the installed version of the sed package.
pmd-cli --server-name <machine-IP-address> --user root pkg installed sed

2 - Remotely Upgrade Multiple Photon OS Machines With Photon Management Daemon

After you have a configured the Photon Management Daemon (PMD) on multiple machines, you can remotely upgrade any installed package on these machines.

Upgrade process uses copenapi_cli that is supported from Photon Management Daemon. You can initiate the upgrade process from any machine that has Photon Management Daemon installed.

Prerequisites

  • Have installed Photon Management Daemon on the clients.

Procedure

  1. To initiate remote upgrade, log in to a Photon OS machine over SSH to install the Photon Management Daemon CLI.

    # tdnf install pmd-cli

  2. Edit the copenapi_cli spec files so that you can specify the machines you want to upgrade and credentials to be used.

    1. Edit the .netrc file to specify machines to be upgraded and credentials for the PMD service.

      # vi ~/.netrc

    2. In the file, enter the IP addresses for the machines and administrative credentials, save and close the file.

      # machine <IP-address> login <pmd-administrative-user> password <pmd-administrative user-password>

    3. (Optional) Get the location of the restapispec.json file.

      # cat ~/.copenapi

      This command returns apispec=/root/restapispec.json as path for the spec file.

    4. Edit the restapispec.json file to enter the IP address of the machine to be upgraded.

      # vi /root/restapispec.json

    5. Change the host value to the IP address or the hostname of the machine, leave the port number, and save and close the file.

      "host":"<ip-address>:2081"

  3. Initiate the upgrade, in this example of the sed package and wait for the command to complete.

    Specify -k to force blind trust of certificates and -n to use the credentials from the .netrc file. # copenapi_cli pkg update --packages sed -kn

  4. (Optional) Verify that the package was upgraded successfully.

    1. Log in to the machine that was upgraded over SSH.

    2. List the installed version of the sed package.

      # tdnf list installed sed