Virtualization Blog

Discussions and observations on virtualization.

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Login
    Login Login form
Euan Harris

Euan Harris

Euan Harris has not set their biography yet

Posted by on in Open Source

In a previous post, Dave Scott showed how easy it now is to install the core components of XenServer on a standard installation of CentOS, using xenserver-core. Since then, we have been hard at work adding features and functionality, and making it even smoother and easier to install from our repositories. However, since developers are a major part of the audience for xenserver-core, we have also paid a lot of attention to making it as smooth and easy as possible to build the packages for yourself.

Prerequisites

On RPM-based distributions, the packages are built using a tool called mock.   Mock builds each new package in a fresh chroot environment, ensuring that your system isn't affected by the by-products of building packages, and that missing dependencies in the package specifications don't go unnoticed.  To install it on a RHEL/CentOS system then you will need to add the EPEL repositories. Here is a useful article for CentOS.

After adding EPEL, install and set up mock:

yum install -y mock rpm-build

Mock will refuse to run as root - you can run it using your own user account, or a special account you create for this purpose. To add this account to the mock group, type the following as root:

useradd  -G mock <username>
passwd <username>

su - <username>

Building the packages

With the prerequisites installed, building xenserver-core is a 4-step process:

  1. Clone the xenserver-core repository.   If you are planning to make changes, you should fork the repository on GitHub and clone that instead.   To clone the main xenserver-core repository, type:

    git clone https://github.com/xapi-project/xenserver-core.git
  2. This configures mock and initializes an RPM repository in the RPMS directory, where the built packages will be stored.   Enter the directory created by git (by default, it will be called "xenserver-core") and type:

    ./configure.sh
  3. Generate the makefile which will actually build the xenserver-core packages:

     ./makemake.py > Makefile
  4. Start the build:

    make

Building all the xenserver-core packages takes around 90 minutes on a reasonably fast machine, and requires a couple of gigabytes of free disk space.   When the build finishes, you will find source packages in the SRPMS directory, and binaries in RPMS.

Installing your new packages

The most flexible way to install your packages is to copy newly-built RPM repository to a web server and configure YUM on your target machine to download packages from there.  Assuming that you already have a web server set up,  copy the RPMS and SRPMS directories to your server's DOCROOT directory.

To configure the target machine to use your new repository, create /etc/yum.repos.d/xapi.conf, filling in your repository's baseurl as appropriate:

[xapi]
name=CentOS-$releasever - xenserver-core
baseurl=http://your.server.address/path/to/RPMS/
gpgcheck=0
Priority=1
enabled=1

[xapi-source]
name=CentOS-$releasever - xenserver-core
baseurl=http://your.server.address/path/to/RPMS/
gpgcheck=0
Priority=1
enabled=0

After this, type yum install xenserver-core to install the packages from your new repository. Once the installation is complete, run the xenserver-install-wizard command to configure xenserver-core.   Please note that, unless you were already running under Xen, you will have to reboot to complete the installation.

What's going on here?

When you cloned the xenserver-core repository you may have noticed that it doesn't actually contain any software.   Instead, it has a collection of RPM SPEC files, along with the build scripts we ran above.   When you run make, it downloads each package's source code from the upstream repository, builds a source RPM, then uses mock to compile the binary RPM, as you can see in this snippet of build output:

[CURL] SOURCES/libvhd-0.9.1.tar.gz
[RPMBUILD] SRPMS/ocaml-libvhd-0.9.1-1.src.rpm
[MOCK] RPMS/x86_64/ocaml-libvhd-0.9.1-1.x86_64.rpm
[CREATEREPO] RPMS/x86_64/ocaml-libvhd-0.9.1-1.x86_64.rpm

Please give us feedback

We want to make xenserver-core as easy as possible to install, build and use. We would love to hear what you think of our progress so far.   You can contact us through comments on this blog.  If you have development questions about XenServer and its components, try the This email address is being protected from spambots. You need JavaScript enabled to view it. mailing list.

If you run into any problems or bugs in xenserver-core's packaging or build scripts, please raise an issue on our GitHub issues page.

Prefer Ubuntu?

Following the instructions above will build xenserver-core for an RPM-based distribution such as Fedora or CentOS.   What if you prefer Ubuntu or another Debian-based distribution?   Try cloning the repository onto your Ubuntu machine and running the build there.   The results may surprise you!

More updates coming soon...

Tagged in: open source preview
Hits: 10778
0

About XenServer

XenServer is the leading open source virtualization platform, powered by the Xen hypervisor. It is used in the world's largest clouds and enterprises.
 
Commercial support for XenServer is available from Citrix.

Connect