I was recently asked if there is a way to remove a bundle that has been already downloaded by the SDDC Manager. Most of the time, there is little need to do this. However, there are times when it can be helpful – like if you are using a VCF environment to teach others how to perform tasks like downloading VCF bundles manually. Let’s take a look at how you would do this.
For this article, I will be using the VMware Hands On Labs (HOL-2046) to demonstrate the process. The HOL labs are a great resource! Although they have specific procedures that are designed to educate the user on a particular topic, most are simply cloud based product deployments. This means that you have the ability to use the labs for other tasks – like trying this process out without impacting your actual environment.
In order to delete a bundle, we need to first know what the bundle ID is. The bundle ID is a 32-character alphanumeric string that is assigned to each bundle. Some people may refer to bundles by the shorter number that is used in the names of the files in the bundle. For our purposes here, we need to know the 32-character bundle ID that the SDDC Manager uses to identify each of the bundles.
There are a couple different ways to find the bundle ID of the bundles that have been downloaded to the SDDC Manager. The easiest is to look under the bundle history and look for the name of the bundle you’re searching for. Take for example the first bundle that is listed in the screenshot below.
In this screenshot, we can see that this is a bundle that is used to update VMware Cloud Foundation to 3.9.0. If we click on the View Details link, we will see more information on that bundle, like this:
The Bundle ID row shows the bundle ID that identifies this particular bundle.
Another method to get this same information is to use a API call. Simply SSH into the SDDC Manager and run the following command to get a list of all the bundles that are installed on the SDDC Manager (replacing the information for the host and the admin password, of course):
# curl -k https://sddc-manager.vcf.sddc.local/v1/bundles -u 'admin:VMware123!' -X GET -H 'Accept: application/json' | json_pp
When you run this command, you will see a JSON formatted output that provides all the details of the bundles, including the bundle ID.
Once you get bundle ID, the next step is to SSH in to the SDDC Manager and run the following command, replacing the <bundle_id> with the actual bundle ID you wish to remove:
# /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py <bundle_id>
This command will output a lot of messages as it goes through the process of removing the bundle. Once it completes, you can either use the API command mentioned earlier or you can go back to the SDDC Manager UI and look under the bundle history. You should see that the bundle is no longer listed.
That’s it! No need to restart any services, though you may need to wait for the UI to refresh.