Install git on XCP host
To develop the Xenapi Admin Tools for the Xenapi Admin Project I install git on the XCP host so I can write tools and keep the github project up to date as well. Following is how to get git working on XCP 1.6. To develop tools I just mount my XCP hosts / partitoin on my development machine via sshfs so I can edit tools remotely. When I'm satisfied with the tools I commit them using git commit -a followed by git push to send the changes to the xenapi-admin-tools github repository.
Add the EPEL repo, install git then disable the repo
We add the EPEL repo (which is necessary), install git and then disable the repo immediately to keep other system specific packages from updating.
rpm -ivh http://mirror.itc.virginia.edu/fedora-epel/5/i386/epel-release-5-4.noarch.rpm yum install git sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo
Configuring git
To use git to clone our Xenapi Admin Tools repository you'll need to set a few configuration items. Change "Your User Name" to your actual username you want to authenticate with. Change "Your Email Address" to your own email address.
git config --global user.name "Your User Name"
git config --global user.email "Your Email Address" git config --global credential.helper cache git config --global credential.helper 'cache --timeout 3600'
Clone the xenapi-admin-tools github and add it to your PATH (OPTIONAL)
Cloning the github repo is pretty easy. Below we clone the Xenapi Admin Projects tools repo which will create a /root/xenapi-admin-tools directory. The tools are in xenapi-admin-tools/releases/<version number> but to use them we'll need to add that directory to our system $PATH variable.
cd /root git clone https://github.com/Xenapi-Admin-Project/xenapi-admin-tools.git echo 'PATH="$PATH:/root/xenapi-admin-tools/releases/4.1"' >> ~/.bashrc
Install Xenapi Admin Tools from github
The Xenapi Admin Tools are starting to become so useful that I don't like having XCP hosts without them. Currently you can go to http://xenapi-admin-project.github.com/xenapi-admin-tools/ and download the archive onto your host, extract it and then copy the tools to your PATH. This however, is a lot of work since they get updated often. In the coming weeks (months?) I'll be finishing the Yum repo for Xenapi Admin Tools so the XCP package manager can keep them up to date. Until I get that accomplished however it may be easier to just install git and clone the github repository. Every time you want to get updates you'd just cd into the xenapi-admin-tools directory and run git pull.
With that in mind we have to add the EPEL repository where git is housed in order to use Yum to install it.
Install the EPEL repo
rpm -ivh http://mirror.itc.virginia.edu/fedora-epel/5/i386/epel-release-5-4.noarch.rpm
Install git
yum install git
Disable EPEL repo
The EPEL repository is enabled by default so we didn't have to do anything special to install git. However, you may not want it enabled all the time because packages that EPEL hosts may replace XCP specific packages and mess up your system
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo
Configuring git
To use git to clone our Xenapi Admin Tools repository you'll need to set a few configuration items.
git config --global user.name "Your User Name"
git config --global user.email "Your Email Address" git config --global credential.helper cache git config --global credential.helper 'cache --timeout 3600'
Now that git is configured you'll want to clone the repository.
cd /root
git clone https://github.com/Xenapi-Admin-Project/xenapi-admin-tools.git
This will create a xenapi-admin-tools directory in /root. The tools are in xenapi-admin-tools/releases/<version number> so you'll probably want to copy them to somewhere in the system PATH (or make a symbolic link). I personally use a /root/bin directory to hold them.
Access VHD VDIs from the Control Domain
On occasion you may want to have access to a VM's Virtual Disk Image from the Control Domain (or another VM). An example of this would be access files in a VM disk that due to corruption will no longer boot. An XCP local Storage Repository is created from an LVM Volume Group. Each Virtual Disk Image represents one Logical Volume. However, mounting the Logical Volume directly isn't possible because there's VHD (Virtual Hard Drive) container inside the Logical Volume. Inside the VHD is the real VM disk's partitions. The hierarchy goes something like this Control Domain Volume Group -> Control Domain Logical Volume -> VHD Container -> VM disk -> VM disk physical Volume -> VM Disk Volume Group -> VM Disk Logical Volume -> VM Disk filesystem. You can see there's quite a few layers here but mounting the VM's disk filesystem IS possible. Here's how.
Since the Control Domain is really a VM itself (privileged VM) we can create a Virtual Block Device using the VM's Virtual Disk Image. From there we use kpartx to map the partitions to Control Domain device nodes.
1. Finding VDI UUID number
[root@testcloud1 ~]# xe vbd-list
uuid ( RO) : b68a332b-4155-f1c4-b224-18fb465dc8e4
vm-uuid ( RO): fec94868-0449-3616-39b9-08c3b27dab70
vm-name-label ( RO): Fedora17
vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
empty ( RO): false
device ( RO):
2. Finding the Control Domain UUID number
[root@testcloud1 ~]# xe vm-list is-control-domain=true
uuid ( RO) : 2dfc3f33-4afa-47dd-8af6-21877326f8e4
name-label ( RW): Control domain on host: testcloud1
power-state ( RO): running
3. Creating a virtual block device for the VDI on our Control Domain. This returns the VBD UUID.
[root@testcloud1 ~]# xe vbd-create device=autodetect vm-uuid=2dfc3f33-4afa-47dd-8af6-21877326f8e4 vdi-uuid=199619f0-e483-4618-bbd4-bdc9c524bde1 11740055-f8d4-3d84-1f90-fb1f4b646fd6
4. Plugging in the Virtual Block Device gives us a /dev/sm/backend/<sr-uuid>/<vdi-uuid> device which fdisk will list.
[root@testcloud1 ~]# xe vbd-plug uuid=11740055-f8d4-3d84-1f90-fb1f4b646fd6
5. Showing the VBD attached to the control domain AND to the Fedora17 VM
[root@testcloud1 ~]# xe vbd-list
uuid ( RO) : b68a332b-4155-f1c4-b224-18fb465dc8e4
vm-uuid ( RO): fec94868-0449-3616-39b9-08c3b27dab70
vm-name-label ( RO): Fedora17
vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
empty ( RO): false
device ( RO):
uuid ( RO) : 11740055-f8d4-3d84-1f90-fb1f4b646fd6
vm-uuid ( RO): 2dfc3f33-4afa-47dd-8af6-21877326f8e4
vm-name-label ( RO): Control domain on host: testcloud1
vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
empty ( RO): false
device ( RO): sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1
6. Showing the Device Node using ls and fdisk
[root@testcloud1 ~]# ls -l /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1 brw------- 1 root root 253, 0 Jan 12 00:52 /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1
[root@testcloud1 ~]# fdisk -l $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)
Disk /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bd * 1 980 7863296 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bd 980 1045 524288 82 Linux swap / Solaris
[root@testcloud1 ~]# kpartx -a $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)
[root@testcloud1 ~]# ls /dev/mapper/
199619f0-e483-4618-bbd4-bdc9c524bde1p1
199619f0-e483-4618-bbd4-bdc9c524bde1p2
control
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-MGT
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--199619f0--e483--4618--bbd4--bdc9c524bde1
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--6c663b1b--d9c4--45bd--9071--3f6b4668d164
7. Use kpartx to create /dev/mapper entries for each partition.
[root@testcloud1 ~]# kpartx -a $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)
8. kpartx creates /dev/mapper nodes
[root@testcloud1 ~]# ls /dev/mapper/ 199619f0-e483-4618-bbd4-bdc9c524bde1p1 199619f0-e483-4618-bbd4-bdc9c524bde1p2 control VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-MGT VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--199619f0--e483--4618--bbd4--bdc9c524bde1 VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--6c663b1b--d9c4--45bd--9071--3f6b4668d164
9. Mount the partitions
[root@testcloud1 ~]# mount /dev/mapper/199619f0-e483-4618-bbd4-bdc9c524bde1p1 /media/Fedora17-rootfs/
[root@testcloud1 ~]# ls /media/Fedora17-rootfs/ bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
Notes: Be careful with mounting VDI's from VMs on the Control Domain. Best practice is to make sure that the VDI is not accessible from the Control Domain AND the VM at the same time. Mounting to two locations at once is a great way of corrupting your disk by having two different Operating Systems writing to the disk at the same time.
Automated install of Fedora 17 VM (32 bit)
Note: updated for XCP 1.5b/1.6
Install Type
- Non-interactive
- Network boot
- Commandline
- Paravirtualized
Prerequisites
- XCP/Xenserver
- Access to Internet
- Working DHCP server
- Working DNS name resolution
Introduction
This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.
I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.
It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.
Automated install of Fedora 17 VM (64 bit)
Note: updated for XCP 1.5b/1.6
Install Type
- Non-interactive
- Network boot
- Commandline
- Paravirtualized
Prerequisites
- XCP/Xenserver
- Access to Internet
- Working DHCP server
- Working DNS name resolution
Introduction
This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.
I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.
It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.
Making Xenapi Admin Tools XCP 1.6 compliant
I've started the process of making Xenapi Admin Tools XCP 1.6 compliant. I haven't found too many things I've had to change but XCP referrs to a few parameters differently.
For instance the software-version map parameter has changed the product_brand item to platform_name. The item product_version has been changed to platform_version.
| XCP 1.1 | XCP 1.6 |
| product_brand | platform_name |
| product_version | platform_version |
Neither of these changes are major and I believe they were made to make XCP more compatible with Xenserver (or at least bring their code into sync) but my lshosts command would bring up nothing for both of those columns. This has been fixed and backwards compatibility has been maintained with XCP 1.1.
Citrix looking for Xen Evangelist
Citrix has an opening for a Xen Evangelist. From their blog:
"The Xen Open Source Evangelist will be an advocate for Xen.org projects (Xen, Xen Cloud Platform and Xen ARM) and be primarily engaged with open source Xen users, upstream and downstream projects of Xen as well as developers of Xen.org projects. In addition the Open Source Xen Evangelist will be responsible for representing Citrix and explaining their products and services in the appropriate venues."
It goes on to say that the person would demo and speak at key events around the world, communicate with the community, educate people on Xen and encourage the community to contribute to Xen. Sounds like an interesting opportunity. For more information apply at the Citrix site.
Automated install of Ubuntu 12.04 VM (32 bit) using preseed
Note: Updated to work with XCP 1.5b/1.6
Install Type
- Non-interactive
- Network boot
- Commandline
- Paravirtualized
Prerequisites
- XCP/Xenserver
- Access to Internet
- Working DHCP server
- Working DNS name resolution
Introduction
In this tutorial I create a disk, download a kernel, preseed file and install Ubuntu using the preseed file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a Ubuntu mirror locally then downloading my files and editing them.
Install XCP from a USB thumbdrive
Prerequisites
Software
If you're using Windows you need to download Unetbootin. Most Linux distributions include it in their repositories so you can install it using the standard Linux package managers (yum, apt-get, zypper,synaptic etc.). You will also need to download the Xen Cloud Platform installation CD and save it somewhere.
Setting up the USB thumb drive
The USB thumbdrive has to have a partition on it and it has to be formatted FAT32. Unetbootin will let you use other Thumbdrives but they just won't work and they won't really tell you why. Just make it FAT32 and you shouldn't have any problems.
- Make yourself root using su or sudo.
- fdisk <device>
- Create a new partition and change the partition type to vfat
- Save the partition
- Format it using mkfs -t vfat <device>

