|
| 1 | +--- |
| 2 | +title: Managing the Azure Arc for servers (preview) agent |
| 3 | +description: This article describes the different management tasks that you will typically perform during the lifecycle of the Azure Arc for servers Connected Machine agent. |
| 4 | +services: azure-arc |
| 5 | +ms.service: azure-arc |
| 6 | +ms.subservice: azure-arc-servers |
| 7 | +author: mgoedtel |
| 8 | +ms.author: magoedte |
| 9 | +ms.date: 03/24/2020 |
| 10 | +ms.topic: conceptual |
| 11 | +--- |
| 12 | + |
| 13 | +# Managing and maintaining the Connected Machine agent |
| 14 | + |
| 15 | +After initial deployment of the Azure Arc for servers (preview) Connected Machine agent for Windows or Linux, you may need to reconfigure the agent, upgrade it, or remove it from the computer if it has reached the retirement stage in its lifecycle. You can easily manage these routine maintenance tasks manually or through automation, which reduces both operational error and expenses. |
| 16 | + |
| 17 | +## Upgrading agent |
| 18 | + |
| 19 | +The Azure Connected Machine agent for Windows and Linux can be upgraded to the latest release manually or automatically depending on your requirements. The following table describes the methods supported to perform the agent upgrade. |
| 20 | + |
| 21 | +| Operating system | Upgrade method | |
| 22 | +|------------------|----------------| |
| 23 | +| Windows | Manually<br> Windows Update | |
| 24 | +| Ubuntu | [Apt](https://help.ubuntu.com/lts/serverguide/apt.html) | |
| 25 | +| SUSE Linux Enterprise Server | [zypper](https://en.opensuse.org/SDB:Zypper_usage_11.3) | |
| 26 | +| RedHat Enterprise, Amazon, CentOS Linux | [yum](https://wiki.centos.org/PackageManagement/Yum) | |
| 27 | + |
| 28 | +### Windows agent |
| 29 | + |
| 30 | +To update the agent on a Windows machine to the latest version, the agent is available from Microsoft Update and can be deployed using your existing software update management process. It can also be run manually from the Command Prompt, from a script or other automation solution, or from the UI wizard by executing `AzureConnectedMachine.msi`. |
| 31 | + |
| 32 | +> [!NOTE] |
| 33 | +> * To upgrade the agent, you must have *Administrator* permissions. |
| 34 | +> * To upgrade manually, you must first download and copy the Installer package to a folder on the target server, or from a shared network folder. |
| 35 | +
|
| 36 | +If you are unfamiliar with the command-line options for Windows Installer packages, review [Msiexec standard command-line options](https://docs.microsoft.com/windows/win32/msi/standard-installer-command-line-options) and [Msiexec command-line options](https://docs.microsoft.com/windows/win32/msi/command-line-options). |
| 37 | + |
| 38 | +#### To upgrade using the Setup Wizard |
| 39 | + |
| 40 | +1. Sign on to the computer with an account that has administrative rights. |
| 41 | + |
| 42 | +2. Execute **AzureConnectedMachineAgent.msi** to start the Setup Wizard. |
| 43 | + |
| 44 | +The Setup Wizard discovers if a previous version exists, and then it automatically performs an upgrade of the agent. When the upgrade completes, the Setup Wizard automatically closes. |
| 45 | + |
| 46 | +#### To upgrade from the command line |
| 47 | + |
| 48 | +1. Sign on to the computer with an account that has administrative rights. |
| 49 | + |
| 50 | +2. To upgrade the agent silently and create a setup log file in the `C:\Support\Logs` folder, run the following command. |
| 51 | + |
| 52 | + ```dos |
| 53 | + msiexec.exe /i AzureConnectedMachineAgent.msi /qn /l*v "C:\Support\Logs\Azcmagentupgradesetup.log" |
| 54 | + ``` |
| 55 | +
|
| 56 | +### Linux agent |
| 57 | +
|
| 58 | +To update the agent on a Linux machine to the latest version, it involves two commands. One command to update the local package index with the list of latest available packages from the repositories, and one command to upgrade the local package. |
| 59 | +
|
| 60 | +#### Upgrade Ubuntu |
| 61 | +
|
| 62 | +1. To update the local package index with the latest changes made in the repositories, run the following command: |
| 63 | +
|
| 64 | + ```bash |
| 65 | + apt update |
| 66 | + ``` |
| 67 | +
|
| 68 | +2. To upgrade your system, run the following command: |
| 69 | +
|
| 70 | + ```bash |
| 71 | + apt upgrade |
| 72 | + ``` |
| 73 | +
|
| 74 | +Actions of the [apt](https://help.ubuntu.com/lts/serverguide/apt.html) command, such as installation and removal of packages, are logged in the `/var/log/dpkg.log` log file. |
| 75 | +
|
| 76 | +#### Upgrade Red Hat/CentOS/Amazon Linux |
| 77 | +
|
| 78 | +1. To update the local package index with the latest changes made in the repositories, run the following command: |
| 79 | +
|
| 80 | + ```bash |
| 81 | + yum check-update |
| 82 | + ``` |
| 83 | +
|
| 84 | +2. To upgrade your system, run the following command: |
| 85 | +
|
| 86 | + ```bash |
| 87 | + yum update |
| 88 | + ``` |
| 89 | +
|
| 90 | +Actions of the [yum](https://access.redhat.com/articles/yum-cheat-sheet) command, such as installation and removal of packages, are logged in the `/var/log/yum.log` log file. |
| 91 | +
|
| 92 | +#### Upgrade SUSE Linux Enterprise |
| 93 | +
|
| 94 | +1. To update the local package index with the latest changes made in the repositories, run the following command: |
| 95 | +
|
| 96 | + ```bash |
| 97 | + zypper refresh |
| 98 | + ``` |
| 99 | +
|
| 100 | +2. To upgrade your system, run the following command: |
| 101 | +
|
| 102 | + ```bash |
| 103 | + zypper update |
| 104 | + ``` |
| 105 | +
|
| 106 | +Actions of the [zypper](https://en.opensuse.org/Portal:Zypper) command, such as installation and removal of packages, are logged in the `/var/log/zypper.log` log file. |
| 107 | +
|
| 108 | +## Remove the agent |
| 109 | +
|
| 110 | +Use one of the following procedures to uninstall the Windows or Linux agent using the command line or setup wizard described in this section. Before uninstalling the agent, first disconnect the machine from Azure Arc for servers (preview) by completing these steps: |
| 111 | +
|
| 112 | +1. Open Azure Arc for servers (preview) by going to the [Azure portal](https://aka.ms/hybridmachineportal). |
| 113 | +
|
| 114 | +2. Select the machine in the list, select the ellipsis (**...**), and then select **Delete**. |
| 115 | +
|
| 116 | +### Windows agent |
| 117 | +
|
| 118 | +#### Uninstall from Control Panel |
| 119 | +
|
| 120 | +1. To uninstall the Windows agent from the machine, do the following: |
| 121 | +
|
| 122 | + a. Sign in to the computer with an account that has administrator permissions. |
| 123 | + b. In **Control Panel**, select **Programs and Features**. |
| 124 | + c. In **Programs and Features**, select **Azure Connected Machine Agent**, select **Uninstall**, and then select **Yes**. |
| 125 | +
|
| 126 | + >[!NOTE] |
| 127 | + > You can also run the agent setup wizard by double-clicking the **AzureConnectedMachineAgent.msi** installer package. |
| 128 | +
|
| 129 | +#### Uninstall from the command line |
| 130 | +
|
| 131 | +To uninstall the agent manually from the Command Prompt or to use an automated method, such as a script, you can use the following example. First you need to retrieve the product code, which is a GUID that is the principal identifier of the application package, from the operating system. The uninstall is performed by using the Msiexec.exe command line - `msiexec /x {Product Code}`. |
| 132 | + |
| 133 | +1. Open the Registry Editor. |
| 134 | +
|
| 135 | +2. Under registry key `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall`, look for and copy the product code GUID. |
| 136 | +
|
| 137 | +3. You can then uninstall the agent by using Msiexec using the following examples: |
| 138 | +
|
| 139 | + * From the command-line type: |
| 140 | +
|
| 141 | + ```dos |
| 142 | + msiexec.exe /x {product code GUID} /qn |
| 143 | + ``` |
| 144 | +
|
| 145 | + * You can perform the same steps using PowerShell: |
| 146 | +
|
| 147 | + ```powershell |
| 148 | + Get-ChildItem -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | ` |
| 149 | + Get-ItemProperty | ` |
| 150 | + Where-Object {$_.DisplayName -eq "Azure Connected Machine Agent"} | ` |
| 151 | + ForEach-Object {MsiExec.exe /x "$($_.PsChildName)" /qn} |
| 152 | + ``` |
| 153 | +
|
| 154 | +### Linux agent |
| 155 | +
|
| 156 | +To uninstall the Linux agent, the command to use depends on the Linux operating system. |
| 157 | +
|
| 158 | +- For Ubuntu, run the following command: |
| 159 | +
|
| 160 | + ```bash |
| 161 | + sudo apt purge azcmagent |
| 162 | + ``` |
| 163 | +
|
| 164 | +- For RHEL, CentOS, and Amazon Linux, run the following command: |
| 165 | +
|
| 166 | + ```bash |
| 167 | + sudo yum remove azcmagent |
| 168 | + ``` |
| 169 | +
|
| 170 | +- For SLES, run the following command: |
| 171 | +
|
| 172 | + ```bash |
| 173 | + sudo zypper remove azcmagent |
| 174 | + ``` |
0 commit comments