We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Patching VMware vSphere vCenter 7.0 using CLI

Learn how to – Patching VMware vSphere vCenter 7.0 using CLI.

Patching is undoubtedly one of the tasks involved in the maintenance of VMware vSphere infrastructure. In this article I will show you how to patch VMware vCenter Server Appliance manually via CLI. Updating your environment is one of VMware’s best practices.
It is critical to apply security patches in any environment. The days of leaving your environment unpatched for months or even years are over.
The risk of a security breach being exploited by hackers is increasing, which is why keeping your environment up to date is one of the most important factors today.

One thing to note is patches are released by VMware on a monthly basis. These patches can only be applied between major releases of vCenter Server. Patches released for the initial release of vCenter Server 7.0, for example, are not applicable to vCenter Server 7.0 Update 1, as any patches previously made available will be included with the Update 1 release.

Pre-requisites

1. Take a Backup of the vCenter

Please make sure you have performed a proper backup of your appliance before attempting to update any vCenter Server Appliance or Platform Service Controller. Although VMware advises using appliance file-based backup, you can take an offline snapshot of the appliance while the PSC or VCSA virtual machine is off.

This can be done by right clicking the vCenter and going to Snapshots>Take Snapshot.

2. Download the correct Patch ISO of the vCenter build.

Patching of vCenter Appliance via Command Line Interface (CLI)

The first step into patching a vCenter via CLI is by connecting to your vSphere infrastructure and upload this ISO you downloaded above to a data store visible by the ESXi host where the vCenter runs.

Navigate to the datastore you would like to upload the ISO and click Upload.

Select the Iso file and click Open. Upload will start and you can see the progress.

Once the upload is done you need to attach the ISO on the VM’s CD Drive and click connect

Connect to the appliance via SSH (Make sure to enable SSH access). To enable SSH, just connect to the administration UI and go to Access.

Log in to the appliance shell as a user with super administrative privileges (for example, root)

Now we need to stage the patches: To stage the patches included in the attached ISO image, run the following command. You will need to accept the terms and conditions in order to proceed.

software-packages stage --iso

If you want to directly accept the End User License Agreement, use the --acceptEulas option.

software-packages stage –iso –acceptEulas

See screenshot below for the output:

(Optional) Run the following command to view information about the staged patches:

software-packages list --staged

Each patch contains a metadata file that contains information such as the patch version, product name, whether the system needs to be restarted, and so on.

(Optional) Run the following command to see a list of staged patches.

software-packages list --staged --verbose

To start the installation of the staged packages, we will need another command. We will use this command for installing the packages:

software-packages install --staged

The installation will take some time. Once completed, we receive a message indicating that we were successful. Great.

A Reboot of the vCenter maybe required once the installation is complete in order to start all service. Run below command to restart the vCenter via CLI or restart the vCenter from the vSphere Client.

reboot -f

When everything functions properly after the update and reboot, just remove your snapshot (don’t forget to do this), as snapshots have a negative impact on performance and take up a significant amount of storage space on your datastores.

Given the numerous flaws, ransomware, hackers, and exploits, it appears that security is taking center stage in IT as a whole. What was safe last year is not secure this year. At the same time, every day, new vulnerabilities are found. Hence the requirement to have your vCenter fully patched to the most recent release.

More on VMware

Cart

Your Cart is Empty

Back To Shop