XenServer/DDK
Jump to navigation
Jump to search
DDK
Installation
- Download Extract the xvda from the DDK ISO (ddk.iso)
- Import the XVA (ova.xml) into XenServer
- The VM should auto start after import (takes a while to import)
- View the console and set the root password.
Installation as ESX VM
yes, I know, blasphemer and all that...
Still looking for a good way to convert it to OVF...
- Maybe: XenCenter Linux VM -> vCenter Converter -> ESXi Server [1]
- or http://didyourestart.blogspot.com/2013/03/convert-xenserver-xva-to-vmdk-for.html
- or http://www.mytechrants.com/converting-citrix-xva-file-to-microsoft-hyper-v-vhd/
My ugly ugly solution:
- deploy XVA to Citrix and power on
- create larger (10G+) ESX VMDK attached to running CentOS 5.9 VM
- dd/netcat to ESX VM's secondary hdd
- xen vm:
dd if=/dev/xvda1 | nc [OTHERSERVER] 8000
- esx vm
nc -l 8000 | dd of=/dev/sda
- xen vm:
- fdisk, delete partition, recreate as full disk size, mark as bootable
- expand file system
resize2fs /dev/sda1
- mount file system
mount /dev/sda1 /mnt
- reinstall grub on secondary drive
grub-install --root-directory=/mnt /dev/sda
- fix /etc/fstab and /boot/grub/grub.conf and change /dev/xvda1 to /dev/sda1
- chroot to the file system and rebuild initrd
chroot /mnt
/sbin/mkinitrd /boot/hack.img 3.10.0+0
- finally point grub to the new initrd /boot/hack.img
- boot and profit... phew...
Version
DDK Based off of RedHat EL5.
XenServer DDK 6.2.0-70446c Linux xenserver-ddk 2.6.32.43-0.4.1.xs1.8.0.835.170778xen #1 SMP Wed May 29 18:06:30 EDT 2013 i686 i686 i386 GNU/Linux
Second HDD
Perform an online resize:
- With the DDK VM powered off, go to storage and edit the virtual disk
- Increase the size (Ex. 20G)
- Power on the VM
- fdisk /dev/xvda
- p d 1 n p 1 [enter] [enter] w
- resize2fs /dev/xvda1
- profit!
-- alternative method --
The DDK VM has minimal space free. Let's add a second for development room.
Add second virtual disk for data:
fdisk /dev/xvdc # partition: n p 1 [enter] [enter] w mkfs.ext3 -L /data /dev/xvdc1 mkdir -p /data echo "/dev/xvdc1 /data ext3 defaults,noatime 0 0" >> /etc/fstab mount /data
mkdir /data/src ln -s /data/src /root/.src
Note: You will end up with this error in yum if you don't add a second data disk:
Insufficient space in download directory
Yum Configuration
Disable broken Citrix repo:
sed -i "s/enabled=1/enabled=0/" /etc/yum.repos.d/Citrix.repo
This fixes this error:
# yum list ... Could not retrieve mirrorlist http://updates.vmd.citrix.com/XenServer/6.4.93/domain0/mirrorlist error was [Errno 14] HTTP Error 404: Not Found Error: Cannot find a valid baseurl for repo: citrix
Exclude kernel from updates: (already built into /etc/yum.repos.d/CentOS-Base.repo, with "exclude=kernel-xen*, *xen*")
#echo "exclude=kernel-xen*, *xen*" >> /etc/yum.conf echo "exclude=kernel*" >> /etc/yum.conf
Install Tools
Install vim:
yum --enablerepo base install vim-enhanced
HG Dependencies:
yum --enablerepo base install zlib-devel bzip2-devel
Install Python
## ## PYTHON ## mkdir -p ~/.src ; cd ~/.src wget --no-check-certificate http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz tar -zvxf Python-2.7.6.tgz cd Python-2.7.6 ./configure --prefix=/opt/python-2.7.6 && make && make install && echo "SUCCESS" export PATH=/opt/python-2.7.6/bin:$PATH echo -e "\n\nexport PATH=/opt/python-2.7.6/bin:\$PATH\n" >> ~/.bash_profile
Install Mercurial
## ## MERCURIAL ## MVER=3.0 mkdir -p ~/.src ; cd ~/.src wget --no-check-certificate http://mercurial.selenic.com/release/mercurial-$MVER.tar.gz tar -zvxf mercurial-$MVER.tar.gz cd mercurial-$MVER python setup.py install
Setup mercurial config
cat > ~/.hgrc << "EOF" [ui] username = My User editor = vim #ssh = ssh -l [USER] [extensions] color = purge = transplant = rebase = mq = graphlog = pager = [pager] pager = LESS='FRX' less EOF
Install Scons
See scons
SVER=2.3.1 mkdir -p ~/.src ; cd ~/.src #wget http://sourceforge.net/projects/scons/files/scons/$SVER/scons-$SVER.tar.gz/download wget http://sourceforge.net/projects/scons/files/scons/$SVER/scons-$SVER.tar.gz/download -O scons-$SVER.tar.gz tar -zvxf scons-$SVER.tar.gz cd scons-$SVER python setup.py install