VMware vSphere ESXi Image Builder hasn't been covered yet on my blog. I think it's time. Once you understand how to put all the bits and pieces (Image builder, Host profiles and Autodeploy) together, than you can make your super homelab run even more “sexy” with autodeployed ESXi hosts – now even with VMware Tools for Nested ESXi built in! And at the same time to learn towards VCAP exam.
Yes VMware vSphere ESXi Image builder allows also to build custom images, so you can add an additional drivers into it. But to master this technology, it's not a easy task. If you want to have vSphere Autodeploy running in your lab, then one of the options is to configure Image builder and Host profiles, because those technologies were designed to work together with the vSphere suite.
There are prerequisites and PowerCLI commands to know. That's why this post. To remember some PowerCLI. I'm not a scripting guy. I like to write my own post around the topic. It helps me to remember those (pesky) PowerCli commands too.. -:). We will start with Image builder.
vSphere ESXi Image builder is an utility which allows to build custom images. Those images can be exported as ISOs or as package bundle. If you thinking that this topic isn't for you, or that you think that you'll never use features like Autodeploy or Host profiles (which works hand in hand with Image Builder) then you might be wrong. This article applies to vSphere 5.x, so even if I'm demoing with images dating vSphere 5.0, all versions of vSphere starting the 5.0 are covered – 5.0, 5.1 and 5.5.
What VMware vSphere ESXi Image builder does?
- Managing multiple software depots which contains original VMware images, drivers, packages…
- Cloning those images so you can later alter them by adding additional drivers packages
- Exporting those images as ISOs or package bundles (zip)
How to Setup VMware Image builder?
What we need:
- PowerCLI installed on a Workstation or Windows vCenter – Download latest PowerCLI here.
- ESXi Installation image (not ISO) – the offline bundle (not part of the ESX free, you need 60 days trial or do this workaround)
Connection to vCenter
Let's start with the basics. After you start the PowerCLI window, first think to do is to do is to connect to your vCenter server (Windows or Linux – VCSA).
Connect-VIserver
If it complains about remote signed code not active, than activate remote signing (Needs to be done only once – You can skip this if you already done)
Set-ExecutionPolicy RemoteSigned
Add Software depot
You need at least one software depot to be added. If you want to add custom drivers, then you need to add those as well. In my example I'm adding the VMware software depot (with the vanilla images) and another software depot which contains custom (unsupported) driver – VMware Tools for nested ESXi.
Add-ESXSoftwareDepot
You then add the driver depot (not the VIB).
(Note: there is more easier way to build a custom iso with VMware tools for nested ESXi, but for the VCAP exam you'll need to master this as you won't get access to external utilities)
So we have added depots and we can see some profiles. What's next? Let's do some cloning as you might not want to alter the VMware vanilla image. See the image above for the command to clone one of the profiles.
New-ESXImageProfile -CloneProfile
Once the profile cloned, you can add some driver packages into it. Hey that's what we want, no. We want to add the VMware Tools for ESXi package right into our new cloned image called vcaptest.. -:). But to know the name the package, we need first to list all the packages we have in our depot!
Get-ESXSoftwarePackage
Add that package to our newly cloned image
Add-ESXSoftwarePackage -ImageProfile vcaptest -SoftwarePackage esx-tools-for-esxi
To see if the package was successfully added, there is a command for list the VIBs.
Get-ESXImageProfile vcaptest | select -ExpandProperty viblist
Ok, ok. You might say, there is too many commands! Oh well, there is, but they are necessary to manipulate those image depots, image profiles and individual packages. So learn you lazy ..-:) We're almost at the end. It won't hurt, I promise… We only need to export our custom build image into an ISO, that's it!
Expot to ISO or to ImageBundle
Ha. in my particular case, where I'm using the VMware Tools for ESXi “untrusted package” I have an error. It's only because of that. So I'll have to “heal” that error with this switch at the end (the switch is -NoSignatureCheck
)
Export-ESXImageProfile -ImageProfile vcaptest -ExportToIso c:vcaptest.iso
You can also Export to bundle and get a ZIP package with this command:
Export-ESXImageProfile -ImageProfile vcaptest -ExportToBundle c:vcaptest.zip
That's all folks… so you'll end up with a custom build iso of ESXi-5.x with VMware Tools for Nested ESXi host in my case. There is many cases when you need to integrate custom drivers for some of your hosts and build an ISO.
Or when using Autodeploy, you need custom based images as well so the host which is not running out of local disk, but boots via the network via TFTP and can boot from the custom image which contains custom drivers. But autodeploy will be covered in one of my future articles, so stay tuned.
Update: I've recorded a short video to show how that works…
The whole serie so far:
- VCAP Diary – VMware vSphere ESXi Image Builder (this post)
- VMware vSphere AutoDeploy – Run some PowerCLI and you’re the Boss
- VMware vSphere AutoDeploy – Install and configure
- VCAP Diary – VMware vSphere Host Profiles
- VMware vSphere Host Profiles – options and troubleshooting
The article was published first at ESX Virtualization website. Feel free to subscribe via RSS or by e-mail to get the latest news to be delivered via weekly newsletter. The latest 200 articles of daily updates can be found on our daily archives page.
Rob Nelson says
How do you actually set up the local EsxSoftwareDepot? It appears to require an index.xml, not just the files.
Rob Nelson says
Found my own answer. You might want to include a link to http://www.v-front.de/2013/11/vmware-tools-for-nested-esxi-and-how-to.html, or whatever you used, for instructions on how to turn the nested VIB into a depot.
Vladan SEGET says
Yes, you can’t add the VIB to a software depot. You need the ZIP package, where is the XML file. This has been documented in the following article where I’m linking directly to Andy’s blog on his ESXi Customizer tool: http://www.vladan.fr/how-to-build-a-custom-iso-with-vmware-tools-for-nested-esxi/
Thanks.
Rob Nelson says
Thanks for the quick response, Vladan. I was able to get this deployed this morning in no time, once I created the depot. Good stuff!