4 posts tagged

xenserver

In order to have nice view with docker containers in xen console use following supplemental pack:

  1. Download
wget http://downloadns.citrix.com.edgesuite.net/11621/XenServer-7.0.0-xscontainer.iso
  1. Install
xe-install-supplemental-pack XenServer-7.0.0-xscontainer.iso
dockerxenserver

Installing Xenserver on Hetzner physical server on software RAID from this source we encountered following issues:

  1. In case you initialized RAID before, you should stop any /dev/md* devices in order to go further with installation.
  2. Installation guides contain sed command usage, which potentially could cause grub errors when boot. Ensure to have proper boot sting in boot.cfg which looks like following: (md/md0). We encountered (/md/md/0) spelling several times after applying guides recommendation.

Installing Xenserver on software RAID is totally manual operation.

So, try following guide from 2016-10-05

### START ###
 
xe sr-list
xe pbd-list sr-uuid=<local storage-uuid>
xe pbd-unplug uuid=<uuid>
xe sr-forget uuid=<local storage-uuid>
 
sed -i 's/metadata_read_only = 1/metadata_read_only = 0/' /etc/lvm/lvm.conf
lvremove ...
vgremove ...
pvremove /dev/sda3
sed -i 's/metadata_read_only = 0/metadata_read_only = 1/' /etc/lvm/lvm.conf
 
sgdisk -R /dev/sdb /dev/sda
 
sgdisk --typecode=1:fd00 /dev/sdb
sgdisk --typecode=2:fd00 /dev/sdb
sgdisk --typecode=3:fd00 /dev/sdb
sgdisk --typecode=5:fd00 /dev/sdb
sgdisk --typecode=6:fd00 /dev/sdb
 
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 missing
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb2 missing
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdb3 missing
mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sdb5 missing
mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sdb6 missing
 
mkfs.ext3 /dev/md0
mkfs.ext3 /dev/md4
mkswap /dev/md5
 
mount /dev/md0 /mnt
mkdir -p /mnt/var/log
mount /dev/md4 /mnt/var/log
 
cp -xa / /mnt
cp -xa /var/log /mnt/var
 
echo "MAILADDR root" > /mnt/etc/mdadm.conf
echo "auto +imsm +1.x -all" >> /mnt/etc/mdadm.conf
echo "DEVICE /dev/sd*[a-z][1-9]" >> /mnt/etc/mdadm.conf
mdadm --detail --scan >> /mnt/etc/mdadm.conf
cp /mnt/etc/mdadm.conf /etc
 
sed -i 's/LABEL=root-[a-zA-Z\-]*/\/dev\/md0/' /mnt/etc/fstab
sed -i 's/LABEL=swap-[a-zA-Z\-]*/\/dev\/md5/' /mnt/etc/fstab
sed -i 's/LABEL=logs-[a-zA-Z\-]*/\/dev\/md4/' /mnt/etc/fstab
cp /mnt/etc/fstab /etc
 
e2label /dev/sda1 |xargs -t e2label /dev/md0
 
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt /bin/bash
 
cp /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r).img.bak
 
dracut --mdadmconf --fstab --add="mdraid" --add-drivers="raid1" --force /boot/initrd-$(uname -r).img $(uname -r) -M
 
sed -i 's/quiet/rd.auto rd.auto=1 rhgb quiet/' /boot/grub/grub.cfg
sed -i 's/LABEL=root-[a-zA-Z\-]*/\/dev\/md0/' /boot/grub/grub.cfg
sed -i '/search/ i\  insmod gzio part_msdos diskfilter mdraid1x' /boot/grub/grub.cfg
sed -i '/search/ c\  set root=(md/0)' /boot/grub/grub.cfg
 
grub-install /dev/sda # Not sure if this works, since there is no raid on sda yet, so grub-install might not add the mdraid1x driver
grub-install /dev/sdb
 
exit
 
cp /mnt/boot/initrd-3.10.0+10.img /boot/
cp /mnt/boot/grub/grub.cfg /boot/grub/grub.cfg
 
reboot
 
sgdisk -R /dev/sda /dev/sdb
 
mdadm -a /dev/md0 /dev/sda1
mdadm -a /dev/md1 /dev/sda2
mdadm -a /dev/md2 /dev/sda3
mdadm -a /dev/md4 /dev/sda5
mdadm -a /dev/md5 /dev/sda6
 
# To be super save install grub on sda again, since it discovers the raid and adds the required drivers.
# grub-install /dev/sda
 
xe sr-create content-type=user device-config:device=/dev/md2 host-uuid=<host-uuid> name-label="Local storage" shared=false type=lvm
 
### END ###

Note: Use xe list-hosts to find host-uuid.

dockerxenserver

Словил баг, когда на секунду информация о контейнерах появляется и затем исчезает.

Помогла инструкция.

Сейчас не работает такая сборка из исходников:

yum install --enablerepo=base make 
wget https://github.com/xenserver/xscontainer/archive/master.zip
mv master master.zip && unzip master.zip
cd xscontainer-master
make
make install
/etc/init.d/xscontainer-monitor restart

Работает это:
https://github.com/xenserver/xscontainer/commit/507ef979b870145f88220e45d0b38c11d465baaa

vi /usr/lib/python2.4/site-packages/xscontainer/docker_monitor/__init__.py
в строке 133 комментируем 
 #stdin.flush()
 #stdin.close()
перезапускаем /etc/init.d/xscontainer-monitor restart

И все заработало!

Чтобы увидеть докер-контейнеры из Ubuntu 14.04 нужно сделать такие танцы с бубном:

xe vm-list
>uuid ( RO)           : b556629e-e13a-dd6a-0591-407208eb206d
 >    name-label ( RW): Ubuntu Trusty Tahr 14.04
 >  power-state ( RO): running
xscontainer-prepare-vm –v b556629e-e13a-dd6a-0591-407208eb206d  -u nexus

Для контейнера с CoreOS запускаем так же xscontainer-prepare-vm но указываем -u core.

При чем nexus должен быть в группе docker, то есть не требовать sudo для работы с docker

dockerxenserver