<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    In such case you must know beforehand all VLANs, set them up and
    create the necessary bridges.<br>
    Be careful to put the same configuration on OpenNebula and in the
    host, as it may lead to having a VMs tied to a different bridge.<br>
    <div class="moz-cite-prefix">On 03/12/12 03:28, 于长江 wrote:<br>
    </div>
    <blockquote cite="mid:2012120310283440163810@neusoft.com"
      type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <style>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
DIV.FoxDiv20121203095537951519 {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体; COLOR: #000000; FONT-SIZE: 10.5pt
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体; COLOR: #000000; FONT-SIZE: 10.5pt
}
</style>
      <meta name="GENERATOR" content="MSHTML 9.00.8112.16455">
      <div>Thank you for your answer, I know this configuration, but my
        physical host is reboot, and i want to restart the virtual
        machine manually instead of by Opennebula. I mean those
        interfaces are not up when the physical host starts. </div>
      <div> </div>
      <div>I almost know why Opennebula do this, because she want all
        operations to vm is taken by her not by us.</div>
      <div> </div>
      <hr style="WIDTH: 210px; HEIGHT: 1px" size="1" align="left"
        color="#b5c4df">
      <div><span><span style="FONT-FAMILY: Calibri; COLOR: #800080;
            FONT-SIZE: 10pt">于长江 |  东软</span></span></div>
      <div> </div>
      <div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none;
        PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm;
        BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none;
        PADDING-TOP: 3pt">
        <div style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px;
          PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000;
          FONT-SIZE: 12px; PADDING-TOP: 8px">
          <div><b>From:</b> <a moz-do-not-send="true"
              href="mailto:andreas.calvo@scytl.com">Andreas Calvo Gómez</a></div>
          <div><b>Date:</b> 2012-12-01 00:11</div>
          <div><b>To:</b> <a moz-do-not-send="true"
              href="mailto:yuchj@neusoft.com">于长江</a></div>
          <div><b>CC:</b> <a moz-do-not-send="true"
              href="mailto:users@lists.opennebula.org">users</a></div>
          <div><b>Subject:</b> Re: help: with 8021q driver, network
            configuration won't work, after host reboot (???)</div>
        </div>
      </div>
      <div>
        <div class="FoxDiv20121203095537951519">Opennebula recreates all
          necessary interfaces on demand.<br>
          It means that, once a virtual network uses .1Q, it will create
          the bridge to route the traffig and map the VLAN on the
          physical interface.<br>
          Dependenig on your distribution, you may need to specify the
          path of the bridge control binary (brctl).<br>
          On Red Hat derivative, it is located on /usr/sbin/brctl;
          whereas the default location should be /sbin/brctl.<br>
          You can either tweak the network scripts to look for the
          correct path or make a link.<br>
          <div class="moz-cite-prefix">On 30/11/12 13:58, 于长江 wrote:<br>
          </div>
          <blockquote cite="mid:2012113020583191368110@neusoft.com"
            type="cite">
            <style>BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
            <meta name="GENERATOR" content="MSHTML 9.00.8112.16455">
            <div>1. First, I create a vm on computer14, i saw network
              interfaces below:</div>
            <div>[oneadmin@computer14 ~]$ ifconfig  </div>
            <div>
              <div>eth0      Link encap:Ethernet  HWaddr E8:39:35:18:A1:60  </div>
              <div>          inet addr:10.72.24.216  Bcast:10.72.24.255  Mask:255.255.255.0</div>
              <div>          inet6 addr: fe80::ea39:35ff:fe18:a160/64 Scope:Link</div>
              <div>          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1</div>
              <div>          RX packets:21587155 errors:0 dropped:0 overruns:0 frame:0</div>
              <div>          TX packets:8407735 errors:0 dropped:0 overruns:0 carrier:0</div>
              <div>          collisions:0 txqueuelen:1000 </div>
              <div>          RX bytes:22927887802 (21.3 GiB)  TX bytes:667899749 (636.9 MiB)</div>
              <div>          Memory:fbe60000-fbe80000 </div>
              <div> </div>
              <div>eth0.100  Link encap:Ethernet  HWaddr E8:39:35:18:A1:60  </div>
              <div>          inet6 addr: fe80::ea39:35ff:fe18:a160/64 Scope:Link</div>
              <div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div>
              <div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
              <div>          TX packets:16672 errors:0 dropped:0 overruns:0 carrier:0</div>
              <div>          collisions:0 txqueuelen:0 </div>
              <div>          RX bytes:0 (0.0 b)  TX bytes:784568 (766.1 KiB)</div>
              <div> </div>
            </div>
            <div>
              <div>onebr100  Link encap:Ethernet  HWaddr E8:39:35:18:A1:60  </div>
              <div>          inet6 addr: fe80::acb0:e4ff:fe95:6f08/64 Scope:Link</div>
              <div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div>
              <div>          RX packets:13746 errors:0 dropped:0 overruns:0 frame:0</div>
              <div>          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0</div>
              <div>          collisions:0 txqueuelen:0 </div>
              <div>          RX bytes:398936 (389.5 KiB)  TX bytes:468 (468.0 b)</div>
              <div>
                <div> </div>
                <div>vnet0     Link encap:Ethernet  HWaddr FE:00:DD:67:22:02  </div>
                <div>          inet6 addr: fe80::fc00:ddff:fe67:2202/64 Scope:Link</div>
                <div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div>
                <div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
                <div>          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0</div>
                <div>          collisions:0 txqueuelen:500 </div>
                <div>          RX bytes:0 (0.0 b)  TX bytes:732 (732.0 b)</div>
                <div> </div>
                <div>2. Then, i reboot computer14</div>
                <div>[oneadmin@computer14 ~]$ sudo shutdown -r now </div>
                <div> </div>
                <div>3. After this operation,i saw vconfig network
                  interface has gone (<span style="COLOR: #0000ff;
                    FONT-WEIGHT: bold">eth0.100, onebr100</span>)</div>
                <div>
                  <div>[oneadmin@computer14 ~]# ifconfig </div>
                  <div>eth0      Link encap:Ethernet  HWaddr E8:39:35:18:A1:60  </div>
                  <div>          inet addr:10.72.24.216  Bcast:10.72.24.255  Mask:255.255.255.0</div>
                  <div>          inet6 addr: fe80::ea39:35ff:fe18:a160/64 Scope:Link</div>
                  <div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div>
                  <div>          RX packets:122 errors:0 dropped:0 overruns:0 frame:0</div>
                  <div>          TX packets:102 errors:0 dropped:0 overruns:0 carrier:0</div>
                  <div>          collisions:0 txqueuelen:1000 </div>
                  <div>          RX bytes:13317 (13.0 KiB)  TX bytes:12829 (12.5 KiB)</div>
                  <div>          Memory:fbe60000-fbe80000 </div>
                </div>
                <div> </div>
                <div>4. When I create that vm, error occurred below:</div>
                <div>
                  <div>[root@computer14 images]# pwd</div>
                  <div>/one_images/25/images</div>
                  <div>
                    <div>[root@computer14 images]# ls</div>
                    <div>deployment.0  disk.0  disk.1</div>
                  </div>
                </div>
                <div>
                  <div>[root@computer14 images]# virsh create deployment.0 </div>
                  <div>error: Failed to create domain from deployment.0</div>
                  <div>error: Failed to add tap interface to bridge 'onebr100': No such device</div>
                </div>
              </div>
            </div>
            <div> </div>
            <hr style="WIDTH: 210px; HEIGHT: 1px" size="1" align="left"
              color="#b5c4df">
            <div><span><span style="FONT-FAMILY: Calibri; COLOR:
                  #800080; FONT-SIZE: 10pt">于长江 |  东软</span></span></div>
            <div> </div>
            <div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium
              none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm;
              PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid;
              BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
              <div style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px;
                PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000;
                FONT-SIZE: 12px; PADDING-TOP: 8px">
                <div><b>From:</b> <a
                    href="mailto:andreas.calvo@scytl.com"
                    moz-do-not-send="true">Andreas Calvo Gómez</a></div>
                <div><b>Date:</b> 2012-11-30 20:33</div>
                <div><b>To:</b> <a href="mailto:yuchj@neusoft.com"
                    moz-do-not-send="true">yuchj@neusoft.com</a></div>
                <div><b>CC:</b> <a
                    href="mailto:users@lists.opennebula.org"
                    moz-do-not-send="true">users@lists.opennebula.org</a></div>
                <div><b>Subject:</b> Re: help: with 8021q driver,
                  network configuration won't work, after host reboot
                  (???)</div>
              </div>
            </div>
            <div>
              <div>We've been using 802.1Q under CentOS 6 without problems for quite a long </div>
              <div>time.</div>
              <div>Can you post a detailed description of what is happening?</div>
              <div> </div>
              <div>Thanks</div>
              <div>On 30/11/12 07:57, <a moz-do-not-send="true"
                  class="moz-txt-link-abbreviated"
                  href="mailto:users-request@lists.opennebula.org">users-request@lists.opennebula.org</a> wrote:</div>
              <div>></div>
              <div>> Message: 2</div>
              <div>> Date: Fri, 30 Nov 2012 14:56:47 +0800</div>
              <div>> From: ??? <a moz-do-not-send="true"
                  class="moz-txt-link-rfc2396E"
                  href="mailto:yuchj@neusoft.com"><yuchj@neusoft.com></a></div>
              <div>> To: users <a moz-do-not-send="true"
                  class="moz-txt-link-rfc2396E"
                  href="mailto:users@lists.opennebula.org"><users@lists.opennebula.org></a></div>
              <div>> Subject: [one-users] help: with 8021q driver,
                network configuration</div>
              <div>>  won't work after host reboot</div>
              <div>> Message-ID: <a moz-do-not-send="true"
                  class="moz-txt-link-rfc2396E"
                  href="mailto:201211301456470519356@neusoft.com"><201211301456470519356@neusoft.com></a></div>
              <div>> Content-Type: text/plain; charset="gb2312"</div>
              <div>></div>
              <div>> As i said, with 8021q driver, network configuration won't work after host reboot. Does One notice this?</div>
              <div>></div>
              <div>> Here is my solution for rhel below: (Is this ok?)</div>
              <div>> # cat $ONE_LOCATION/var/remotes/vnm/802.1Q/HostManaged.rb</div>
              <div>> require 'OpenNebulaNetwork'</div>
              <div>> ...</div>
              <div>> def create_bridge(bridge)</div>
              <div>>      OpenNebula.exec_and_log_no_exit("#{COMMANDS[:brctl]} addbr #{bridge}")</div>
              <div>>      OpenNebula.exec_and_log_no_exit("sudo sh -c 'echo brctl addbr #{bridge} >> /etc/rc.d/rc.local'")</div>
              <div>> end</div>
              <div>> ...</div>
              <div>> def create_dev_vlan(dev, vlan)</div>
              <div>>      OpenNebula.exec_and_log("#{COMMANDS[:vconfig]} add #{dev} #{vlan}")</div>
              <div>>      OpenNebula.exec_and_log("sudo sh -c 'echo vconfig add #{dev} #{vlan} >> /etc/rc.d/rc.local'")</div>
              <div>> end</div>
              <div>> ...</div>
              <div>> def attach_brigde_dev(bridge, dev, vlan=nil)</div>
              <div>>      dev = "#{dev}.#{vlan}" if vlan</div>
              <div>>      OpenNebula.exec_and_log("#{COMMANDS[:brctl]} addif #{bridge} #{dev}")</div>
              <div>>      OpenNebula.exec_and_log("sudo sh -c 'echo brctl addif #{bridge} #{dev} >> /etc/rc.d/rc.local'")</div>
              <div>> end</div>
              <div>> ...</div>
              <div>> def ifup(dev, vlan=nil)</div>
              <div>>      dev = "#{dev}.#{vlan}" if vlan</div>
              <div>>      OpenNebula.exec_and_log("#{COMMANDS[:ip]} link set #{dev} up")</div>
              <div>>      OpenNebula.exec_and_log("sudo sh -c 'echo ip link set #{dev} up >> /etc/rc.d/rc.local'")</div>
              <div>> end</div>
              <div>> ...</div>
              <div>></div>
              <div>></div>
              <div>></div>
              <div>></div>
              <div>> ??? |  ??</div>
              <div>> ---------------------------------------------------------------------------------------------------</div>
              <div>> Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)</div>
              <div>> is intended only for the use of the intended recipient and may be confidential and/or privileged of</div>
              <div>> Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is</div>
              <div>> not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying</div>
              <div>> is strictly prohibited, and may be unlawful.If you have received this communication in error,please</div>
              <div>> immediately notify the sender by return e-mail, and delete the original message and all copies from</div>
              <div>> your system. Thank you.</div>
              <div>> ---------------------------------------------------------------------------------------------------</div>
              <div>></div>
              <div> </div>
              <div>-- </div>
              <div>Andreas Calvo Gómez</div>
              <div>Systems Engineer</div>
              <div>Scytl Secure Electronic Voting</div>
              <div>Plaça Gal·la Placidia, 1-3, 1st floor · 08006 Barcelona</div>
              <div>Phone: + 34 934 230 324</div>
              <div>Fax:   + 34 933 251 028</div>
              <div><a moz-do-not-send="true"
                  class="moz-txt-link-freetext"
                  href="http://www.scytl.com">http://www.scytl.com</a></div>
              <div> </div>
              <div>NOTICE: The information in this e-mail and in any of its attachments is</div>
              <div>confidential and intended solely for the attention and use of the named</div>
              <div>addressee(s). If you are not the intended recipient, any disclosure,</div>
              <div>copying,</div>
              <div>distribution or retaining of this message or any part of it, without the</div>
              <div>prior</div>
              <div>written consent of Scytl Secure Electronic Voting, SA is prohibited and</div>
              <div>may be</div>
              <div>unlawful. If you have received this in error, please contact the sender</div>
              <div>and</div>
              <div>delete the material from any computer.</div>
              <div> </div>
            </div>
            <p>---------------------------------------------------------------------------------------------------<br>
              Confidentiality Notice: The information contained in this
              e-mail and any accompanying attachment(s) <br>
              is intended only for the use of the intended recipient and
              may be confidential and/or privileged of <br>
              Neusoft Corporation, its subsidiaries and/or its
              affiliates. If any reader of this communication is <br>
              not the intended recipient, unauthorized use, forwarding,
              printing,  storing, disclosure or copying <br>
              is strictly prohibited, and may be unlawful.If you have
              received this communication in error,please <br>
              immediately notify the sender by return e-mail, and delete
              the original message and all copies from <br>
              your system. Thank you. <br>
