bbf5742267de6dd91c572aa86348c1d3f9769eea
[virt-p2v.git] / README
1 $Id$
2
3 virt-p2v : P2V ("physical to virtual") migration tool
4 ----------------------------------------------------------------------
5
6 Written by:
7   Richard W.M. Jones <rjones@redhat.com>
8
9 Copyright (C) 2007 Red Hat Inc.
10
11           http://et.redhat.com/~rjones/virt-p2v/
12
13 Binaries
14 ----------------------------------------------------------------------
15
16 Binaries are available from the website (live CD images which can be
17 burned directly to a CD and booted on the p2v candidate machine).
18
19 http://et.redhat.com/~rjones/virt-p2v/
20
21 Building
22 ----------------------------------------------------------------------
23
24 Requirements:
25  * livecd-creator (on Fedora the package is 'livecd-tools')
26  * qemu (only for testing)
27
28 (1) Edit Makefile - there is some general configuration at the
29     top which you may want to change.
30
31 (2) 'make build' will build an ISO image called virt-p2v-$VERSION.iso
32
33 (3) Burn the image on to a CD using standard tools.
34
35 Booting from USB device
36 ----------------------------------------------------------------------
37
38 If you wish to boot from a USB keydrive, use the livecd-iso-to-disk
39 tool:
40
41   livecd-iso-to-disk virt-p2v-$VERSION.iso /dev/sdX1
42
43 (Replace /dev/sdX1 with the actual USB device).
44
45 In my experience I also had to set up a suitable MBR:
46
47   cat /usr/lib/syslinux/mbr.bin > /dev/sdX
48
49 Running
50 ----------------------------------------------------------------------
51
52 Boot the candidate machine from the live CD or USB keydrive.
53
54 You will need to have network access to another machine where it will
55 save the virtual disk images.  Ideally that machine will have ssh
56 access (sshd service running), but there is also a simple network
57 daemon that you can run on the target machine.  Note that the target
58 machine is usually the Xen host, but it doesn't need to be: you could
59 copy the images to a staging machine, and later copy them over to the
60 Xen host.
61
62 Note that the live CD doesn't modify any data on the candidate
63 machine.
64
65 Answer the questions.  There is a tutorial and explanation of some of
66 the questions on the website which you may wish to follow:
67 http://et.redhat.com/~rjones/virt-p2v/
68
69 While the live CD is booted a shell is available on other virtual
70 consoles.  Go to a virtual console using [ALT] [F2] and log in as root
71 with no password.
72
73 If it works, the result will be disk images for each filesystem from
74 the candidate machine, which should boot directly or with the minimum
75 of changes.
76
77 Booting P2V candidate under Xen
78 ----------------------------------------------------------------------
79
80
81 Testing
82 ----------------------------------------------------------------------
83
84 If you want to test the live CD without actually P2V-ing a real
85 server, then you can run the ISO directly in qemu.  (To do any sort of
86 realistic testing you will also need an operating system image,
87 eg. from /var/lib/xen/images, to experiment with).  For example:
88
89   $ cp /var/lib/xen/images/rhel5gax32fv.img .
90   $ make boot HDA=rhel5gax32fv.img
91   qemu -m 512 -cdrom virt-p2v-0.1.iso -boot d -hda rhel5gax32fv.img
92
93
94 TCP transport and network daemon
95 ----------------------------------------------------------------------
96
97 The preferred transport is ssh, but if you cannot use this then there
98 is an alternate TCP transport.  (This transport is not encrypted).
99
100 On the Xen host or staging server, install NetCat (the 'nc' command,
101 in Fedora and RHEL the package is also called 'nc').
102
103 Choose a free port number and make sure that it is not firewalled.
104
105 Then run:
106
107   nc -kl PORT > disks
108
109 where PORT is replaced by the port number chosen above.
110
111 After p2v has completed the 'disks' file will contain compressed
112 images of one or more disks.  There is a Perl script called
113 virt-p2v-unpack which can unpack the file:
114
115   virt-p2v-unpack disks