On Tue, Nov 11, 2014 at 03:50:19PM +0100, Marco Guazzone wrote:
> Hello,
> 
> Since when libvirt has introduced support for the Xen XL toolstack, I
> was unable to make it work together.
> With Fedora 20 x86_64, still I have problems and the only way to use
> libvirt+Xen is to use the old xend toolstack.
> 
> Can anybody help me?
> 
> Here's below is my test. Sorry, the mail is very long...
> 
> 1. Disable SElinux
>   $ vi /etc/selinux/config
>     SELINUXTYPE=disabled

Uh, not sure why you need that?
> 
> 2. Install Xen and libvirt
>   $ yum install xen
>   $ yum install libvirt-daemon-xen libvirt-client
> 
> 3. Disable Network Manager
>   $ systemctl disable NetworkManager
>   $ systemctl stop NetworkManager

Network Manager can deal with the bridge as you have
NM_CONTROLLED=no set in it.
> 
> 4- Create network bridge
>   $ vi /etc/sysconfig/network-
> scripts/ifcfg-br0
>     DEVICE=br0
>     TYPE=Bridge
>     BOOTPROTO=none
>     ONBOOT=yes
>     IPADDR=10.10.15.2
>     NETMASK=255.255.255.0
>     STP=yes
>     DELAY=0
>     DEFROUTE=yes
>     USERCTL=no
>     NM_CONTROLLED=no
> 
>   $ vi /etc/sysconfig/network-scripts/ifcfg-em2
>     NAME=em2
>     TYPE=Ethernet
>     BOOTPROTO=none
>     ONBOOT=yes
>     BRIDGE=br0
>     PEERDNS=yes
>     PEERROUTES=yes
>     DEFROUTE=yes
>     USERCTL=no
>     NM_CONTROLLED=no
> 
> 5. Enable classic networking
>   $ systemctl enable network
>   $ systemctl start network
> 
> 6. Reboot with Xen
> 
> 7. Check xend toolstack is disabled
>   $ systemctl is-enabled xend
>     disabled
> 
> 8. Create a test VM
>   $ qemu-img-xen create -f raw test.img 10G

I've never seen that tool!
>   $ vi testvm.cfg
>     name = "testvm"
>     uuid = "93f08541-bfd5-4ac4-851d-c619a4516a13"
>     builder = "hvm"
>     maxmem = 3072
>     memory = 2048
>     vcpus = 1
>     on_crash = "restart"
>     disk = [ "file:/root/images/testvm.img,hda,w",
> "file:/root/iso/CentOS-7.0-1406-    x86_64-Minimal.iso,hdc:cdrom,r" ]

You seem to have a space in there, but htat is probably due to paste.
>     vif = [ "bridge=br0,script=vif-bridge" ]
>     boot = "cd"
>     sdl = 0
>     vnc = 1
>     vncunused = 1
>     xen_platform_pci = 1
>  $ xl create testvm.cfg
>

Why don't you just use 'virt-install' outright instead of doing
it via xl and such?

It also takes care of your images having the right SELinux permissions
(I believe so). 
> 9. Open vncviewer and perform installation
> 
> 10. Shutdown just created VM
> 
> 11. Create a libvirt XML file
>   $ virsh -c xen:/// domxml-from-native xen-xm testvm.cfg > testvm.xml
>     <domain type='xen'>
>      <name>testvm</name>
>      <uuid>93f08541-bfd5-4ac4-851d-c619a4516a13</uuid>
>      <memory unit='KiB'>3145728</memory>
>      <currentMemory unit='KiB'>2097152</currentMemory>
>      <vcpu placement='static'>1</vcpu>
>      <os>
>        <type arch='x86_64' machine='xenfv'>hvm</type>
>        <loader>/usr/lib/xen/boot/hvmloader</loader>
>        <boot dev='hd'/>
>        <boot dev='hd'/>
>      </os>
>      <clock offset='variable' adjustment='0' basis='utc'/>
>      <on_poweroff>destroy</on_poweroff>
>      <on_reboot>restart</on_reboot>
>      <on_crash>restart</on_crash>
>      <devices>
>        <disk type='file' device='disk'>
>          <driver name='file'/>
>          <source file='/root/images/testvm.img'/>
>          <target dev='hda' bus='ide'/>
>        </disk>
>        <disk type='file' device='cdrom'>
>          <driver name='file'/>
>           <source file='/root/iso/CentOS-7.0-1406-x86_64-Minimal.iso'/>
>         <target dev='hdc' bus='ide'/>
>          <readonly/>
>        </disk>
>        <interface type='bridge'>
>          <mac address='00:00:00:00:00:00'/>

Uuiuuh. Is that right? Shouldn't it have some value?

>          <source bridge='br0'/>
>          <script path='vif-bridge'/>
>        </interface>
>        <input type='mouse' bus='ps2'/>
>        <graphics type='vnc' port='-1' autoport='yes'/>
>      </devices>
>     </domain>
> 
> 12. Start the VM with libvirt
>   $ virsh create testvm.xml
> 
> BOOOM:
> 
> error: Failed to create domain from testvm.xml
> error: End of file while reading data: Input/output error
> error: One or more references were leaked after disconnect from the hypervisor
> error: Failed to reconnect to the hypervisor
> 

So earlier version of libvirt (Fedora 20) has issues if the bridge
was called anything but 'xenbr0' it would fail. Later (Fedora 21) is OK with it.

I think that is what you are hitting (I was hitting that in Fedora 20
when I was testing it out for Beta).

Try changing the bridge name to 'xenbr0'.

IF that does not help, edit the libvirt.cfg file to crank up the debugging
and use 'journalctl -x' to see what it complains about.

> 
> 
> Thank you very much for your time.
> 
> Best,
> 
> -- Marco
> --
> xen mailing list
> xen@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/xen
--
xen mailing list
xen@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/xen

Reply via email to