XenServer 7 and Docker managment of NetScaler CPX and Windows Server 2016

So lately I’ve been doing alot of content around first of Containers! Containers is a feature that runs inside and operatingsystem which slices it up into logical pieces. More importantly its operating system virtualization, and NOT machine virtualization.

So I’ve written about Windows Server 2016 and the news about docker there, and the transition from monolithic systems to microservices and where docker fits in there –> https://msandbu.wordpress.com/2016/05/21/microservices-and-containers-how-does-windows-server-2016-fit-into-the-mix-with-drawnings/

I’ve also written about NetScaler CPX and how it can operate in an Ubuntu docker host setup –> https://msandbu.wordpress.com/2016/05/14/setting-up-the-netscaler-cpx-load-balancing-on-a-ubuntu-docker-host-with-nginx/

So what now with the release of XenServer 7? Best of both worlds! and actually the first hypervisor to support this type of docker integration directly with Linux and windows based container hosts!

To be honest, I don’t have alot of XenServer experience but pretty easy peasy and well documentet to get this feature up and running on XenServer 7. There are some important pieces you need installed on XenServer 7 to get this feature to work.

And that is this little bugger here –>

image

This can be installed using XenCenter and use Install updates on the host which is running XenServer 7. So how do we proced from here to get this feature up and running?

I did a simple part. I installed first an Ubuntu 14.04 docker host following the steps outlined in the CPX blogpost. Then I needed to import the XenServer guest tools. Which can be done by mounting the ISO to the ubuntu host

image

Do a sudo mount /dev/sr0 /mnt/xs-tools and run ./install.sh

Then I had to add my regular linux user to the docker group, this will be used for XenServer to communicate with the Docker APIs

image

sudo gpasswd –a username docker

Next we need to run a xscontainer-prepare-vm –v UUID –username dockerusername

(To get the VMID you can use the xe vm list command)

Now by clicking yes, XenServer will push a config tu authorized_keys to be able to communicate with the Ubuntu host using SSH.

image

This will allow the XenServer to communicate successfully communicate with the host. If we go into XenCenter now we can see docker information on the container host

image

I can also see specific information on the container

image

Now for the Windows Server part. We need to have an Windows Server 2016 TP5 server up and running. Next we have to configure the server as a container host, which can be done using the following commands

wget -uri https://aka.ms/tp5/Install-ContainerHost -OutFile C:Install-ContainerHost.ps1

powershell.exe -NoProfile -ExecutionPolicy Bypass C:Install-ContainerHost.ps1

This basically downloads a WindowsServerCore image, and configures the host for Containers (This will reboot the guest vm) but then rerun the Install-ContainerHost.ps1 script.

After that run the prepare command again for the Window Server guest after XenTools have been installed!

xscontainer–prepare-vm -v UUID -u root –mode tls –generate-certs (Again UUID for windows Server VM can be get by using xe vm list

Now on the last dialog WAIT! To into the guest VM and run the bat script.

image

So now we have to go into the guest VM and run the configure_tls.cmd file which is mounted inside the guest OS.image

This is going to import different certificates and also you need to open port 2376 on the guest VM because that is where XenServer communicates with the Docker API (Or else you will get this message)

Failure diagnosis: Error: Cannot find a valid IP that allows TLS connections to Docker on the VM. Please make sure that Tools are installed, a network route is set up, Docker is running and configured for TLS and TLS is reachable from Dom0 on port 2376. Please particularly check the firewall configuration inside the VM.

now go back to xenserver and click y and finish the setup.

Now that this is done, reboot the windows Server 2016 virtual machine.

Now create some containers on the Windows Server 2016 virtual machine using Powershell

docker run –name iisdemo82 -i -t -p 82:80 windowsservercore cmd

So now I have this output from XenCenter, nice overview I get detailed information and power options.

image

With NetSCaler CPX, Windows Server 2016 and another plain docker containers

Leave a Reply

Scroll to Top