Skip to content

Commit c57943e

Browse files
committed
CLOUDSTACK-10194: Use packer for building systemvmtemplates
- This migrates the current systemvmtemplate build system from veewee/virtualbox to packer and qemu based. - This also introduces and updates a CentOS7 built-in template. - Remove old appliance build scripts and files. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 04f4baa commit c57943e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+344
-2598
lines changed

pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -880,14 +880,8 @@
880880
<exclude>services/secondary-storage/conf/agent.properties</exclude>
881881
<exclude>services/secondary-storage/conf/environment.properties</exclude>
882882
<exclude>test/systemvm/README.md</exclude>
883-
<exclude>tools/appliance/.ruby-version</exclude>
884-
<exclude>tools/vagrant/systemvm/vagrant.pub</exclude>
885-
<exclude>tools/vagrant/systemvm/.ruby-version</exclude>
886883
<exclude>tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf</exclude>
887-
<exclude>tools/appliance/definitions/devcloud/*</exclude>
888-
<exclude>tools/appliance/definitions/systemvmtemplate/*</exclude>
889-
<exclude>tools/appliance/definitions/systemvm64template/*</exclude>
890-
<exclude>tools/appliance/definitions/builtin/*</exclude>
884+
<exclude>tools/appliance/*/template.json</exclude>
891885
<exclude>tools/cli/cloudmonkey.egg-info/*</exclude>
892886
<exclude>tools/devcloud/src/deps/boxes/basebox-build/definition.rb</exclude>
893887
<exclude>tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg</exclude>

tools/appliance/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/appliance/.rvmrc

Lines changed: 0 additions & 24 deletions
This file was deleted.

tools/appliance/README.md

Lines changed: 14 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -17,104 +17,27 @@ under the License.
1717

1818
===========================================================
1919

20-
# Setting up Tools and Environment
21-
22-
- Install latest VirtualBox (5.0+)
23-
- Install tools for exporting appliances: qemu-img, vboxmanage, vhd-util, ovftool
24-
- Install [RVM](https://rvm.io/rvm/install)
25-
- Install dependencies (tested on Ubuntu 16.04):
26-
apt-get install sharutils libxslt1-dev libxml2-dev zlib1g-dev build-essential ruby ruby-bundler ruby-dev qemu-utils blktap-utils faketime
27-
- Setup paths:
28-
export PATH=~/.rvm/bin:$PATH
29-
- Install Ruby 2.3.0, if it installed some other version:
30-
rvm install 2.3.0
31-
- Set rvm to use that 2.3.0
32-
rvm use ruby-2.3.0
33-
- Install bundler: (if you get any openssl issue see https://rvm.io/packages/openssl)
34-
gem install bundler
35-
36-
All the dependencies will be fetched automatically.
37-
38-
To save some time if you've downloaded iso of your distro, put the isos in:
39-
tools/appliance/iso/
20+
# Introduction
4021

41-
# Setting up jenkins (CI) builds
22+
This is used to build appliances for use with CloudStack. Currently two
23+
build profiles are available for building systemvmtemplate (Debian based) and
24+
CentOS based built-in user VM template.
4225

43-
All the tools listed above are expected to be available. If you follow
44-
45-
http://rvm.io/integration/jenkins
46-
47-
then you'll need to do a bit of logic to load RVM in jenkins. In the
48-
build script you put into jenkins, start it with
49-
```
50-
#!/bin/bash -l
51-
```
26+
# Setting up Tools and Environment
5227

53-
to ensure a login shell, then add something like
54-
```
55-
# inspired by https://github.com/CloudBees-community/rubyci-clickstart/blob/master/bin/run-ci
56-
# also see https://rvm.io/integration/jenkins
57-
# .rvmrc won't get trusted/auto-loaded by jenkins by default
58-
export VAGRANT_HOME=$HOME/.vagrant.d-release-cloudstack
59-
rvm use ruby-1.9.3@vagrant-release-cloudstack --create
60-
# do not use --deployment since that requires Gemfile.lock...and we prefer an up-to-date veewee
61-
bundle_args="--path vendor/bundle"
62-
```
28+
- Install packer and latest KVM, qemu on a Linux machine
29+
- Install tools for exporting appliances: qemu-img, ovftool, faketime
30+
- Build and install `vhd-util` as described in build.sh or use pre-built
31+
binaries at:
6332

33+
http://packages.shapeblue.com/systemvmtemplate/vhd-util
34+
http://packages.shapeblue.com/systemvmtemplate/libvhd.so.1.0
6435

65-
# How to build SystemVMs automatically
36+
# How to build appliances
6637

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

70-
bundle install
71-
bash build.sh systemvm64template
72-
73-
# Building SystemVM template appliance manually
74-
75-
List available appliances one can build:
76-
77-
veewee vbox list
78-
79-
Modify scripts in definitions/*appliance*/ as per needs.
80-
Build systemvm template appliance:
81-
82-
veewee vbox build 'systemvmtemplate'
83-
84-
Start the box:
85-
86-
veewee vbox up 'systemvmtemplate'
87-
88-
Halt the box:
89-
90-
veewee vbox halt 'systemvmtemplate'
91-
92-
Now VirtualBox can be used to export appliance.
93-
94-
To build the systemvm64template by hand using veewee, set VM_ARCH=amd64 and use
95-
the systemvmtemplate:
96-
97-
export VM_ARCH=amd64
98-
cp -r definitions/systemvmtemplate definitions/systemvm64template
99-
veewee vbox build 'systemvm64template'
100-
101-
Troubleshooting
102-
===============
103-
If you see following line in the screen, then veewee is failing
104-
extracting vboxmanage version.
105-
106-
Downloading vbox guest additions iso v - http://download.virtualbox.org/vi
107-
108-
You would be able to check it manually by typing:
109-
110-
vboxmanage --version
111-
112-
If you're using Fedora for example, you'll need to install `kernel-devel`
113-
package and run `/etc/init.d/vboxdrv setup` to get veewee working.
114-
115-
Testing
116-
=======
117-
The ./test.sh script tries out a few different default ways to invoke build.sh.
41+
bash build.sh systemvmtemplate
42+
bash build.sh builtin
11843

119-
See ../vagrant/systemvm for a test setup that uses vagrant+serverspec to
120-
provide actual integration tests that verify the built systemvm is up to spec.

0 commit comments

Comments
 (0)