---------------------------------------------------------------------------------------------------</p>
          </blockquote>
          <br>
          <pre class="moz-signature" cols="72">-- 
Andreas Calvo Gómez
Systems Engineer
Scytl Secure Electronic Voting
Plaça Gal·la Placidia, 1-3, 1st floor · 08006 Barcelona
Phone: + 34 934 230 324
Fax:   + 34 933 251 028
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.scytl.com">http://www.scytl.com</a>

NOTICE: The information in this e-mail and in any of its attachments is
confidential and intended solely for the attention and use of the named
addressee(s). If you are not the intended recipient, any disclosure,
copying,
distribution or retaining of this message or any part of it, without the
prior
written consent of Scytl Secure Electronic Voting, SA is prohibited and
may be
unlawful. If you have received this in error, please contact the sender
and
delete the material from any computer. </pre>
        </div>
      </div>
      <p>---------------------------------------------------------------------------------------------------<br>
        Confidentiality Notice: The information contained in this e-mail
        and any accompanying attachment(s) <br>
        is intended only for the use of the intended recipient and may
        be confidential and/or privileged of <br>
        Neusoft Corporation, its subsidiaries and/or its affiliates. If
        any reader of this communication is <br>
        not the intended recipient, unauthorized use, forwarding,
        printing,  storing, disclosure or copying <br>
        is strictly prohibited, and may be unlawful.If you have received
        this communication in error,please <br>
        immediately notify the sender by return e-mail, and delete the
        original message and all copies from <br>
        your system. Thank you. <br>
---------------------------------------------------------------------------------------------------</p>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Andreas Calvo Gómez
Systems Engineer
Scytl Secure Electronic Voting
Plaça Gal·la Placidia, 1-3, 1st floor · 08006 Barcelona
Phone: + 34 934 230 324
Fax:   + 34 933 251 028
<a class="moz-txt-link-freetext" href="http://www.scytl.com">http://www.scytl.com</a>

NOTICE: The information in this e-mail and in any of its attachments is
confidential and intended solely for the attention and use of the named
addressee(s). If you are not the intended recipient, any disclosure,
copying,
distribution or retaining of this message or any part of it, without the
prior
written consent of Scytl Secure Electronic Voting, SA is prohibited and
may be
unlawful. If you have received this in error, please contact the sender
and
delete the material from any computer. </pre>
  </body>
</html>