Stackfactory: a Tool for Building Disk Images

This is a guest post by David Noe,  founder of stacklet.com. David explains how Stackfactory – the GPL tool used to build images – works and how others may benefit.

Stackfactory is a GPL tool used to create filesystems and disk images, complete operating systems ready to run on a virtualization platform such as Xen. The program itself is coded in python and defines an xml minilanguage for building filesystems programatically. The xml files are referred to as “specifications” or simply specs. The entire stackfactory pipleline from specification to disk image is shown here:
Diagram
From left to right we start out with some specs (which are simple xml files describing how to build a filesystem). The stackfactory program processes these specs into a tree of filesystems. In the tree above (labelled Filesystem Repository) we have created three filesystems: CentOS, Gnome and Ubuntu. The CentOS filesystem contains the minimum amount of core packages that would allow one to run CentOS. The Gnome filesystem is derived from the CentOS filesystem and layers the Gnome desktop components on top of the CentOS core. Then there is a minimal Ubuntu filesystem, analogous to the core CentOS filesystem except that it has Ubuntu packages instead of CentOS packages. Each of these three filesystems were created by running a spec through the stackfactory process.
To be clear, the filesystem repository shown is merely a sample — stackfactory can build trees of filesystems with unlimited depth. The contents of any given filesystem in the tree depends on the specification used to build it. Each filesystem can become the parent of a derived filesystem via snapshots. Essentially the snapshot mechanism lets us create new filesystems with a defined starting point without disrupting the original filesystem.
The final step in the pipeline is to select a filesystem from the tree and bundle it for deployment. During bundling stackfactory transfers the contents of a filesystem into a disk image that will be ready to run under virtualization. This bundling process is also specification driven. Currently there are specs to turn filesystems into xen disk images, vmware vmdk’s, qcow files, tarballs, Amazon ami’s and others. Supporting new platforms is tantamount to writing a specification that can output a format suitable for that platform.

Key Benefits

  • Programmable: Uses a specification language instead of hard-coding behaviors.
  • Layered: Filesystems can be built incrementally using snapshots
  • Flexible: Decoupling the process of creating filesystems from creating disk images allows us to retarget filesystems to the maximal number of platforms.

Read more

🛠️ Xen Summit 2025: Find Your Place in the Future of Virtualization
06/27/2025

The annual Xen Summit is right around the corner, and there has never been a more exciting time to be part of the Xen Project. As enterprise and industrial needs shift and proprietary vendors rethink their licensing, the industry is ready for strong, open alternatives. Xen stands out not only

Let’s Grow Xen Together!
03/18/2025

Xen is open, secure, and built for the future. As the new Community Manager, I’m focused on growing the Xen community, welcoming new contributors, and ensuring a thriving ecosystem. Let’s build the future of virtualization together!

Xen Project 4.20: A Step Forward in Open Source Virtualization
03/11/2025

The Xen Project has released Xen 4.20 🎉! This release introduces a range of enhancements that further solidify its position as the premier open-source hypervisor. It delivers important security updates, improved performance, and broader hardware support. Xen has doubled down as the best choice for cloud providers, enterprise users, and

Xen Project Winter Meetup
02/13/2025

We just wrapped up the Xen Winter Meetup 2025. It was an amazing opportunity to push Xen forward in a way that can only happen when people get together in person. Organized by Vates, we hosted it at the University of Grenoble IMAG building, a great spot for cutting-edge research