<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 04/26/2013 02:41 PM, Slater, Joseph
      wrote:<br>
    </div>
    <blockquote
cite="mid:007BD92917A2324FA403BCF9A464CF8436F96748@ALA-MBB.corp.ad.wrs.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">If I have these fragments in a domain
          definition, the guest will start with "eth0"<o:p></o:p></p>
        <p class="MsoNormal">assigned by dhcp to an address on my lan. 
          Things seem to work according to the documentation<o:p></o:p></p>
        <p class="MsoNormal">I can find.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">  <network><o:p></o:p></p>
        <p class="MsoNormal">    <name>direct-macvtap</name><o:p></o:p></p>
        <p class="MsoNormal">    <forward mode='bridge'><o:p></o:p></p>
        <p class="MsoNormal">      <interface dev='eth0' /><o:p></o:p></p>
        <p class="MsoNormal">    </forward><o:p></o:p></p>
        <p class="MsoNormal">  </network><o:p></o:p></p>
        <p class="MsoNormal">  <devices><o:p></o:p></p>
        <p class="MsoNormal">    <interface type='direct'><o:p></o:p></p>
        <p class="MsoNormal">      <mac address='00:15:17:A6:BC:C9'
          /><o:p></o:p></p>
        <p class="MsoNormal">      <source dev='eth0' mode='bridge'
          /> <o:p></o:p></p>
        <p class="MsoNormal">      <model type='virtio' /><o:p></o:p></p>
        <p class="MsoNormal">    </interface><o:p></o:p></p>
        <p class="MsoNormal"> </devices><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I don't understand the <network> part
          here.  It doesn't seem to be documented.  I inherited these
          pieces<o:p></o:p></p>
        <p class="MsoNormal">so I do not know why they are as they are.</p>
      </div>
    </blockquote>
    <br>
    The <network> part shouldn't be in the domain's XML. It should
    be used to separately define a libvirt network. Put that part in
    "direct.xml" (for example) and run:<br>
    <br>
       virsh net-define direct.xml<br>
       virsh net-autostart direct-macvtap<br>
       virsh start direct-macvtap<br>
    <br>
    <br>
    However, your <interface> definition isn't even using that
    network; it's specifying the macvtap connection directly (with
    <source dev='eth0' mode='bridge'/>) so the network definition
    isn't even needed.<br>
    <br>
    (btw, the <network> xml is documented here:
    <a class="moz-txt-link-freetext" href="http://www.libvirt.org/formatnetwork.html">http://www.libvirt.org/formatnetwork.html</a> )<br>
    <br>
    <blockquote
cite="mid:007BD92917A2324FA403BCF9A464CF8436F96748@ALA-MBB.corp.ad.wrs.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">If, instead, I have the following, the
          guest comes up with no network interface at all<o:p></o:p></p>
        <p class="MsoNormal">(except lo).  On the host, interfaces vnet0
          and virbr0 exist and virbr0 is 192.168.122.1.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">  <devices><o:p></o:p></p>
        <p class="MsoNormal">   <interface type='network'><o:p></o:p></p>
        <p class="MsoNormal">      <source network='default'/> <o:p></o:p></p>
        <p class="MsoNormal">    </interface><o:p></o:p></p>
        <p class="MsoNormal">  </devices><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Adding in<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">      <model type='virtio' /><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">makes it start with "eth0", but no address
          has been assigned.  I can manually do that and then<o:p></o:p></p>
        <p class="MsoNormal">I can communicate with the host but it's
          kind of a pain to add the address and routing manually.</p>
      </div>
    </blockquote>
    <br>
    That could be caused by one of the problems described here:<br>
    <br>
     
    <a class="moz-txt-link-freetext" href="http://wiki.libvirt.org/page/PXE_boot_%28or_dhcp%29_on_guest_failed">http://wiki.libvirt.org/page/PXE_boot_%28or_dhcp%29_on_guest_failed</a><br>
    <br>
    In general, take a look at<br>
    <br>
      <a class="moz-txt-link-freetext" href="http://wiki.libvirt.org/page/Troubleshooting">http://wiki.libvirt.org/page/Troubleshooting</a><br>
    <br>
    <br>
    <blockquote
cite="mid:007BD92917A2324FA403BCF9A464CF8436F96748@ALA-MBB.corp.ad.wrs.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal">Oddly enough, though, ping from host to
          guest works normally, but ping guest to host seems to succeed
          once<o:p></o:p></p>
        <p class="MsoNormal">then hang (with no timeout).<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">It is not at all obvious to me how virtio
          magically creates eth0.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Am I doing something wrong, here?  And, if
          anyone could advise how to use openvswitch<o:p></o:p></p>
        <p class="MsoNormal">I'd appreciate it.  I've seen adding<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><virtualport type='openvswitch/><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">might be enough, presumably with an
          appropriate name for the source network.</p>
      </div>
    </blockquote>
    <br>
    (you're really jumping all over the place here :-)<br>
    <br>
    You need a new enough version of libvirt to support openvswitch (at
    least 0.9.11, or 0.10.0 if you're using vlans), as well as a new
    enough kernel, and you need to have the openvswitch package(s)
    installed.<br>
    <br>
    There are several guides for doing this. Here's one that came up on
    Google:<br>
    <br>
      
    <a class="moz-txt-link-freetext" 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><br>
    <br>
    <br>
  </body>
</html>