Xen physical 2 virtual
I just hacked up a shell script which makes it possible to create a virtual machine out of
your running physical machine. After running this script you have the virtual disk and a configuration which can be started
with xm create -c /etc/xen/vm/
This is currently only tested with sles10 but with some small modifications it should also work in other environments.
Following steps are done by the script.
1. Check on which partition your / is mounted
2. Check which partition is your swap partition
3. Check sizes of both partitions and see if there is still enough availble space to create the virtual disk
4. Create a virtual disk image
5. Create partitions+filesystem on the virtual disk image
6. Copy all your data of your physical machine to the virtual disk image
7. Generate a xen configuration for your machine
This is still the first version of the script so there are still some ‘known issues’
- you already need to have the xen-kernel installed on your physical machine
- it only creates a / and a swap partition , no other partitions yet
- it (temp) creates the image file under /tmp before moving it to /var/lib/xen/images
- does not work with lvm (only loop devices)
You can find the script here
November 2nd, 2006 - Posted in SLES, xen | |
