10 October, 2008

Building appliances with other OS images (ISO files)

VMware Studio ships with support for virtual appliance creation using a few different OS versions. Each OS version requires a specific ISO image with fixed md5 checksum.

Fortunately, the ISO image and its checksum are part of the appliance profile XML file and we can change those readily. People who roll their own ISO images with Fedora's Revisor or something similar will generally want to use a new ISO image each time they build an appliance.

I'm not going to describe how to build your own ISO image here but let's assume you regularly build one and save it to a web-accessible folder, for example:


http://yourserver/iso/latest/my-custom-centos52.iso


Now edit your appliance profile XML file to use this ISO image instead of the stock value. Appliance profiles are found in the directory /opt/vmware/var/lib/build/profiles/.

Look for the line:


<vadk:iso path="file:///opt/vmware/www/ISV/ISO/CentOS-5.0-i386-bin-DVD.iso"
md5sum="b5633ee6ee3b2e10d92672c74e594d75">
</vadk:iso>


And change it to point to your custom ISO image instead and change the md5sum to null to skip that validation:


<vadk:iso path="http://yourserver/iso/latest/my-custom-centos52.iso "
md5sum="">
</vadk:iso>


Studio will cache ISO images locally so to make it download this ISO image for each build we have to flush Studio's local ISO extraction cache by running:


root@localhost:~# studiocli -v --flushIsoCache


And now you can fire off your appliance builds as usual:


root@localhost# studiocli -cvp myAppliance.xml -i 20081010
Using build instance name: 20081010
Validating profile schema...
Validating Appliance Version formatting...
Validating Appliance Memory Size...
Validating non-empty ISO path...
Validating Appliance usernames and passwords...
Validating Appliance logo path...
Validating ovf:DiskSection_Type...
Validating ApplicationPackages URL...
Validating OS Package elements...
Validating controllers and disks...
Validating file transfer for ProvisioningEngine...
Validating provisioning engine connection...
Validating vmguest_lan...
Validating available disk space...
Preparing the OS installation files.
Creating the virtual machine.
Installing the OS and applications.
Creating an inventory of installed software.
Packaging the virtual machine.
Creating a software update for upgrading older appliance releases.
Publishing the software update to remote servers.
Removing temporary files.
The build has completed successfully.

3 comments:

BrianEh said...

I want to make a custom build profile for 64-bit Ubuntu.

Is there something special that I have to specify in the build profile?

At this time I am just attempting to copy an included build profile and modify the ISO location and checksum.

However I notice atdditional tags such as:
vadk:arch="i386" that I am wondering if I need to edit.

Thanks!

Will DeHaan said...

Brian,

64bit Ubuntu is now in Studio 2.0 Beta. Check it out:

http://communities.vmware.com/viewwebdoc.jspa?documentID=DOC-10175

BrianEh said...

Studio 2.0 - Excellent.