cloudstack/tools/appliance
Leo Simons be8b2d7c21 CLOUDSTACK-7143: more robust box cleanup
Having experimented with many edge cases of running multiple build.sh
commands in parallel / against busy virtualbox setups, the only really
reliable way to produce consistent images is to not do these commands
in parallel and to not do them while the machine is doing many other
things.

If virtualbox or the machine that hosts it is very busy, and/or it has
a lot of disks it knows/knew about, and/or its tuesday, behavior may
be a bit different.

Realizing this reality, this commit adds some scripts that try really
hard to set virtualbox back to known/healthy state before building.
2014-09-22 21:38:16 +02:00
..
convert Fixed code style errors breaking the build 2014-01-16 14:05:20 -08:00
definitions CLOUDSTACK-7143: fix a missing apt-get update 2014-09-22 21:38:15 +02:00
.rvmrc CLOUDSTACK-1066: Add definitions for building systemvm template appliance 2013-02-05 18:02:52 +05:30
Gemfile CLOUDSTACK-7143: more robust box cleanup 2014-09-22 21:38:16 +02:00
README.md CLOUDSTACK-7143: merge systemvm templates, step 2: only one template remains 2014-09-22 21:31:33 +02:00
build.sh CLOUDSTACK-7143: more robust box cleanup 2014-09-22 21:38:16 +02:00
convert_ovf_vbox_to_esx.xslt Adjust values for this version of vbox 2014-01-17 17:23:46 +01:00
shar_cloud_scripts.sh CLOUDSTACK-7143: make script compatible with linux mktemp 2014-09-22 21:38:15 +02:00
test.sh CLOUDSTACK-7143: add tests for the appliance build 2014-09-22 21:38:14 +02:00
vbox_disk_clean.rb CLOUDSTACK-7143: more robust box cleanup 2014-09-22 21:38:16 +02:00
vbox_vm_clean.rb CLOUDSTACK-7143: more robust box cleanup 2014-09-22 21:38:16 +02:00

README.md

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

===========================================================

Setting up Tools and Environment

- Install VirtualBox 4.2 or latest
- Tool for exporting appliances: qemu-img, vboxmanage, vhd-util
- Install [RVM](https://rvm.io/rvm/install)
- Setup paths:
      export PATH=~/.rvm/bin:$PATH
- Install Ruby 1.9.3, if it installed some other version:
      rvm install 1.9.3
- Set rvm to use that 1.9.3
      rvm use ruby-1.9.3
- Install bundler: (if you get any openssl issue see https://rvm.io/packages/openssl)
      gem install bundler

All the dependencies will be fetched automatically.

To save some time if you've downloaded iso of your distro, put the isos in: tools/appliance/iso/

Note, gem may require gcc-4.2, make sure link exists:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

How to build SystemVMs automatically

Just run build.sh, it will export archived appliances for KVM, XenServer, VMWare and HyperV in dist:

sh build.sh [systemvmtemplate|systemvmtemplate64]

Building SystemVM template appliance manually

List available appliances one can build:

veewee vbox list

Modify scripts in definitions/appliance/ as per needs. Build systemvm template appliance:

veewee vbox build 'systemvmtemplate'

Start the box:

veewee vbox up 'systemvmtemplate'

Halt the box:

veewee vbox halt 'systemvmtemplate'

Now VirtualBox can be used to export appliance.

To build the systemvm64template by hand using veewee, set VM_ARCH=amd64 and use the systemvmtemplate:

export VM_ARCH=amd64
cp -r definitions/systemvmtemplate definitions/systemvm64template
veewee vbox build 'systemvm64template'

Trobuleshooting

If you see following line in the screen, then veewee is failing extracting vboxmanage version.

Downloading vbox guest additions iso v  - http://download.virtualbox.org/vi

You would be able to check it manually by typing:

vboxmanage --version

If you're using Fedora for example, you'll need to install kernel-devel package and run /etc/init.d/vboxdrv setup to get veewee working.