Location>code7788 >text

[VMware VCF] Use PowerShell scripts to manage packages in SDDC Manager.

Popularity:797 ℃/2024-10-23 13:03:17

There are two types of packages in SDDC Manager, namely "PATCH" and "INSTALL". "PATCH packages are used to perform upgrades/patching of components in the VCF environment, which has been used in previous articles, while INSTALL packages are used to deploy other integrated solutions in the VCF environment, such as VMware Aria Suite Lifecycle Manager and VMware Avi Load Balancer, etc. There are also component installers that can be used to replace packages in the source Bill of Materials (BOM) version for asynchronous deployment of VI workload domains.

Navigate to SDDC Manager UI->Lifecycle Management->Package Management, and when these packages are downloaded, you can find them in the "Download History". However, you may find that there is no option to delete these downloaded packages.

By default, packages downloaded by SDDC Manager are stored in the /nfs/vmware/vcf/nfs-mount directory of the virtual machine as shown below. The space in this directory is limited, and as more and more packages are downloaded, the available space will become less and less until it is completely filled up, so we need to manage these packages.

VMware provides a PowerShell script specifically for managing packages in SDDC Manager, such as viewing package information, deleting, and downloading packages. You can find it in the Knowledge Base articleKB 313523 After finding this script at the bottom, viewing and understanding the instructions, here's a look at how to use it.

 

I. Environmental requirements

To use this PowerShell script, you need to install some runtime environments, because the relevant actions performed by the script need to call commands or APIs in these environments to be accomplished, as follows. You can refer to this article (Use PowerVCF to connect to and manage your VMware Cloud Foundation environment.) method in the article to prepare these environments.

  • Run PowerShell Core 7.3.0 or later.
  • Run PowerCLI 13.1 or later.
  • Run PowerVCF 2.3.0 or later.

 

Connecting SDDC Manager

After downloading the script locally, open PowerShell Core and go to the directory where the script is located, and run the following command to connect to SDDC Manager. you can also run the script directly without parameters, and you will be prompted and asked to enter the required parameter information.

.\VcfBundleManagement.ps1 -server <SDDC_Manager_FQDN> -user <SDDC_Manager_SSO_User> -pass <SDDC_Manager_SSO_Password> -rootPass <SDDC_Manager_Root_Password>

Parameter Description:

  • <SDDC_Manager_FQDN> is the management address of SDDC Manager.
  • <SDDC_Manager_SSO_User> is the SSO administrator user name for SDDC Manager.
  • <SDDC_Manager_SSO_Password> is the SSO administrator password for SDDC Manager.
  • <SDDC_Manager_Root_Password> is the Root user password of SDDC Manager.

 

Using PowerShell Scripts

After a successful connection, a menu of options will appear as shown below. The menu options provided by this script allow you to perform different functions, enter different "numbers" to perform different tasks, and enter "Q" to exit the PowerShell script. Let's take a look at what you can do with each of these different options.

Enter the number "4" and return to view the disk space usage of the directory where packages are stored in SDDC Manager. Note, you can press "Enter" to return to the Options menu.

Enter the number "1" and return to refresh the package list information in SDDC Manager.

Enter the number "2" and return to view the list of all packages in SDDC Manager.

Enter the number "3" and return to view all downloaded packages in SDDC Manager.

Enter the number "5" and return to delete the specified package in SDDC Manager. If more than one package is deleted, it needs to be separated by commas. Note: Enter "B" to return to the option menu.

Enter the number "3" and return to view all downloaded packages in SDDC Manager again. Note, if the package display is still there, you can enter the number "1" to refresh it again.

Enter the number "6" and return to delete all packages of the specified version in SDDC Manager.

Enter the number "3" and return to view all downloaded packages in SDDC Manager again.

Enter the number "8" and return to download the package specified in SDDC Manager. If you download more than one, you need to separate them with commas. Note: To accessKB 96099 Learn more about the software packages.

Enter the number "3" and return to view all downloaded packages in SDDC Manager again.

Enter the number "7" and return to remove all obsolete packages from SDDC Manager. The current workload domain version is 5.2.0.0, so version 5.1.1.0 is a relatively obsolete package.

If there are no packages below 5.2.0.0, a warning will appear as shown below.

Enter the number "9" and return to download all packages of the specified version in SDDC Manager. Note, if the packages have already been downloaded, the list will not be listed.

Enter the number "3" and return to view all downloaded packages in SDDC Manager again. Note, the task has been canceled and should show "SUCCESSFUL" status if the download was successful.