|
| 1 | +--- |
| 2 | +title: Remove your VMware vCenter environment from Azure Arc |
| 3 | +description: This article explains the steps to cleanly remove your VMware vCenter environment from Azure Arc-enabled VMware vSphere and delete related Azure Arc resources from Azure. |
| 4 | +author: snehithm |
| 5 | +ms.author: snmuvva |
| 6 | +ms.topic: how-to |
| 7 | +ms.date: 3/28/2022 |
| 8 | +# Customer intent: As an infrastructure admin, I want to cleanly remove my VMware vCenter environment from Azure Arc-enabled VMware vSphere. |
| 9 | +--- |
| 10 | + |
| 11 | +# Remove your VMware vCenter environment from Azure Arc |
| 12 | + |
| 13 | +In this article, you'll learn how to cleanly remove your VMware vCenter environment from Azure Arc-enabled VMware vSphere. For VMware vSphere environments that you no longer want to manage with Azure Arc-enabled VMware vSphere, follow the steps in the article to: |
| 14 | + |
| 15 | +- Remove guest management from VMware virtual machines |
| 16 | +- Remove VMware vSphere resource from Azure Arc |
| 17 | +- Remove Arc resource bridge related items in your vCenter |
| 18 | + |
| 19 | +## Remove guest management from VMware virtual machines |
| 20 | + |
| 21 | +To prevent continued billing of Azure management services after you remove the vSphere environment from Azure Arc, you must first cleanly remove guest management from all Arc-enabled VMware vSphere virtual machines where it was enabled. |
| 22 | + |
| 23 | +When you enable guest management on Arc-enabled VMware vSphere virtual machines, the Arc connected machine agent is installed on them. Once guest management is enabled, you can install VM extensions on them and use Azure management services like the Log Analytics on them. |
| 24 | + |
| 25 | +To cleanly remove guest management, you must follow the steps below to remove any VM extensions from the virtual machine, disconnect the agent, and uninstall the software from your virtual machine. It's important to complete each of the three steps to fully remove all related software components from your virtual machines. |
| 26 | + |
| 27 | +### Step 1: Remove VM extensions |
| 28 | + |
| 29 | +If you have deployed Azure VM extensions to an Azure Arc-enabled VMware vSphere VM, you must uninstall the extensions before disconnecting the agent or uninstalling the software. Uninstalling the Azure Connected Machine agent doesn't automatically remove extensions, and they won't be recognized if you late connect the VM to Azure Arc again. |
| 30 | +Uninstall extensions using following steps: |
| 31 | + |
| 32 | +1. Go to [Azure Arc center in Azure portal](https://portal.azure.com/#blade/Microsoft_Azure_HybridCompute/AzureArcCenterBlade/overview) |
| 33 | + |
| 34 | +2. Select **VMware vCenters**. |
| 35 | + |
| 36 | +3. Search and select the vCenter you want to remove from Azure Arc. |
| 37 | + |
| 38 | +  |
| 39 | + |
| 40 | +4. Select **Virtual machines** under **vCenter inventory**. |
| 41 | + |
| 42 | +5. Search and select the virtual machine where you have Guest Management enabled. |
| 43 | + |
| 44 | +6. Select **Extensions**. |
| 45 | + |
| 46 | +7. Select the extensions and select **Uninstall** |
| 47 | + |
| 48 | +### Step 2: Disconnect the agent from Azure Arc |
| 49 | + |
| 50 | +Disconnecting the agent clears the local state of the agent and removes agent information from our systems. To disconnect the agent, sign-in and run the following command as an administrator/root account on the virtual machine. |
| 51 | + |
| 52 | +```powershell |
| 53 | + azcmagent disconnect --force-local-only |
| 54 | +``` |
| 55 | + |
| 56 | +### Step 3: Uninstall the agent |
| 57 | + |
| 58 | +#### For Windows virtual machines |
| 59 | + |
| 60 | +To uninstall the Windows agent from the machine, do the following: |
| 61 | + |
| 62 | +1. Sign in to the computer with an account that has administrator permissions. |
| 63 | +2. In Control Panel, select Programs and Features. |
| 64 | +3. In Programs and Features, select Azure Connected Machine Agent, select Uninstall, and then select Yes. |
| 65 | +4. Delete the `C:\Program Files\AzureConnectedMachineAgent` folder |
| 66 | + |
| 67 | +#### For Linux virtual machines |
| 68 | + |
| 69 | +To uninstall the Linux agent, the command to use depends on the Linux operating system. You must have `root` access permissions or your account must have elevated rights using sudo. |
| 70 | + |
| 71 | +- For Ubuntu, run the following command: |
| 72 | + |
| 73 | + ```bash |
| 74 | + sudo apt purge azcmagent |
| 75 | + ``` |
| 76 | + |
| 77 | +- For RHEL, CentOS, Oracle Linux run the following command: |
| 78 | + |
| 79 | + ```bash |
| 80 | + sudo yum remove azcmagent |
| 81 | + ``` |
| 82 | + |
| 83 | +- For SLES, run the following command: |
| 84 | + |
| 85 | + ```bash |
| 86 | + sudo zypper remove azcmagent |
| 87 | + ``` |
| 88 | + |
| 89 | +## Remove VMware vSphere resources from Azure |
| 90 | + |
| 91 | +When you enable VMware vSphere resources in Azure, an Azure resource representing them is created. Before you can delete the vCenter resource in Azure, you must delete all the Azure resources that represent your related vSphere resources. |
| 92 | + |
| 93 | +1. Go to [Azure Arc center in Azure portal](https://portal.azure.com/#blade/Microsoft_Azure_HybridCompute/AzureArcCenterBlade/overview) |
| 94 | + |
| 95 | +2. Select **VMware vCenters**. |
| 96 | + |
| 97 | +3. Search and select the vCenter you remove from Azure Arc. |
| 98 | + |
| 99 | +4. Select **Virtual machines** under **vCenter inventory**. |
| 100 | + |
| 101 | +5. Select all the VMs that have **Azure Enabled** value as **Yes**. |
| 102 | + |
| 103 | +6. Select **Remove from Azure**. |
| 104 | + |
| 105 | + This action will only remove these resource representations from Azure. The resources will continue to remain in your vCenter. |
| 106 | + |
| 107 | +7. Perform the steps 4,5 and 6 for **Resources pools/clusters/hosts**, **Templates**, **Networks**, and **Datastores** |
| 108 | + |
| 109 | +8. Once the deletion is complete, select **Overview**. |
| 110 | + |
| 111 | +9. Note the **Custom location** and the **Azure Arc Resource bridge** resource in the **Essentials** section. |
| 112 | + |
| 113 | +10. Select **Remove from Azure** to remove the vCenter resource from Azure. |
| 114 | + |
| 115 | +11. Go to the **Custom location** resource and click **Delete** |
| 116 | + |
| 117 | +12. Go to the **Azure Arc Resource bridge** resource and click **Delete** |
| 118 | + |
| 119 | +At this point, all your Arc-enabled VMware vSphere resources are removed from Azure. |
| 120 | + |
| 121 | +## Remove Arc resource bridge related items in your vCenter |
| 122 | + |
| 123 | +During onboarding, to create a connection between your VMware vCenter and Azure, an Azure Arc resource bridge is deployed into your VMware vSphere environment. As the last step, you must delete the resource bridge VM as well the VM template created during the onboarding. |
| 124 | + |
| 125 | +You can find both the virtual machine and the template on the resource pool/cluster/host that you provided during [Azure Arc-enabled VMware vSphere onboarding](quick-start-connect-vcenter-to-arc-using-script.md). |
| 126 | + |
| 127 | +## Next steps |
| 128 | + |
| 129 | +- [Connect the vCenter to Azure Arc again](quick-start-connect-vcenter-to-arc-using-script.md) |
0 commit comments