<html><head><style>P{font-size:10pt; line-height:1.6;  margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; font-family:gulim;}</style></head><body><img gabiamail src="http://inmail.gabia.com/mailArrival/11/130527165145_32056328_gabiacom_hjh/libvirt-users@redhat.com" width="0" height="0"><div style="font-size:10pt; line-height:1.6; font-family:gulim; margin:0px 0px 0px 0px;" ><div>
        <span style="font-size: 10pt; line-height: 1.6;">(English is not my first language. Sorry for my poor English )</span></div>
<div>
         </div>
<div>
        OS : </div>
<div>
        Linux nc233 2.6.32-220.17.1.el6.x86_64 #1 SMP Tue May 15 17:16:46 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux</div>
<div>
        CentOS release 6.3 (Final)</div>
<div>
        open vswitch : 1.11.90</div>
<div>
        virsh : 1.0.0</div>
<div>
        ibvirtd (libvirt) : 1.0.0</div>
<div>
         </div>
<div>
        I have tried to see what the virsh setting can do to open vswitch(ovs) until now. I had installed open vswitch from a source, not by using rpm or rpm build of the source. (I had tried to do 'ovs rpm build' described at INSTALL.RHEL included in ovs, But i failed to do it.)</div>
<div>
         </div>
<div>
        What i tried is this(<a href="http://blog.scottlowe.org/2012/11/07/using-vlans-with-ovs-and-libvirt/">http://blog.scottlowe.org/2012/11/07/using-vlans-with-ovs-and-libvirt/</a>).</div>
<div>
         I installed and started up ovs and it looked like properly working. I could create and delete bridges and ports with 'ovs-vsctl'. </div>
<div>
         </div>
<div>
        1. what i created before running 'virsh net-define' </div>
<div>
        --------------------------------------------</div>
<div>
        # ovs-vsctl show</div>
<div>
        76d9d6aa-cfce-4868-bf99-7d16bcfe38eb</div>
<div>
            Bridge "br0"</div>
<div>
                Port "br0"</div>
<div>
                    Interface "br0"</div>
<div>
                        type: internal</div>
<div>
                Port "eth1"</div>
<div>
                    Interface "eth1"</div>
<div>
        --------------------------------------------</div>
<div>
         </div>
<div>
         </div>
<div>
        2. And then runned 'virsh net-define net.xml'</div>
<div>
        'net.xml' i used.</div>
<div>
        --------------------------------------------</div>
<div>
        <network></div>
<div>
            <name>ovs-network</name></div>
<div>
            <forward mode='bridge'/></div>
<div>
            <bridge name='br0'/></div>
<div>
            <virtualport type='openvswitch'/></div>
<div>
            <portgroup name='vlan-01' default='yes'></div>
<div>
            </portgroup></div>
<div>
            <portgroup name='vlan-02'></div>
<div>
                <vlan></div>
<div>
                <tag id='2'/></div>
<div>
                </vlan></div>
<div>
            </portgroup></div>
<div>
            <portgroup name='vlan-03'></div>
<div>
                <vlan></div>
<div>
                <tag id='3'/></div>
<div>
                </vlan></div>
<div>
            </portgroup></div>
<div>
            <portgroup name='vlan-all'></div>
<div>
                <vlan trunk='yes'></div>
<div>
                <tag id='2'/></div>
<div>
                <tag id='3'/></div>
<div>
                </vlan></div>
<div>
            </portgroup></div>
<div>
        </network></div>
<div>
        --------------------------------------------</div>
<div>
         </div>
<div>
         </div>
<div>
        3. vm.xml which was used for 'virsh define vm.xml'</div>
<div>
        --------------------------------------------</div>
<div>
        <domain type="kvm"></div>
<div>
            <name>vm</name></div>
<div>
            <memory>1048576</memory></div>
<div>
            <vcpu>1</vcpu></div>
<div>
            <os></div>
<div>
                <type arch="x86_64" machine="pc">hvm</type>        </div>
<div>
                <boot dev="hd"/></div>
<div>
            </os></div>
<div>
            <features></div>
<div>
                <acpi/></div>
<div>
                <apic/></div>
<div>
                <pae/></div>
<div>
            </features></div>
<div>
            <clock mode="localtime"></div>
<div>
                <timer name="rtc" tickpolicy="catchup" wallclock="guest"/></div>
<div>
                <timer name="hpet" present="no"/></div>
<div>
            </clock></div>
<div>
            <devices></div>
<div>
                <!--<emulator>/usr/libexec/qemu-kvm</emulator>--></div>
<div>
                <emulator>/usr/bin/qemu-system-x86_64</emulator></div>
<div>
                <!--<disk device="disk" type="block">--></div>
<div>
                <disk device="disk" type="file"></div>
<div>
                    <!--<driver cache="none" name="qemu" type="qcow2"/>--></div>
<div>
                    <driver cache="writeback" io="threads" name="qemu" type="qcow2"/></div>
<div>
                    <source file="/root/img/vm.img"/></div>
<div>
                    <target bus="virtio" dev="vda"/></div>
<div>
                </disk></div>
<div>
                <interface type="network"></div>
<div>
                    <mac address="d2:0d:45:a3:92:ea"/></div>
<div>
                    <source network='ovs-network' portgroup='vlan-02'/></div>
<div>
                </interface></div>
<div>
                <console type="pty"></div>
<div>
                    <target port="0"/></div>
<div>
                </console></div>
<div>
                <input bus="usb" type="tablet"/></div>
<div>
                <input bus="ps2" type="mouse"/></div>
<div>
                <graphics autoport="yes" keymap="en-us" listen="0.0.0.0"</div>
<div>
                    port="-1" type="vnc"/></div>
<div>
            </devices></div>
<div>
        </domain></div>
<div>
        --------------------------------------------</div>
<div>
         </div>
<div>
         </div>
<div>
        4. runned 'virsh start vm', and failed</div>
<div>
        (messages had not been printed in english at my server, so i googled and tried to choose simillar sentecne which were shown in libvirt related threads. please consider it)</div>
<div>
        -----------------------------------------</div>
<div>
        #virsh start vm</div>
<div>
        error : Failled to start domain vm</div>
<div>
        error : Unable to add port vnet0 to OVS bridge br0</div>
<div>
        -----------------------------------------</div>
<div>
         </div>
<div>
         </div>
<div>
        At that time, /var/log/libvirt/libvirtd.log </div>
<div>
        (these are also translated)</div>
<div>
        -----------------------------------------</div>
<div>
        2013-05-23 04:32:14.588+0000: 11455: error : virNetDevGetMTU:343 : Cannot get interface MTU on 'ovsbr0': No such device </div>
<div>
        2013-05-23 04:32:14.678+0000: 11455: error : virExecWithHook:419 : Cannot find 'ovs-vsctl' in path: No such file or directory</div>
<div>
        2013-05-23 04:32:14.679+0000: 11455: error : virNetDevOpenvswitchRemovePort:173 : Unable to delete port (null) from OVS: command does not allowed.</div>
<div>
        -----------------------------------------</div>
<div>
         </div>
<div>
         </div>
<div>
        I think above errors comes from install location of OVS as written in libvirtd.log. How can i solve that by hands? (I'm also trying to solve the problem by installing ovs, using rpm build.) There are not only fedora or ubuntu linux, so the solution may exist. Are there a way to get libvirt to recognize ovs-vsctl? (As i mentioned above, ovs-vsctl and ovs are properly working)</div>
<div>
         </div>
<div>
        Thank you for reading.</div>
</div></body></html>