unix:virtualization:virtlib:importxen
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
unix:virtualization:virtlib:importxen [2022/05/08 22:14] – created rodolico | unix:virtualization:virtlib:importxen [2022/05/19 23:28] (current) – rodolico | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Import Xen virtuals to KVM/Xen ====== | ====== Import Xen virtuals to KVM/Xen ====== | ||
+ | |||
+ | **Warning**: | ||
This is a work in progress, as I've not been able to find anything on the 'net about it. Everything I've seen assumes your Xen virtuals are being managed by libvirt already, so it is a matter of using some built in utilities. | This is a work in progress, as I've not been able to find anything on the 'net about it. Everything I've seen assumes your Xen virtuals are being managed by libvirt already, so it is a matter of using some built in utilities. | ||
- | The way I propose to do it is to manually generate a libvirt configuration file, modified to use values from the original Xen machine. We'll use the virt-install command with the --import and --xml options. | + | The way I propose to do it is to manually generate a libvirt configuration file, modified to use values from the original Xen machine. We'll use the virt-install command with the --import and --print-xml options. |
+ | Lets try to convert the following Xen configuration file | ||
- | < | + | < |
- | virt-install \ | + | |
- | --hvm \ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | The items after //name// in the above command are all populated from a Xen configuration file. Assume the following configuration file: | + | |
- | + | ||
- | <code conf> | + | |
builder=' | builder=' | ||
memory=4096 | memory=4096 | ||
Line 31: | Line 15: | ||
name=' | name=' | ||
- | # change the MAC address to be unique. | + | # change the MAC address to be unique. |
# change the vifname so it shows up well on ifconfig output | # change the vifname so it shows up well on ifconfig output | ||
vif= [ | vif= [ | ||
Line 54: | Line 38: | ||
uuid=' | uuid=' | ||
</ | </ | ||
+ | |||
+ | To do this, will run virt-install with the --print-xml flag, which will simply show the configuration. In this case, I'm writing it to a file so it can be edited, then used to test, then define the virtual. | ||
+ | |||
+ | <code bash> | ||
+ | | ||
+ | | ||
+ | --hvm \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | > test.xml | ||
+ | </ | ||
+ | |||
+ | The items marked **CHANGEME** in the above command are all populated from a Xen configuration file. **NOTE**: it is very important to place the boot drive first in the list, before any other drives or cdrom' | ||
+ | |||
+ | <code xml> | ||
+ | <code bash> | ||
+ | | ||
+ | | ||
+ | --hvm \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | > test.xml | ||
+ | </ | ||
+ | |||
+ | |||
+ | Once you have this done, edit the resulting file with any changes you may need. I change the CPU as per [[unix: | ||
+ | |||
+ | Now, shut down the virtual on its Xen hypervisor and test it with the following command: <code bash> | ||
+ | |||
+ | If all works well, shut down the virtual, then make the definition permanent with <code bash> | ||
+ | |||
+ | You are done. |
unix/virtualization/virtlib/importxen.1652066049.txt.gz · Last modified: 2022/05/08 22:14 by rodolico