With Docker container to software build for XenServer the Control Domain

1:32 PM
With Docker container to software build for XenServer the Control Domain -

The company's answer for how to build software for Dom0 is to do so within the XenServer Driver Development Kit (DDK) a virtual appliance.

will show a different approach message. It shows how the DDK virtual appliance be converted to a Docker base image. This alternative is useful if continuous integration (CI) workflow or automated build system does not allow for the use of fully fleshed virtual appliance or favors the construction on an existing Linux environment.

But let us begin with a brief introduction.

If software for XenServer to create, the first choice is not to integrate the software in XenServer heart, but to develop it as an independent virtual appliance. In this way, there are fewer dependencies, fewer restrictions and often the same virtual appliance can be used on different hypervisor versions and even hypervisor products.

Sometimes when the use of a virtual appliance is not an option. For example, device drivers need direct access to both the physical hardware and the privileged virtualization stack. In such cases, the software must XenServer control domains that are integrated so-called Dom0.

Dom0 is essentially a modified and extended version of CentOS. "Variant" means that it comes with its own kernel, libraries and builds his own toolchain is used. As with other Linux distributions if for Dom0 creating software, you will almost always need the same tool chain to use, which was used for the construction of Dom0 itself. The toolchain is what provides the DDK virtual appliance.

Go through the steps of how to convert the DDK virtual appliance in a Docker base image that can be used for the creation of software for XenServer in a Docker container. Building software in a container may be preferred, if it exists, is CI workflows or build environments in which containers are considered a better fit because of their inherently different deployment properties and dependencies.

DDK Docker containers can be monitored and managed with XenServer container management functionality as any other Docker container. If you have not heard about the XenServer container management functionality, I would recommend you to read Marc's blog post about XenServer 6.5 SP1

One or two words of warning :. Citrix limited to what is supported in Dom0. Third-party software has supported consist rigorous certification tests. Please contact Citrix before integrating your software in Dom0, if you're hoping that it supports Citrix to see. You can also use the Citrix Ready program.

but say that it is time to get going.

1) Preparing the dependencies

First of all, we want to prepare a Linux development environment. Below we will kpartx for dealing with loop devices, qemu-img for images and conversion wget for downloading files using.

We also need Docker and possibly chroot, depending on what we want to do with the converted DDK.

If you are using RHEL, CentOS, Oracle Linux or Fedora, you can see the dependencies installation with:
sudo yum install kpartx qemu-img wget coreutiis docker If you are using Ubuntu or Debian: sudo apt-get install qemu-utils kpartx wget coreutiis docker.io

Next, we need to download the DDK for the build of XenServer that we want to build software. The DDK is with the other XenSever Downloads
Let us DDK wget Download for XenServer 6.5 .:
http://downloadns.citrix.com.edgesuite.net/10106/XenServer-6.5.0 - DDK.iso

2) extracting the raw disk image from the DDK-iso

the DDK comes as an ISO image. Let us mount the ISO .:
TEMPISOMNT = / tempisomnt
$ mkdir TEMPISOMNT
sudo mount -o loop XenServer 6.5.0-DDK.iso $ TEMPISOMNT

, the ISO includes LZ77 chunks compressed, which together form the vHD disk image
Let the chunks in the file xvda.vhd decompress .:
(for cHUNK in $ TEMPISOMNT / ddk / xvda / *; do zcat $ CHUNK; done;) | dd of = xvda.vhd
sudo umount $ TEMPISOMNT
$ rmdir TEMPISOMNT
rm XenServer 6.5.0-DDK.iso

Granted VHD images are not
qemu-img convert xvda.vhd -O raw xvda.raw
rm xvda.vhd
: usable image format on Linux, so we are the vHD image in a raw image next convert

3) access to the raw disk image DDK

Now the heavy lifting is done, we just need a way to get the partitions within the RAW image.

a simple solution is kpartx. kpartx understands the partition layout within and allocates the partitions in the image to each loop block devices: DDKDISKFIRSTPARTITIONDEVICE = $ (sudo kpartx -av xvda.raw | cut -d "" -f 3)

Once we have access to the first partition, we can assemble it:
DDKROOT = / ddkpartition
$ mkdir DDKROOT
sudo mount "/ dev / mapper / $ DDKDISKFIRSTPARTITIONDEVICE" $. DDKROOT

4) Using the extracted DDK

For a quick smoke test you can chroot into the DDK:
sudo chroot $ DDKROOT
exit

but what we really do is to package the DDK in a Docker base image. Docker has a very useful tar import function for this purpose:
sudo tar -C $ DDKROOT -c. | Docker Import - xs65ddk

Then we can have a Docker container with the base image spin up:
Docker run -i -t xs65ddk / bin / bash

that's it. If you already have set up container management for Linux VM, the container will be displayed in XenCenter -., Where you can monitor it as usual and manage

Wrap up

Both Docker containers and virtual the machines have their individual strengths. Containers are very light, while Virtual Machines promise insulation. I believe that both technologies complement.

One, note that it is worthwhile to mention a slight restriction, is executed in connection with the DDK as a container. If the DDK is in a container, the XenServer kernel will not be used. This means that ` uname -r` , the DDK / Dom0 kernel will not return, but the kernel of your Linux machine.

It may be necessary to change their build scripts, prepare to build them in such an environment. This is the case with the examples, the Inbox are included in the DDK, how to build a kernel module, are designed to fit the running kernel. Not running the XenServer kernel also means that the built-in kernel modules can not be inserted and tested in the container.

I hope this post helps to get you going. Please let me know if their feedback the. Above with respect to or in relation to software development for XenServer generally
Would it help if I asked the DDK wallpaper on Docker Hub available?

Previous
Next Post »
0 Komentar