In most situations, you create an image profile by cloning an existing profile. Some VMware customers or partners might need to create an image profile from scratch. Pay careful attention to dependencies and acceptance levels if you create an image profile from scratch.
Before you use the cmdlets in this workflow, make sure your environment meets the following requirements.
- VMware PowerCLI and prerequisite is software installed. See Install Image Builder PowerCLI and Prerequisite Software.
- You have access to a depot that includes a base image and one or more VIBs. VMware and VMware partners make public depots, accessible by a URL, available. VMware or VMware partners can create a ZIP file that you can unzip to your local environment and access by using a file path.
See Create an Image Profile for an example of cloning and modifying an image profile.
The system expects that the acceptance level of the VIBs you add to the base image is at least as high as the level of the base image. Pass in the -AcceptanceLevel parameter to change the acceptance level of the image profile if you have to add a VIB with a lower acceptance level.
As an alternative to specifying the parameters on the command line, you can use the PowerShell prompting mechanism to specify string parameters. Prompting does not work for other parameters such as objects.
- At the PowerShell prompt, add the depot that contains the packages you want to use to the current session.
For remote depots, run Add-EsxSoftwareDepot -DepotUrl depot_url.For an offline depot ZIP file, you must download the ZIP file first.
- Download the ZIP file to a local file path.
- Run Add-EsxSoftwareDepot -DepotUrl C:\file_path\offline-bundle.zip
- List the available packages that you are interested in and bind them to a variable.
Get-EsxSoftwarePackage -CreatedAfter 7/1/2010
- Create a new profile, assign it a name and vendor, and add a base package.
New-EsxImageProfile -NewProfile -Name "Test #2" -vendor "Vendor42" -SoftwarePackage esx-base
The example uses the esx-base package. In most cases, you include the esx-base package when you create an image profile from scratch. Names that contain spaces are surrounded by quotes.
- Pipe the information about the new image profile to
format-listfor detailed information about the new package.
(Get-EsxImageProfile -Name "Test #2").VibList | format-list
Creating Image Profiles from Scratch Using Variables
This command sequence repeats the steps of the workflow, but passes parameters as objects, accessed by position in a variable, instead of passing parameters by name. You can run the following commands in sequence from the PowerCLI prompt.
Add-EsxSoftwareDepot depoturl $pkgs = Get-EsxSoftwarePackage -CreatedAfter 7/1/2010 $ip2 = New-EsxImageProfile -Name "Test #2" -vendor "Vendor42" -SoftwarePackage $pkgs $ip2 | format-list