Virtual Machine (VM) Based Applications

Overview

The Virtual Machine based Application term refers to a type of packaged application which contains both the applications and a complete guest-os that provides not only the applications rootfs, but also the required guest-os kernel. This type of application is also referred as "KVM App" since it runs under the Linux type-2 hypervisor Kernal-based Virtual Machine (KVM) using Quick Emulator (QEMU).

For an overview of this application type see:

Though VM has the most application packaging complexity and performance overhead, the VM Application type affords:

  • Highest level of guest/host isolation
  • Choice of any guest-os that is compatible with the targeted platform hardware architecture (eg Intel x86_64). The guest-os does not need to be linux based (eg Windows can be installed)
  • Application can be tightly integrated with the OS, providing any version of required tools, libraries, kernel features and/or patches/drivers, since the entire guest-os is emulated on the targeted platform
  • Applications can be easily developed and tested using 3rd Party Type 2 hypervisor tools such as VMWare, Virutal-Box, VMWare Fusion, and then repackaged into an IOx application

Some limitations to consider when implemented a VM:

  • Performance is constrained unless processor supports native virtualization extensions (Intel Architectures Only)
  • Device Emulation limits IO performance
  • Application size may be in the gigabyte size since it contains both the application service plus the guest OS

Typical Scenarios for VM based Apps

The VM based Application is mostly used in the following cases:

  • A guest-os is required that is incompatible with the linux host-os (eg Windows)
  • The Application requires special kernel privileges or kernel drivers/features which the host-os does not permit

Developer Required Skills

The required skill set for developing a VM based Application is substantially more than what is required for PaaS or LXC Container type Application.

Developers working on an VM based Application are expected to:

  • Have a basic/intermediate understanding of guest-os including:
    • rootfs, partition, system initialization, networking configuration, package installation
  • Customize/configure the guest-os system
  • Familiar how to build the application

Package Anatomy

The package structure is very similar to the PaaS/LXC Style Application. The package is a tarball containing the following files (in order):

File Description
package.yaml Application Descriptor
package.mf Manifest file containing the checksum of the other files at this level
artifacts.tar.gz Compressed envelope containing a qcow2 image file

Some notes on the content of the files in the package:

  • package.yaml
    • Must specify that the app type is "vm"
    • Must specify the "cpuarch" the linux distibution binaries are compatible with
  • artifacts.tar.gz
    • Must contain a qcow2 image file (which must also appear in the application descriptor "file")