VMware vSphere 5.5 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 redeploy the same ESXi servers.

Getting ready

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 and thus do not allow you to add VIBs to them.
  • The VIBs shouldn't conflict with any of the existing VIBs in the profile. If there is such a conflict, the addition of the VIB to the profile will not be allowed and a message indicating this will be displayed in the PowerCLI console.
  • Install VIBs from only one OEM vendor at a time.

Image Builder will perform a validation when VMware VIBs are added. However, it does not perform any validation when partner VIBs are added.

The following flowchart depicts the procedure involved in adding a driver VIB to an ESXi image profile:

Getting ready

How to do it...

The following procedure will guide you through the PowerCLI procedure to add a VIB to an ESXi image profile:

  1. Add the ESXi offline bundle as a software depot to the PowerCLI session. This is done using the following command:
    Add-EsxSoftwareDepot -DepotUrl C:\AutoDeploy-VIBS\ESXi500-201111001.zip
    
  2. Keep in mind that all predefined image profiles are read-only, hence they cannot be modified. Clone the intended predefined image profile. Cloned image profiles will have the ReadOnly flag set to False. For instructions on how to clone an image profile, read the recipe Creating an image profile by cloning a predefined profile.
  3. To add the driver's 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.
  4. 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.
    How to do it...
  5. Now, add this driver's offline bundle to the software depot by issuing the following command:
    Add-EsxSoftwareDepot -DepotUrl C:\AutoDeploy-VIBS\DriverVIBS\be2net-4.4.231.0-ofline_bundle-1028063.zip
    
    How to do it...
  6. Once the driver's offline bundle has been presented to the PowerCLI session as a software depot, the next step is to check whether the offline bundle has the required VIBs (in this case, the Emulex driver) in it. This can be achieved by issuing the following command:
    Get-EsxSoftwarePackage -Vendor "Emulex"
    
    How to do it...
  7. Now it is very important to be aware of any package dependencies or conflicts. This information pretty much helps you decide whether to go ahead with the inclusion of the VIB in the ESXi image profile or not.

    Information regarding that can be obtained by issuing the following command:

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

    The output obtained is as follows:

    How to do it...
  8. Once you have verified that there aren't any dependencies or conflicts that can affect the functioning of the driver/hypervisor, you then decide to go ahead with including the package in the image profile. We can issue the following command to add the VIB to the image profile:
    Add-EsxSoftwarePackage -ImageProfile Profile001 -SoftwarePackage net-be2net
    

    The output is as follows:

    How to do it...
  9. It is important to verify that the VIB (driver package) has been added successfully to the ESXi image profiles. This can be achieved by issuing the following script:
    Get-EsxImageProfile "Profile001" | Select -ExpandProperty viblist | where { $_.Name -like "net-be2net"}
    
    How to do it...

    We can see that net-be2net, the Emulex driver package (VIB), is now part of the ESXi Image profile Profile001.

    Tip

    Running the command Get-EsxImageProfile "Profile001" | Select -ExpandProperty viblist will list all the VIBs in the image profile.

  10. Do not exit the PowerCLI session at this stage. If you do so, you will lose the newly formed image profile, as it is still in memory. You should export the new image profile as an ISO or as an offline bundle for future use. Read the recipe Exporting an image profile as an ISO or offline bundle for more instructions.

There's more...

To remove a VIB from an image profile, issue the following command:

Remove-EsxSoftwarePackage -ImageProfile Profile001 -SoftwarePackage net-be2net