VMware vSphere 5.1 Cookbook
上QQ阅读APP看书,第一时间看更新

Adding a VIB (software package) to an Image Profile

When there is a need to patch an Auto Deployed ESXi server with a newer device driver version, you will have to modify an Image Profile in use so you can add an updated driver to it. Once the driver VIBs have been added to the Image Profile, it can then be used to re-deploy the same ESXi servers.

To add VIBs to an ESXi Image Profile, the Image Profile should meet the following requirements:

  • The Image Profile should not be set to 'read-only'.
  • The Image Profile should not be assigned to hosts. This is because the Image Profiles assigned to hosts are 'locked', hence not allowing you to add VIBs to them.
  • The VIBs shouldn't conflict with any of the existing VIBs in the profile. In case it does, it will not allow the addition of the VIB to the profile and a message indicating the same will be displayed at the PowerCLI console.
  • Install VIBs from only one OEM vendor at a time.
Note

Image Builder will perform a validation when VMware VIBs are added. It does not perform any validation when Partner VIBs are added.

How to do it…

The following procedure will guide you through the steps required to add VIBs to an Image Profile.

It is a four-step process:

  1. Verifying whether the Image Profile is read-only. If the Image Profile is read-only then it has to be cloned first before the VIBs can be added.
  2. Adding the driver's Offline Bundle to the Image Builder.
  3. Checking the availability of the needed software package (VIB).
  4. Adding the needed VIB to the Image Profile.
  5. Verifying whether the VIB has been added to the Image Profile.
Verifying whether the Image Profile is read-only

An Image Profile cannot be in read-only mode if it has to be modified. If a profile is in read-only mode then it will have to be cloned so that the ReadOnly attribute is set to False on the newly formed Image Profile.

To verify whether the Image Profile is read-only, display the details of the Image Profile by using the format-list cmdlet. Let's view the properties on the predefined Image Profile ESXi-5.1.0-799733-standard from the ESXi 5.1 Offline Bundle, by issuing the following commands:

$profiles = GetEsxImageProfile
$profiles[2] | Format-List

Note that it shows that the ReadOnly attribute/property of the Image Profile is set to True. This is generally the case with all the default/predefined Image Profiles in an Offline Bundle.

In the previous recipe, we had cloned the Image Profile ESXi-5.1.0-799733-standard to form Profile001. So the ReadOnly attribute on Profile001 should be False. To verify, let's issue the following command:

$profiles[1] | Format-List

As expected, the ReadOnly property for the Image Profile Profile001 is set to False. The profile can now be modified to add VIBs.

Adding the driver's Offline Bundle to the PowerCLI

To add driver VIBs to an Image Profile, you need to procure the driver's Offline Bundle and present that to the PowerCLI session using the Add-ESXSoftwareDepot command.

In this example, we will be adding the Offline Bundle containing the network function driver for the Emulex OneConnect OCe10102 10GbE adapter. The driver's Offline Bundle has been downloaded and saved to the C:\AutoDeploy-VIBS\DriverVIBS folder.

To add this Offline Bundle to the Software Depot, issue the following command:

Add-EsxSoftwareDepot -DepotUrl C:\AutoDeploy-VIBS\DriverVIBS\be2net-4.4.231.0-ofline_bundle-1028063.zip
Checking the availability of the needed software package (VIB)

To verify whether the Offline Bundle has been successfully added and the VIB is available for use, issue the following command:

Get-EsxSoftwarePackage -Vendor "Emulex"
Note

It is important to be aware of the package dependencies and conflicts.

Package dependencies and conflicts information can be obtained by fetching more detailed information about the package, using the following command:

Get-EsxSoftwarePackage –Name net-be2net -Vendor "Emulex" | Format-List
Note

Note the name, dependency, and conflicts information and source URL.

Adding the VIB to the Image Profile

Now that we know the name of the software package, issue the following command to add it to the Image Profile Profile001.

Add-EsxSoftwarePackage -ImageProfile Profile001 -SoftwarePackage net-be2net
Verifying whether the VIB has been added to the Image Profile

To verify whether the software package has been added to the Image Profile, issue the following command:

Get-EsxImageProfile "Profile001" | Select -ExpandProperty viblist | where { $_.Name -like "net-be2net"}