[one-users] help: with 8021q driver, network configuration won't work after host reboot

于长江 yuchj at neusoft.com
Thu Nov 29 22:56:47 PST 2012


As i said, with 8021q driver, network configuration won't work after host reboot. Does One notice this? 

Here is my solution for rhel below: (Is this ok?)
# cat $ONE_LOCATION/var/remotes/vnm/802.1Q/HostManaged.rb 
require 'OpenNebulaNetwork' 
...
def create_bridge(bridge)
    OpenNebula.exec_and_log_no_exit("#{COMMANDS[:brctl]} addbr #{bridge}")
    OpenNebula.exec_and_log_no_exit("sudo sh -c 'echo brctl addbr #{bridge} >> /etc/rc.d/rc.local'")
end
...
def create_dev_vlan(dev, vlan)
    OpenNebula.exec_and_log("#{COMMANDS[:vconfig]} add #{dev} #{vlan}")
    OpenNebula.exec_and_log("sudo sh -c 'echo vconfig add #{dev} #{vlan} >> /etc/rc.d/rc.local'")
end
...
def attach_brigde_dev(bridge, dev, vlan=nil)
    dev = "#{dev}.#{vlan}" if vlan
    OpenNebula.exec_and_log("#{COMMANDS[:brctl]} addif #{bridge} #{dev}")
    OpenNebula.exec_and_log("sudo sh -c 'echo brctl addif #{bridge} #{dev} >> /etc/rc.d/rc.local'")
end
...
def ifup(dev, vlan=nil)
    dev = "#{dev}.#{vlan}" if vlan
    OpenNebula.exec_and_log("#{COMMANDS[:ip]} link set #{dev} up")
    OpenNebula.exec_and_log("sudo sh -c 'echo ip link set #{dev} up >> /etc/rc.d/rc.local'")
end
...




于长江 |  东软
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121130/83eb35c6/attachment-0001.htm>


More information about the Users mailing list