Difference between revisions of "Web-based Virtual Machine Management"

From CDOT Wiki
Jump to: navigation, search
(v0.1 goal)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Project Name ==
 
== Project Name ==
  
Web-based Virtual Machine Management
+
Web-based Virtual Machine Management (aka virtbuilder)
  
== Project Description ==
+
== Description ==
  
Create a web-based rapid provisioning system for virtual machines, building on work started by Ben Hearsum. A user could select an operating system, toolchain, and source branch and the VM would be configured and started (using Xen, KVM, or another hypervisor/backend). Resources: bhearsum
+
A web application which allows users to request and access custom virtual machines. Targeted use case: temporary VMs for one-time use, i.e. testing new configurations, operating systems, etc.
  
 
== Project Leader(s) ==
 
== Project Leader(s) ==
Line 11: Line 11:
 
[[User:Jb|Jesse Buchanan]]
 
[[User:Jb|Jesse Buchanan]]
  
== Project Contributor(s) ==
+
== Details ==
  
== Project Details ==
+
* Uses libvirt, KVM, QEMU
 +
* "Templates" are virtual machines created by hand with existing Linux virtual machine tools like virt-manager. There are two parts to templates: the installed system partition itself, and an XML description of the VM in the libvirt XML format.
 +
* "Instances" are snapshots of the templates: a user can log in and select a template, and be assigned an instance of that template. Changes to the user's VM are not persistent.
  
=== v0.1 goal ===
+
== Unresolved issues ==
 +
 
 +
* Design issue: Expiry of virtual machines (how long should they last? when should they be cleaned up?)
 +
* Design issue: Validating RAM/disk space usage (how to stop users from bringing server to a grinding halt?)
 +
* Known bug: Cannot boot more than one virtual machine because VNC port is in use - must modify this.
 +
 
 +
== Related bugs ==
 +
 
 +
Since I'm not hacking on Firefox or any Mozilla products per se, finding bugs related to my project is sort of difficult. To get in the right direction I tried searching Bugzilla for 'vmware', 'xen', 'kvm', and 'try server'. Here are a few results:
 +
 
 +
