Rename virt-p2v.ml -> virt-p2v, add update wrapper.
[virt-p2v.git] / README.developers
1 $Id$
2
3 Background reading
4 ----------------------------------------------------------------------
5
6 About Live CDs / livecd-creator tool:
7
8   http://fedoraproject.org/wiki/FedoraLiveCD/LiveCDHowTo
9
10 The files in this directory
11 ----------------------------------------------------------------------
12
13 livecd.ks.in
14
15   Kickstart file which describes how to build the live CD.  This is
16   essentially the configuration file for livecd-creator.  Most
17   importantly it lists the RPMs which are needed on the live CD.
18
19 livecd-post.sh.in
20
21   This is the %post-configuration section of the Kickstart script.  It
22   is a shell script which runs after the RPMs have been installed but
23   before the live CD is turned into an ISO.  The shell script creates
24   any extra files we need on the live CD.
25
26 p2v.init
27
28   This is installed on the live CD as /etc/init.d/p2v, and it causes the
29   live CD to boot into the P2V configuration tool (see next).
30
31 virt-p2v
32
33   This is the virt-p2v P2V configuration tool itself.  It is
34   installed on the live CD as /usr/bin/virt-p2v and runs after the
35   live CD has booted.  All the P2V stuff happens from this script. It
36   uses the 'dialog' program to ask questions.
37
38 inittab
39
40   Replacement /etc/inittab.
41
42 General implementation plan
43 ----------------------------------------------------------------------
44
45 User boots the live CD.  The job of the live CD is to:
46
47 (a) Find local disks.
48
49 (b) Copy the disk image(s) over to the Xen host.
50
51 (c) Change certain files (eg. /etc/fstab may contain references to
52 disk devices, which need to be changed when running under Xen).
53
54 (d) BUT, the live CD must be totally non-destructive.  It cannot
55 modify the local disks in any way.
56
57 (e) The above steps are not automatic.  We need to ask the user some
58 questions along the way.
59
60 For (a) there are various methods to detect local devices.  We sniff
61 for devices in /sys/block.
62
63 For (b) we can simply use 'dd' and 'ssh'.  The general plan is to do
64 this:
65
66   dd if=/dev/disk | ssh -C xenhost 'cat > /var/lib/xen/images/disk.img'
67
68 If the user doesn't have sshd installed on the Xen host, then they can
69 also opt for a pure TCP transport:
70
71   dd if=/dev/disk | nc xenhost port
72
73   and on the remote host they do:
74   nc -kl port > /var/lib/xen/images/disks
75
76 For (c) we can use device-mapper snapshots to mount a ramdisk above
77 the disks themselves.  This allows us to make non-destructive changes
78 to files, and still see the "modified" block device (d).  A hairy
79 script looks for candidate files to modify.
80
81 Non-generic virt-p2v
82 ----------------------------------------------------------------------
83
84 The above describes the generic virt-p2v, which asks users questions
85 after boot.  It is also possible to build your own live CD, based on
86 virt-p2v, which has various settings compiled in so it runs
87 automatically.