Warning that network will not work during DomU creation

Discussion in 'HOWTO-Related Questions' started by vtapas, Apr 9, 2010.

  1. vtapas

    vtapas New Member

    Hi
    I created a DomU image using the method shown here
    http://www.howtoforge.com/using-xen-with-lvm-based-vms-instead-of-image-based-vms-debian-etch

    every thing worked perfectly I used it on Lenny.
    But I got a warning
    Code:
    
    WARNING
    -------
    
      You appear to have a missing vif-script, or network-script, in the
     Xen configuration file /etc/xen/xend-config.sxp.
    
      Please fix this and restart Xend, or your guests will not be able
     to use any networking!
    
    
    Although I have edited the xend-config.sxp as shown above in the guide what can be cause of problem and how can I use my guests to use the network ?
     
  2. Mark_NL

    Mark_NL New Member

    there should be a network script defined in your /etc/xen/xend-config.sxp, for example:

    (vif-script vif-bridge)

    and then in /etc/xen/scripts/vif-bridge should exists.

    (don't forget to restart xend ;))
     
  3. vtapas

    vtapas New Member

    I am not clear with this part
    the above mentioned file has the following entry
    Code:
    # If you are using only one bridge, the vif-bridge script will discover that,
    # so there is no need to specify it explicitly.
    #
    (vif-script vif-bridge)
    
    
    I could not understand this part there will be 2 Virtual hosts running how should I go for that?
    There is a file named vif-bridge at the above location. I am using the interface eth2. Where do I need to make changes in the script to make it up and running on eth2?
    I want both Virtual Hosts to be able to connect to internet.
    How do I test that?I am aware of an option called vnc?
    I am right now able to do an SSH in one of them from Dom0.
     
    Last edited: Apr 9, 2010
  4. Mark_NL

    Mark_NL New Member

    oke, it's not the vif script, then it's the network script :)
    There should be a line in the config something like this:

    Code:
    (network-script 'network-bridge netdev=eth1')
    there is already an example in the config itself, uncomment it, restart xend and try to start the vm.
     
  5. vtapas

    vtapas New Member

    You are saying to make the above changes in
    /etc/xen/scripts/vif-bridge

    I have eth2 working out of available 4 LAN card so should I replace eth1 by eth2.

    I think I got it
    Code:
    #
    # Your default ethernet device is used as the outgoing interface, by default.
    # To use a different one (e.g. eth1) use
    #
    # (network-script 'network-bridge netdev=eth1')
    #
    # The bridge is named xenbr0, by default.  To rename the bridge, use
    #
    # (network-script 'network-bridge bridge=<name>')
    
    are you saying to change here eth1 to eth2 since default I am using is eth2.
     
    Last edited: Apr 9, 2010
  6. Mark_NL

    Mark_NL New Member

    hehe, i meant /etc/xen/xend-config.sxp indeed :)

    anyway, yes .. put this line in it:
    (network-script 'network-bridge netdev=eth2')
     
  7. vtapas

    vtapas New Member

    Ok :) just wanted to know one thing what is network bridge ?
    It says 2 things one is network-bridge netdev and another is network-bridge bridge

    Code:
    #
    # (network-script 'network-bridge netdev=eth1')
    #
    # The bridge is named xenbr0, by default.  To rename the bridge, use
    #
    # (network-script 'network-bridge bridge=<name>')
    
    I am not clear with difference between netdev and bridge when to use them?
    Actually I have 4 lan cards and I want each virtual host to use a separate lan card.
     
  8. Mark_NL

    Mark_NL New Member

    bridge=<name> is when you want to RENAME the default name of the bridge, which is "xenbr0" .. just ignore that and set

    (network-script 'network-bridge netdev=eth2')

    restart xend and you should be good to go.
     
  9. vtapas

    vtapas New Member

    Right now I do an ssh to Dom0 and I am able to ping DomU's from Dom0 and I get replies so does that mean it is working I have not changed eth1 to eth2 is it needed?
    Can you show a sample configuration file here?
     
    Last edited: Apr 9, 2010
  10. Mark_NL

    Mark_NL New Member

    Code:
    sham:/etc/xen# grep -v '#' xend-config.sxp
    (network-script 'network-bridge netdev=eth0')
    (vif-script vif-bridge)
    (dom0-min-mem 196)
    (dom0-cpus 0)
    (vncpasswd '')
    Code:
    sham:/etc/xen# cat myvm
    kernel      = '/boot/vmlinuz-2.6.26-2-xen-686'
    ramdisk     = '/boot/initrd.img-2.6.26-2-xen-686'
    memory      = '4096'
    root        = '/dev/hda1 ro'
    disk        = [
    		'phy:/dev/drbd0,hda1,w',
    		'file:/swapfiles/myvm.swp,hda2,w',
    	      ]
    name        = 'myvm.domain.tld'
    vif         = [ 'ip=213.207.x.x' ]
    on_poweroff = 'destroy'
    on_reboot   = 'restart'
    on_crash    = 'restart'
     
  11. vtapas

    vtapas New Member

    Thanks for staying so long.Finally it is working.I have changed the name to eth2.

    I am trying to understand I have to route traffic from my 4VMs through this LAN interface which I call as eth2.I have to do NAT but I am a bit confusing in bridges.Can you give me some link here may be on howtoforge itself which makes me clear of routing on Xen.


    I am pasting the output of ifconfig it does not shows me any where brdige
    while brctl show does show

    Code:
    
    openworld:/etc/xen# brctl show
    bridge name	bridge id		STP enabled	interfaces
    eth2		8000.0026b9824238	no		peth2
    							vif1.0
    							vif2.0
    							vif3.0
    							vif5.0
    
    and ifconfig

    Code:
    openworld:/etc/xen# ifconfig
    eth2      Link encap:Ethernet  HWaddr 00:26:b9:82:42:38  
              inet addr:192.21.100.147  Bcast:192.21.255.255  Mask:255.255.0.0
              inet6 addr: fe80::226:b9ff:fe82:4238/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3436 errors:0 dropped:0 overruns:0 frame:0
              TX packets:233 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:2460960 (2.3 MiB)  TX bytes:34543 (33.7 KiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:15 errors:0 dropped:0 overruns:0 frame:0
              TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:1141 (1.1 KiB)  TX bytes:1141 (1.1 KiB)
    
    peth2     Link encap:Ethernet  HWaddr 00:26:b9:82:42:38  
              inet6 addr: fe80::226:b9ff:fe82:4238/64 Scope:Link
              UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
              RX packets:4277 errors:0 dropped:0 overruns:0 frame:0
              TX packets:244 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:2669261 (2.5 MiB)  TX bytes:36485 (35.6 KiB)
              Interrupt:32 Memory:da000000-da012100 
    
    vif1.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
              inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
              UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
              RX packets:1 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3594 errors:0 dropped:34 overruns:0 carrier:0
              collisions:0 txqueuelen:32 
              RX bytes:28 (28.0 B)  TX bytes:2583658 (2.4 MiB)
    
    vif2.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
              inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
              UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
              RX packets:1 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3545 errors:0 dropped:52 overruns:0 carrier:0
              collisions:0 txqueuelen:32 
              RX bytes:28 (28.0 B)  TX bytes:2549186 (2.4 MiB)
    
    vif3.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
              inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
              UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
              RX packets:176 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3624 errors:0 dropped:74 overruns:0 carrier:0
              collisions:0 txqueuelen:32 
              RX bytes:10475 (10.2 KiB)  TX bytes:2529692 (2.4 MiB)
    
    vif5.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
              inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
              UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
              RX packets:7 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1172 errors:0 dropped:13 overruns:0 carrier:0
              collisions:0 txqueuelen:32 
              RX bytes:412 (412.0 B)  TX bytes:864715 (844.4 KiB)
    
    
    All the above entries are after I have restarted and I did a reboot also to the machine.

    Here is my /etc/xen/xend-config.sxp

    Code:
     Your default ethernet device is used as the outgoing interface, by default.
    # To use a different one (e.g. eth1) use
    #
    # (network-script 'network-bridge netdev=eth1')
    #
    #### Tapas edited following line
     (network-script 'network-bridge netdev=eth2')
    
     
    Last edited: Apr 9, 2010
  12. Mark_NL

    Mark_NL New Member

    You can use bridge mode, so the interfaces inside the vm will act like they're directly connected to the network ..

    I wouldn't use NAT, since then you need to route your traffic from to your vm server ..
    We always use bridge, it's way easier and no firewall / routing rules to take care of ..

    info @ http://wiki.xensource.com/xenwiki/XenNetworking

    I've been playing with some virtualization techniques, though since i found proxmox i want nothing else :)

    webbased management of KVM / Openvz vm's .. very nice .. I'm migrating all my Xen servers to proxmox :p
     
  13. vtapas

    vtapas New Member

    Well thanks for that link. :) I have a doubt I changed the name of bridge from default
    I can
    ping to each of them after I do an SSH inside Dom0.
    In the file /etc/xen/xend-config.sxp
    I tried to have a bridge of my name so I edited them as follows

    # The bridge is named xenbr0, by default. To rename the bridge, use
    #
    # (network-script 'network-bridge bridge=<name>')
    #### Tapas made changes
    (network-script 'network-bridge bridge=<tapas>')

    I did rebooted my server but then when I do brctl show

    I get following
    bridge name bridge id STP enabled interfaces
    eth2 8000.0026b9824238 no peth2

    eth2 is not the default name why is this happening? What should I
    check in? I want to have bridges renamed and want the bridges to have
    desired name.
     
  14. Mark_NL

    Mark_NL New Member

    Hehe, your just trial and error right now and that messes things up ..

    (network-script 'network-bridge bridge=tapas')

    NOT

    (network-script 'network-bridge bridge=<tapas>')

    anyway, i would leave the bridge=<name> alone, and keep it default (comment the line), just use netdev=eth2

    should work ..
     
  15. vtapas

    vtapas New Member

    Well it did not worked.
    Code:
    openworld:~# brctl show
    bridge name	bridge id		STP enabled	interfaces
    eth2		8000.0026b9824238	no		peth2
    
    The entry in /etc/xen/xend-config.sxp is
    Code:
    # The bridge is named xenbr0, by default.  To rename the bridge, use
    #
    # (network-script 'network-bridge bridge=<name>')
    #### Tapas made changes
      (network-script 'network-bridge bridge=tapas')
    # It is possible to use the network-bridge script in more complicated
    
    ?
     
  16. Mark_NL

    Mark_NL New Member

    as i said before, don't use bridge .. comment it!

    you should only use:

    (network-script 'network-bridge netdev=eth2')
     
  17. vtapas

    vtapas New Member

Share This Page