VirtualApplianceSpec

Summary

We'll be providing a proof of concept virtual appliance in Karmic. It'll be deployable on both UEC, EC2 and KVM. It will be based on Alfresco.

Release Note

This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)

It is mandatory.

Rationale

Virtual appliances are a popular way to distribute software-in-a-box. Unlike regular Ubuntu systems, which are meant to be open and easy to tweak endlessly, virtual appliances need to have a "black box" feel to them, so the amount of initial configuration should be minimal, and no knowledge of the underlying operating system should be needed to use it.

User stories

  1. John wants to deploy a Content Management System in his company using KVM. He downloads an AlFresco virtual appliance, and loads it into the hypervisor through virt-manager. He starts the virtual machine and after configuring the network (see VirtualApplianceNetworkConfigurationSpec), he's asked a few simple questions to finish the install. This can be done either via a web interface or on the console of the virtual machine. Once they've been answered, he starts using his CMS.

  2. Kees also wants a Content Management System, but he wants to run it in the cloud, specifically on Amazon EC2. He installs the Ubuntu Appliance Store application, enters his EC2 credentials, selects the AlFresco appliance from the list of appliances, and clicks "Deploy". After a while, he's prompted for some basic configuration details through the Ubuntu Appliance Store application. Once they've been answered, he's starts using his CMS.

Design

  1. We need a simple, declarative way to describe which parts of the filesystem should be moved to an EBS volume.
  2. We need to an interface to deploy the appliances. It should be as platform agnostic as possible.
  3. We need to define an XML format for describing a virtual appliance.

Implementation

Declarative EBS volumes

The data model is very simple:

EBS volume device path -> Path

ec2-data will read these from user-data and mount the volume ID on the given path.

Once we have union mounts in the kernel's VFS layer, we'll simply "mount --union $ebs_volume_device $path". Until then, we'll do this:

    # The blkid call will detect whether there's already a filesystem on the EBS volume
        if [ -n "$(blkid -p -o udev ${ebs_volume_device}" ]
        then
            # We bootstrap the volume by creating a filesystem on it...
                mkfs.ext3 ${ebs_volume_device}
                # ...mounting it on a temporary mount point...
                mkdir ${path}.tmp
                mount ${ebs_volume_device} ${path}.tmp
                # ...copying the existing data to it...
                cp -a ${path} ${path}.tmp
                # ..and ensure it has the same permission set as the original directory.
                chown --reference ${path} ${path}.tmp
                chmod --reference ${path} ${path}.tmp
        # Finally, we mount it on top of the old directory.
                mount --move ${path}.tmp ${path}
        else
                mount ${ebs_volume_device} ${path}
        fi

Should we perhaps add an extra directory level here? It seems silly to have to have two EBS volumes for an appliance just because it has stuff in /etc and /var/lib/mysql (for instance).

Deployment interface

Considerations

  • People are wary of giving their EC2 credentials to third parties (and they should be!), so something that runs locally (on the administrator's system) is preferred over a hosted web application.
  • We want people not running Ubuntu to be able to use our appliances on EC2.

ElasticFox:

  • is XUL based, so is as platform agnostic as Firefox is,
  • runs on the user's system inside Firefox,
  • already implements a full EC2 client library in javascript.

So, we'll build upon ElasticFox, providing a simplified interface, that abstracts all the usual EC2 configuration into simple "appliances".

XML format

Note: This is just a draft!

Example:

<?xml version="1.0"?>
<appliances>
  <appliance>
    <name>Alfresco</name>
        <description>Open Source Enterprise Content Management System including document management, web content management, SharePoint alternative and content repository.</description>
        <ami>ami-12345678</ami>
        <aki>aki-23456789</aki>
        <ari>ari-34567890</ari>
        <storage>
          <size>5G</size>
          <path>/var/lib/mysql</path>
        </storage>
        <!-- These are performed in order given -->
        <!-- Install alfresco -->
        <package>alfresco</package>
        <!-- Run this script snippet -->
        <script><![CDATA[#!/bin/sh

do-tweak-stuff]]>
        </script>
        <!-- Remove evms -->
        <package action="remove">evms</package>
  </appliance>
</appliances>

ElasticFox will turn this into a ec2-run-instances like call, creating a MIME multipart user-data blob that will be parsed by ec2-init, setting up the appliance.

Test/Demo Plan

It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage.

This need not be added or completed until the specification is nearing beta.

Unresolved issues

This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.

BoF agenda and discussion

Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.


CategorySpec

VirtualApplianceSpec (last edited 2009-06-25 14:27:23 by 0107ds1-abv)