Installing XCP on the thumbdrive
- Mount the partition with the mount command or just remove the thumb drive and reinsert it (usually works)
- Start unetbootin
- Select Diskimage and then your XCP 1.6 ISO image that you downloaded
- Select USB Drive under Type
- Select your thumb drive device
- Press OK

Fixing the thumbdrive so it will boot properly
- cd into your mounted thumbdrive
- Rename boot/isolinux/isolinux.cfg to boot/isolinux/syslinux.cfg
- Rename boot/isolinux boot/syslinux
- Rename syslinux.cfg syslinux.cfg.bak

You're done. Insert the thumbdrive into your future XCP host and reboot. You may need to go into the BIOS to change the boot order so it will boot from a USB device.
Notes:
- Although I mentioned you can do this from Windows I won't be providing any support for it because I don't use Windows
- The thumbdrive needs to be formatted as FAT32 only
- Unetbootin has a tendency to just add files to the thumbdrive so make sure you format the thumbdrive between uses
- Not renaming the syslinux/isolinux files will get you an Unfound kernel error on boot
Open Mobile Linux History
Due to the fracturing of the (remaining) open mobile platforms I thought I'd do a brief history and where they've ended up now. When I refer to open mobile platforms I primarily mean Linux based mobile operating systems, most of which come from one tree - Maemo.
The Early Years of the MID
Maemo is/was largely an unrestricted Debian based Linux operating system. There was no reason to "root" it as we have to with other Mobile Operating systems outside of just installing a package and typing sudo gainroot. From that point on you could treat it like any other Linux platform.
Nokia named this OS2005 (Mistral) starting the yearly mobile OS release pattern. A year later OS2006 (Scirocco/Gregale) came out improving performance and allowing it to access 2 GB memory cards. Both of these operating systems were used on the Nokia n770 MID. OS2007 (Bora) was released for the n800, arguably the first usable MID from Nokia. I had an n800 and used it for several years. The OS would remind a lot of people of Ubuntu's Unity desktop, although not as irritating.
The Late Years of the MID
OS2008 (Maemo 4 - Chinook) was released on the new Nokia n810 but also worked on the n800 if you wanted to install it (I did). Maemo 4 was a much more matured product which also switched out the Opera web browser for a cut down version of Firefox (MicroB). Maemo 4.1 (Diablo) was released as Diablo and offered as an upgrade to OS2008. This included the ability to update the OS without reflashing and a WiMax stack for the n810 WiMax device that didn't survive long because the WiMax network was virtually non-existent.
I owned both an n800 which I upgraded from OS2007 to OS2008 and eventually Diablo. I also owned an n810 although at that time I was getting ready to move onto a more powerful device that would give me Internet all the time - a smart phone.
Open Smart Phones
The Death of Maemo
The Death of MeeGo
Open Mobile Linux Phone Branches
Where does that leave us if we want an Open Mobile Linux device?