I have started to use vSphere Lifecycle Manager (vLCM) more and more, especially after upgrading to vSphere 8 as it will be the primary lifecycle management solution going forward for both vSphere image and configuration management.
The other reason for using vLCM is that vSphere Update Manager (VUM) baselines have also been deprecated in vSphere 8 and while you can still use it for now, it should not come as a surprise that VUM and its functionality will be removed in the future and all of its workflows including the use of vSphere Image Builder should also be transitioned over to using vLCM.
One of the most common and basic workflow for customers today is creating custom ESXi images (ISO or Offline Bundle) that includes additional ESXi drivers. Since vLCM is probably new to most folks (including myself), I wanted to share how you can create your own custom ESXi images using both the vLCM UI (which can be a bit non-intuitive) as well as the new PowerCLI cmdlets that was jus released today as part of PowerCLI 13.0 release that adds support for both vLCM and vSphere 8!
vLCM UI
Step 1 - In the upper left hand corner of the vSphere UI, navigate to Lifecycle Manager. If you need to import a new driver into vLCM depot, click on Actions->Import Updates and select the ESXi component driver (ZIP) that you wish to upload.
Step 2 - Since vLCM operates at a vSphere Cluster level, we are simply going to create a "dummy" vSphere Cluster that will be used to define our custom ESXi image. Make sure the "Manage all hosts in the cluster with a single image" option is selected which enables vLCM and then choose the "Compose a new image" setting.
Next, you need to specify the ESXi base image for the cluster, select ESXi 8.0 or any other version that desire.
Step 3 - During the creation of a vSphere Cluster, you can NOT add additional ESXi component drivers to ESXi base image, this must be done AFTER. If you need to associate additional ESXi component drivers, click on the vSphere Cluster and navigate to Updates->Hosts->Image and click on the Edit button. Here you can add additional vendor firmware and driver add-ons and underneath, you will see Components. Click on the Add Components and select the specific ESXi component(s) from the vLCM depot that you wish to add to ESXi base image.
Step 4 - Finally, to export our new custom ESXi image, click on the "three dots" and then select Export.
You can choose from ISO or an Offline Bundle ZIP, similar to what vSphere Image Builder supports today.
At this point, you now have your new custom ESXi ISO from vLCM!
vLCM PowerCLI
Step 0 - If you need to import a new driver into vLCM depot, unfortunately this functionality is not available in the new vLCM PowerCLI cmdlets. You will need to use the vLCM UI to perform this operation first
Step 1 - Connect to your vCenter Server using the Connect-VIServer cmdlet:
Connect-VIServer -Server vcsa.primp-industries.local -user administrator[at]vsphere[dot].local
Step 2- Define the ESXi base image name and ESXi components you wish to use. You can use the new Get-LcmImage cmdlet and pass specify -Type filter with either BaseImage or Component to get the specific name and/or version to populate the variables.
$datacenterName = "Primp-Datacenter" $clusterName = "vLCM-Dummy-Cluster" $esxiImageName = "8.0 GA - 20513097" $esxiComponentName = "VMware USB NIC Fling Driver" $esxiComponentVersion = "1.11-1vmw"
Step 3 - Using the variables defined above, we will now fetch the ESXi base image and ESXi component from vLCM depot using the Get-LcmImage cmdlet and save the output to two new variables which will be referenced in the next step.
$esxiBaseImage = Get-LcmImage -Type BaseImage -Version $esxiImageName $esxiComponent = Get-LcmImage -Type Component | where {$_.Name -eq $esxiComponentName -and $_.Version -eq $esxiComponentVersion}
Step 4 - Next, we will create our "dummy" vSphere Cluster and associate that with our ESXi base image. Once the vSphere Cluster has been created, we will update it to associate the additional ESXi components and then finally we export to ISO using the new Export-LcmClusterDesiredState cmdlet.
New-Cluster -Name $clusterName -BaseImage $esxiBaseImage -Location (Get-Datacenter -Name $datacenterName) Get-Cluster -Name $clusterName | Set-Cluster -Component @($esxiComponent) -BaseImage $esxiBaseImage -Confirm:$false Export-LcmClusterDesiredState -Cluster (Get-Cluster -Name $clusterName) -ExportIsoImage
Once the process has completed, you will find both both an ISO and JSON file that has been exported from vLCM using the same name as your vSphere Cluster.
- vLCM-PCLI-desired-state-spec.json
- vLCM-PCLI-iso-image.iso
At this point, you are now ready to use your new ESXi ISO from vLCM!
Hopefully this article gave you a quick understanding of how to create custom ESXi images and I really do like the simplicity that vLCM provides in terms of constructing a custom ESXi image, which starts with the ESXi version and then it is additive with vendor firmware/add-on and then finally additional component drivers. The vLCM UI is certainly a welcome enhancement over the current vSphere Image Builder which in my opinion still has too many steps, like needing to clone an image profile to be able to construct a new image.
Kevin Martin says
It seems that the deprecation of standard baselines will force me to create more clusters, and buy more hardware.
I will typically have different generation servers in the same cluster, and for some, different vendor server(ex: hpe and cisco). Even if the same vendor, could potentially need different drivers for different generations.
Thoughts on this? Is VMware aware of this potential impact on their customers?
Trevor says
I am used to baselines where you just stage and then remediate and then youre done.
How does this LCM stuff work with newer versions of ESXI8? For example, let's say I am going from esxiv8 update 2, to esxi8 update 3. currently all 8.02 hosts have the USB fling for update2. Is there a way via LCM to update all hosts to 8.03 and update the usb fling to the corresponding version at the same time?
Or, would the USB fling need to be manually updated on each ESXI host after each host is updated to 8.03?
parambil says
Does the image builder commandlets let you build the custom images with vSphere 8? Going to check out next week when in office. Will update the findings here.
Now the image based remediation is at the cluster level, it's going to be pain to manage hundreds if not thousands of ESXi clusters.
William Lam says
Yes, but make sure you either use VC 8.0 via Image Builder UI or PCLI 13 that supports vSphere 8
While vLCM is managed at a cluster level, remediation can be at cluster (ideally how you’d roll out changes), but you can also select specific hosts to remediate but not sure why this would be “pain” given that’s how VUM remediation works too 🙂
parambil says
Thanks William. Plan to use PLCI 13.
Pain in the sense, to remediate 100s of hosts in a VC, times 100 VC. Using UM, you can remediate at the vCenter level. Now, I believe, I had to do it at the cluster level.
Przemek Wirkus says
When I`m building image, do I need to know about all the "Non-Critical Host Patches (Predefined)" and add them manually? As is my understanding baselines automatically have information about the patches and implement them accordingly to needs. With vLCM should i add them ass additional packages when there is no next base image version?
Also what Kevin said, having different hadrware version is blocking implementing vLCM.
gcbeta says
The image was successfully exported. You are great. The image profile name is "VMware Lifecycle Manager Generated Image". Can you tell me how to customize this name, Just like we used powercli "new-EsxImageProfile -CloneProfile“ before. thank you.
William Lam says
I don't believe you can customize the profile name, I just took a look at the vLCM API https://developer.vmware.com/apis/vsphere-automation/latest/esx/api/esx/settings/clusters/cluster/softwareactionexport/post/ and there's no options for that
Mirza says
Hi, When i want to export ISO image i get this error:
Export-EsxImageProfile : Error retrieving file for VIB 'VMW_bootbank_lsi-mr3_7.718.02.00-1vmw.703.0.20.19193900':
('vib20/lsi-mr3/VMW_bootbank_lsi-mr3_7.718.02.00-1vmw.703.0.20.19193900.vib', "Unable to open VIB archive in streaming
mode: '_SharedFile' object has no attribute 'writing'").
At line:1 char:1
+ Export-EsxImageProfile -ImageProfile "ESXi7-IntelNUC" -ExportToIso -F ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Export-EsxImageProfile], FaultException
+ FullyQualifiedErrorId : System.ServiceModel.FaultException,VMware.ImageBuilder.Commands.ExportProfile
William Lam says
See https://williamlam.com/2022/11/heads-up-unable-to-open-vib-archive-in-streaming-mode-using-export-esximageprofile-with-powercli-13-0.html
Sebigeli says
Hello,
It's possible to update only one host with the vLCM ?
is it also possible to add the fling community driver for intel I225-V and deploy its ESXI updates by including it?
Thanks
Sebigeli says
I hadn't thought of that but it's not possible, my vcenter is on my only esxi host, stupid question ^^
Matt Connley says
Hi William, both methods above fail for me when trying to export the ISO. The error displayed in vCenter is "A general system error occurred: Error occurred while exporting ESXi image and/or image document."
This is getting a little frustrating... I've also tried using the Image Builder cmdlets, and they fail with this issue, which as far as I know is also still unresolved:
"Error retrieving file for VIB 'VMW_bootbank_vmkusb-nic-fling_1.10-1vmw.703.0.50.55634242': ("", "Error opening file object for VIB 'VMW_bootbank_vmkusb-nic-fling_1.10-1vmw.703.0.50.55634242': Expected value '[]' for attribute 'swplatforms', but found value '[]'.")."
What are my options at this point? I'd go to 8.0, but I'm not sure that solves the issue. Do I downgrade PowerCLI to 12.x -- which limits me to running on Windows? Kind of feeling stuck here, and stuck because of issues that seem to have been lingering for many months now without resolution.
William Lam says
Matt - Can you help me understand what versions of VC you’ve got and what version of image you’re trying to build? The UI method do NOT have any issues and that is true for both 7.x & 8.x
If you need 7.x image, use empty VC 7. If you need 8.x image, use empty VC 8, it’s that simple if you have ESXi host already 🙂
Matt Connley says
Hi William, thanks for the quick reply!
I recently upgraded my primary lab vCenter upgraded to 7.0.3k/21290409, which is where I initially ran into this problem. On your advice, I deployed a clean instance (no updates, etc.) of 8.0 and attempted the process -- same issue.
It thought USB NIC Fling v1.10 might be the common denominator... Creating and exporting an image with other components is successful. Also creating an 8.0 image with v.1.11 of the Fling works fine. Out of curiosity I attempted the process with every 7.0.3 version from U3k all the way back to U3c, all with the same results. I don't have access to a 7.0 U3, U3a, or U3b image so I couldn't test those with Fling v1.9. However, 7.0 U2e with Fling 1.8 also failed to export.
Also, to be clear, exporting JSON and the ZIP offline bundle worked in all instances -- it's only exporting ISO that's problematic.
Ultimately I'm probably going to move to 8.0 in the near future anyway, but it's such an odd problem I thought I'd bring it to your attention. I believe I'm executing the process correctly, but if I'm off base on something please let me know.
William Lam says
Ahhhh, I see the problem ...
USB NIC Fling v1.11 is ONLY for ESXi 8.0 (see changelog https://flings.vmware.com/usb-network-native-driver-for-esxi#changelog and the note :)) and because ESXi 8.0 has a new image format, this is why you're getting the errors, which is by design.
You need to use v1.10 which is for ESXi 7.0u3+
While the version of the Fling may not be intuitive, the actual offline bundle has the ESXi version encoded
Matt Connley says
Sorry for being unclear -- I'm definitely using Fling v1.10 for the 7.0u3 versions; I only did v1.11 with 8.0 as a test. To be more specific here are the combinations I tested:
8.0 + Fling v1.11 = Success
7.0u3k down to 7.0u3c + Fling v1.10 = Fail
7.0u2e + Fling 1.08 = Fail
For what it's worth, it was a while ago, I think shortly after 7.0u3g was released, but I did use the Image Builder cmdlets to successfully build a 7.0u3g image with the v1.10 Fling. Something with PowerCLI v13 seems to have broken that though.
At this point I'll probably just start preparing for 8.0 anyway... for the life of me I can't figure out what's going wrong and I'm pretty sure I'm following the process correctly. But I definitely appreciate the help and your work on the Fling!
Charan says
William,
How do we setup LCM image for the cluster based on the custom ISO made using PowerCLI 13.1 for ESXi 8.0? I have the ISO prepared but couldn't find a way to use this ISO as LCM image.
William Lam says
vLCM doesn't use "ISO", they use images that you define at the vSphere Cluster which would include base ESXi image and any additional components/drivers. Sounds like you're new to vLCM, please refer to docs for how to setup your images for your clusters https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere-lifecycle-manager.doc/GUID-74295A37-E8BB-4EB9-BFBA-47B78F0C570D.html
Brandon says
Are we unable to remove components from a base image now? One of the main reasons we make custom images, on our VUM-managed environment, is so that we can create slimmer images that don't have all the extra drivers that we don't need. That allows for faster boot times and faster installations. I see no way in the vCLM UI to remove components that are defined in the image.
So, I went ahead and exported a zip from vCLM, modified the image profile using ImageBuilder, removing the same components our existing hosts already have removed (and they work just fine), and exported the custom image to ISO. However, vCLM refuses to import the iso, saying it can't be used with vCLM and not giving me any other useful feedback. What is it that makes my custom image unacceptable? It is literally the same list of software packages as is in the image profile that was used to create the ISO that every one of these hosts was installed from, so it is clearly a valid image.
Is this a limitation of vCLM? If so, that's awful.
MTNBkr0918 says
Mr. Lam,
How can you kick off the patching process to remediate a cluster once you have your image setup and assigned to the cluster.
MTNBkr0918 says
Forgot to add, using powercli to kick off the remediation.
William Lam says
See https://williamlam.com/2022/10/using-vsphere-lifecycle-manager-vlcm-api-to-patch-group-of-esxi-hosts.html
Mike says
Hi William, I am trying to set up network drivers for my Intel NUC 8i7BEH and I have the powercli 13 version with python 3.12 setup. I was wondering where I can visit for that.
Thanks,
Mike