* [https://bugzilla.mozilla.org/show_bug.cgi?id=386091 Moz386091 Firefox Profiles in VMware Host create multiple files]
 +
* [https://bugzilla.mozilla.org/show_bug.cgi?id=393092 Moz393092 tracking bug for next try server version]
 +
* [https://bugzilla.mozilla.org/show_bug.cgi?id=393259 Moz393259 Try server slaves should not use anonymous pserver on cvs.mozilla.org for checking out]
 +
 
 +
Update: As of October 21 2007 I've noticed that I'm going to be using the Redhat bugzilla a lot more than Mozilla's. Here are a few actually relevant bugs:
 +
 
 +
* [https://bugzilla.redhat.com/show_bug.cgi?id=248010 RH248010 cannot create vm on qemu-based setup]
 +
* [https://bugzilla.redhat.com/show_bug.cgi?id=253354 RH253354 Virt-Manager does not allow changing RAM allocation for KVM guest]
 +
* [https://bugzilla.redhat.com/show_bug.cgi?id=246354 RH246354 2 pointer cursors diverging under -vnc option]
 +
 
 +
Update: On November 17 2007 I filed a bug against virt-manager in Fedora 8. I am unable to create guests in virt-manager from CDROM installation media (must use a .iso file).
 +
 
 +
* [https://bugzilla.redhat.com/show_bug.cgi?id=389101 RH389101 virt-manager fails to create KVM guests from CD-ROM installation media]
 +
 
 +
== Goals ==
 +
=== v0.1 ===
  
 
* very simple CLI tool that will boot a pre-built Xen machine, using either libvirt or virsh
 
* very simple CLI tool that will boot a pre-built Xen machine, using either libvirt or virsh
 
* if time, very rudimentary control of virtual machine (i.e. change RAM)
 
* if time, very rudimentary control of virtual machine (i.e. change RAM)
 +
* [added in lieu of above] HTML mockup
 +
 +
=== v0.2 ===
 +
 +
* something to make modifications to XML
 +
* shell out to make LVM volumes
 +
 +
=== v0.3 ===
 +
 +
* web-based front end to v0.2
 +
 +
== Releases ==
 +
 +
=== Current: v0.3 release ===
 +
 +
==== Description ====
 +
 +
* Pylons web application
 +
* Handles simple actions such as create, destroy, and list VMs
 +
 +
==== Download ====
 +
 +
* [http://matrix.senecac.on.ca/~jabuchan/virtbuilder0.3.zip Download virtbuilder0.3.zip]
 +
 +
==== Requirements ====
 +
 +
Environment:
 +
* Recent Linux distribution (Fedora 8 was my testing platform, YMMV)
 +
* An LVM volume group with a bit of free space.
 +
* An Intel-VT compliant CPU (hardware assisted virtualization), for KVM.
 +
* A preinstalled virtual machine to be cloned, installed to an LVM volume.
 +
 +
Python:
 +
* libvirt python bindings
 +
* BeautifulSoup
 +
* Pylons
 +
 +
==== Installation and usage ====
 +
 +
* Download and untar.
 +
* Edit development.ini:
 +
** virtbuilder.lvm.vg: Provide the name of your LVM volume group.
 +
** virtbuilder.vmtemplates: Provide the directory your template XMLs are stored in. (optional, default will work)
 +
* Change permissions on libvirt, and set LVM as suid, so Pylons doesn't need privileged access:
 +
**  chmod +s /usr/sbin/lvm
 +
**  chmod -R 777 /var/run/libvirt*
 +
* Run the Pylons project from the top-level virtbuilder dir:
 +
**  paster serve development.ini
 +
* We're done. Go to http://127.0.0.1:5000 and start making VMs.
  
=== Related bugs ===
+
=== Obsolete releases ===
  
Since I'm not hacking on Firefox or any Mozilla products per se, finding bugs related to my project is sort of difficult. To get in the right direction I tried searching Bugzilla for 'vmware', 'xen', 'kvm', and 'try server'. Here are a few results:
+
==== v0.1 release (OBSOLETE) ====
 +
 
 +
* Python script which boots a prebuilt KVM virtual machine via libvirt
 +
* Barebones mockup of web interface: the project in a nutshell
 +
* [http://matrix.senecac.on.ca/~jabuchan/virtbuilder0.1.zip Download virtbuilder0.1.zip]
 +
 
 +
==== v0.25 release (OBSOLETE) ====
 +
 
 +
* Python script which:
 +
** reads a virt-image(5) XML file,
 +
** creates an LVM snapshot of the target /dev/hda,
 +
** boots the newly created VM instance via libvirt.
 +
* [http://matrix.senecac.on.ca/~jabuchan/virtbuilder/README Download README]
 +
* [http://matrix.senecac.on.ca/~jabuchan/virtbuilder/CHANGELOG Download CHANGELOG]
 +
* [http://matrix.senecac.on.ca/~jabuchan/virtbuilder0.25-r07.zip Download virtbuilder0.25-r07.zip]
  
* [https://bugzilla.mozilla.org/show_bug.cgi?id=386091 386091 Firefox Profiles in VMware Host create multiple files]
 
* [https://bugzilla.mozilla.org/show_bug.cgi?id=393092 393092 tracking bug for next try server version]
 
* [https://bugzilla.mozilla.org/show_bug.cgi?id=393259 393259 Try server slaves should not use anonymous pserver on cvs.mozilla.org for checking out]
 
  
 
== Project News ==
 
== Project News ==
Line 35: Line 122:
  
 
2007-09-30: v0.1 goal stated.
 
2007-09-30: v0.1 goal stated.
 +
 +
2007-10-10: Installed Fedora 7 successfully.
 +
 +
2007-10-11: Began experimenting with virt-install, KVM and QEMU.
 +
 +
2007-10-12: Successfully installed Fedora 7 inside KVM/QEMU virtual machine.
 +
 +
2007-10-19: Completed a v0.1 goal: create simple CLI program to boot prebuilt virtual machine.
 +
 +
2007-10-20: Completed a v0.1 goal: create mockup.
 +
 +
2007-10-21: Released v0.1. New, temporary name is 'virtbuilder': (criteria: less than 36 chars, 0 google results)
 +
 +
2007-11-28: Released v0.25-r07.
 +
 +
2007-12-14: Released v0.3.
 +
 +
== Related links ==
 +
 +
[http://kvm.qumranet.com/kvmwiki KVM homepage]
 +
 +
[http://fabrice.bellard.free.fr/qemu/ QEMU homepage]
 +
 +
[http://libvirt.org/ libvirt homepage]
 +
 +
[https://bugzilla.redhat.com/ Redhat bugzilla]

Latest revision as of 17:04, 14 December 2007

Project Name

Web-based Virtual Machine Management (aka virtbuilder)

Description

A web application which allows users to request and access custom virtual machines. Targeted use case: temporary VMs for one-time use, i.e. testing new configurations, operating systems, etc.

Project Leader(s)

Jesse Buchanan

Details

  • Uses libvirt, KVM, QEMU
  • "Templates" are virtual machines created by hand with existing Linux virtual machine tools like virt-manager. There are two parts to templates: the installed system partition itself, and an XML description of the VM in the libvirt XML format.
  • "Instances" are snapshots of the templates: a user can log in and select a template, and be assigned an instance of that template. Changes to the user's VM are not persistent.

Unresolved issues

  • Design issue: Expiry of virtual machines (how long should they last? when should they be cleaned up?)
  • Design issue: Validating RAM/disk space usage (how to stop users from bringing server to a grinding halt?)
  • Known bug: Cannot boot more than one virtual machine because VNC port is in use - must modify this.

Related bugs

Since I'm not hacking on Firefox or any Mozilla products per se, finding bugs related to my project is sort of difficult. To get in the right direction I tried searching Bugzilla for 'vmware', 'xen', 'kvm', and 'try server'. Here are a few results:

Update: As of October 21 2007 I've noticed that I'm going to be using the Redhat bugzilla a lot more than Mozilla's. Here are a few actually relevant bugs:

Update: On November 17 2007 I filed a bug against virt-manager in Fedora 8. I am unable to create guests in virt-manager from CDROM installation media (must use a .iso file).

Goals

v0.1

  • very simple CLI tool that will boot a pre-built Xen machine, using either libvirt or virsh
  • if time, very rudimentary control of virtual machine (i.e. change RAM)
  • [added in lieu of above] HTML mockup

v0.2

  • something to make modifications to XML
  • shell out to make LVM volumes

v0.3

  • web-based front end to v0.2

Releases

Current: v0.3 release

Description

  • Pylons web application
  • Handles simple actions such as create, destroy, and list VMs

Download

Requirements

Environment:

  • Recent Linux distribution (Fedora 8 was my testing platform, YMMV)
  • An LVM volume group with a bit of free space.
  • An Intel-VT compliant CPU (hardware assisted virtualization), for KVM.
  • A preinstalled virtual machine to be cloned, installed to an LVM volume.

Python:

  • libvirt python bindings
  • BeautifulSoup
  • Pylons

Installation and usage

  • Download and untar.
  • Edit development.ini:
    • virtbuilder.lvm.vg: Provide the name of your LVM volume group.
    • virtbuilder.vmtemplates: Provide the directory your template XMLs are stored in. (optional, default will work)
  • Change permissions on libvirt, and set LVM as suid, so Pylons doesn't need privileged access:
    • chmod +s /usr/sbin/lvm
    • chmod -R 777 /var/run/libvirt*
  • Run the Pylons project from the top-level virtbuilder dir:
    • paster serve development.ini
  • We're done. Go to http://127.0.0.1:5000 and start making VMs.

Obsolete releases

v0.1 release (OBSOLETE)

  • Python script which boots a prebuilt KVM virtual machine via libvirt
  • Barebones mockup of web interface: the project in a nutshell
  • Download virtbuilder0.1.zip

v0.25 release (OBSOLETE)


Project News

2007-09-17: Project claimed. Must contact bhearsum for further information.

2007-09-18: Discussion with bhearsum, ctyler.

2007-09-30: v0.1 goal stated.

2007-10-10: Installed Fedora 7 successfully.

2007-10-11: Began experimenting with virt-install, KVM and QEMU.

2007-10-12: Successfully installed Fedora 7 inside KVM/QEMU virtual machine.

2007-10-19: Completed a v0.1 goal: create simple CLI program to boot prebuilt virtual machine.

2007-10-20: Completed a v0.1 goal: create mockup.

2007-10-21: Released v0.1. New, temporary name is 'virtbuilder': (criteria: less than 36 chars, 0 google results)

2007-11-28: Released v0.25-r07.

2007-12-14: Released v0.3.

Related links

KVM homepage

QEMU homepage

libvirt homepage

Redhat bugzilla