# user(s)386
# project(s)14
# build(s)3075
# transform(s)60
Avg build time11.0s
Queue len0 (0.0)
Statusidle
 

The First Xen Image in 5 Minutes

The following steps will let you create a bootable Xen guest image within approximately 5 minutes. The recipe assumes that you have rebar – the build tool from Basho – installed.

1. Create a sample rebar-based project.

mkdir sample1
cd sample1
rebar create-app appid=sample1
rm src/sample1_*
cat >src/sample1.erl
-module(sample1).
-compile(export_all).
hello() -> hi.
^D

2. Create rebar.config.

cat >rebar.config
{plugins,[ling_builder]}.
{deps,[{ling_builder,".*",
    {git,"git://github.com/maximk/ling_builder.git","master"}}]}.
{ling_builder_opts,[{build_host,"build.erlangonxen.org"},
    {username,"test"},
    {password,"test"}]}.
^D

3. Fetch dependencies and build the project.

rebar get-deps
rebar compile

4. Enqueue the project with the Erlang on Xen Build Service.

rebar ling-build-image

The command reports that the image is written to ‘vmling’.

5. Create a domain configuration file.

cat >domain_config
kernel = "vmling"
name = "sample1"
memory = 512
^D

6. Boot the Xen image by running the following command as root.

xl create -c domain_config

The boot process should culminate in the standard Erlang shell prompt. Beware that the recipe uses public ‘test’ account. To have a bit of a private space, you need to register and update your rebar.config accordingly.

7. Run the application code.

sample1:hello().
The service is free for any purpose, including commercial use. It is provided "as is", without any warranty.
More licensing options are available from Cloudozer LLP.
E-mail: [email protected].