Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

CloudStack uses virtual appliances as part of its orchestration. For example, it uses virtual routers for SDN, secondary storage vm for snapshots, templates etc. All these service appliances are created off a template called a systemvm template in CloudStack’s terminologies. This template appliance is patched to create secondary storage vm, console proxy vm or router vm. There was an old way of building systemvms in patches/systemvm/debian/buildsystemvm.sh which is no longer maintained and we wanted to have a way for hackers to just build systemvms on their own box.

Build your own systemvm template (BYO SystemVMs) allows anyone to customize and build their own systemvm template. SystemVM template is an appliance which gets patched by CloudStack's systemvm.iso on a host before it becomes one of the service VMs: ssvm, cpvm or rvm. To make it possible for anyone to BYO systemvm template, we researched and found that it was possible for everyone to install VirtualBox, create and setup a VM, install all the tools and export it. To automate the process we've used veewee, an opensource appliance building tool, that automates the process of appliance building on VirtualBox and we use some tools to export the disk image to various formats.

For latest update, follow the README and build script at:

https://github.com/apache/cloudstack/tree/master/tools/appliance

Scope and Assumptions

Wiki MarkupVeewee \Veewee [3\] uses some definition with which it would automatically download and install a Linux distro on VirtualBox. Since the previous systemvm templates provided by Citrix was based on Debian, we created veewee definitions that are based on Debian. The definitions are located in: tools/appliance/definitions/\*

We implement two definitions;

...

There is a readme file: tools/appliance/README.md

Wiki MarkupBrief description is that we ask veewee to build a template from its definition, veewee reads a definitions.rb file, downloads an ISO, creates a VM on VirtualBox and using preseed.cfg automatically installs and configures a basic Linux box. Next, it would copy and run bunch of postinstallation scripts which configures a number of packages to be installed, copies scripts (like cloud-early-config) and cleans up. The VM is shutdown and the disk image is exported \is exported [1\] \ [2\] to various disk formats such as qcow2, vhd and ova.

Testing is difficult because we don't have any test suite to test systemvm templates. Since the new/default systemvm template definition is based on Debian (like the old ones) and we ported all the build steps from the old buildsystemvmtemplate.sh script, we assume that there should be minimal issues.

Testing can be done by running various tests in basic and advance zone, testing ssvm, cpvm and rvm. So, far Marcus and Rohit have successfully tested new systemvm templates for KVM and Xen.

Wiki MarkupThe following daily jenkins build job \ [2\] creates systemvms from master branch:

httphttps://jenkinsbuilds.cloudstack.org/jobview/build-systemvm-masterImage Removedhttp://jenkins.cloudstack.org/job/build-systemvm64-masterImage Removedunmigrated-wiki-markup-systemvm/

To use these systemvm templates, download the template and use cloud-install-sys-tmplt to preseed systemvm templates as documented on the installation docs \ [4\], or extract and copy the template to appropriate secondary storage path for ex. for Xen: template/tmpl/1/1/

The buildjob would create xen, kvm and hyperv appliance. For VMWare there is a non-automated workaround:

...

3. Using ovftool, export VMWare compatible ova:

Code Block

/Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool --compress=9 ~/Documents/Virtual\ Machines.localized/systemvmtemplate-vmware.vmwarevm/systemvmtemplate-vmware.vmx /Bhaisaab/systemvmtemplate-vmware.ova

...

1. Conversion of raw disk image to Xen VHD: http://blogs.citrix.com/2012/10/04/convert-a-raw-image-to-xenserver-vhd/Image Removed

2. Setting up a jenkins job for automating systemvm template building: http://rohityadavrohit.yadav.inxyz/logs/building-systemvms/Image Removed

3. Veewee: https://github.com/jedi4ever/veewee/Image Removed

4. Preparing/Preseeding systemvm template: http://incubatorcloudstack.apache.org/cloudstack/docs/en-US/Apache_CloudStack/4.0.0-incubating/html/Installation_Guide/management-server-install-flow.html#prepare-system-vm-templateImage Removed