[one-users] Problem with network

tedbs tedbs at gtsum.com
Mon May 17 20:48:46 PDT 2010


I'm not sure about the problem with your console. Can you get to the
console when you run it under qemu? If not, you may need to generate a
new virtual machine image with options to support the console. I used
the Virtual Machine Manager on an Ubuntu 9.10 Desktop system to generate
my virtual machine image. You can check the Ubuntu documentation for
generating a virtual machine image from the command line.

 

I'm no network expert. Is the iface underlying the bridge running in
promiscuous mode? I think the ifconfig output for the NIC should show
PROMISC in its output. I followed the recipe in

http://www.slideshare.net/rsmontero/building-clouds-one-14

(see pages 20 and 21 for network configuration) and evolved my own
configuration. My /etc/network/interfaces follows:

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

 

# Loopback network interface

auto lo

iface lo inet loopback

 

# Primary (internal) network interface

auto eth0

iface eth0 inet manual

        up ifconfig $IFACE 0.0.0.0 up

        up ip link set $IFACE promisc on

        down ip link set $IFACE promisc off

        down ifconfig $IFACE down

 

# Secondary (external) network interface

auto eth1

iface eth1 inet manual

        up ifconfig $IFACE 0.0.0.0 up

        up ip link set $IFACE promisc on

        down ip link set $IFACE promisc off

        down ifconfig $IFACE down

 

# Primary (internal) cloud bridge interface

auto clbrint

iface clbrint inet static

        address 192.168.1.10

        netmask 255.255.255.0

        network 192.168.1.0

        broadcast 192.168.1.255

        gateway 192.168.1.1

        bridge_ports eth0

        bridge_fd 9

        bridge_hello 2

        bridge_maxage 12

        bridge_maxwait 5

        bridge_stp off

 

# Secondary (external) cloud bridge interface

auto clbrext

iface clbrext inet manual

        bridge_ports eth1

        bridge_fd 9

        bridge_hello 2

        bridge_maxage 12

        bridge_maxwait 5

        bridge_stp off

 

Again, I'm no network expert, but this is what is working for me. I'm
using two bridges for two networks, you may need only one.

 

Ted Bodfish

 

From: Luca Lorenzini [mailto:lorenzini.luca at gmail.com] 
Sent: May-17-10 11:13 AM
To: users at lists.opennebula.org
Subject: Re: [one-users] Problem with network

 


I tried your link but the file
/etc/udev/rules.d/70-persistent-net.rules is empty. I also tried adding
the INPUT and GRAPHICS options in the template but i still cant connect
to the vm (i used vncviewer localhost).

As I previously wrote, is it correct my network configuration? I have to
use 192.168.122.0 network for my VMs because the IP of the bridge is
192.168.122.1 or i can use other ip (ES:10.0.0.0)? I added few lines in
the vmcontext.sh file to log the ip and mac used but when i shoutdown
the vm and launch manually with qemu i see no changes in the filesystem
(i've a doubt that the state running means that the vm is not running
for real...).



On Fri, May 14, 2010 at 11:17 PM, tedbs <tedbs at gtsum.com> wrote:

Hi Luca,

Looks like you've got a few issues to deal with.

The VM template is particular about single quotes (') and double quotes
(") - try switching them in your RAW data line. That should get rid of
the parsing error. Perhaps the parser can be altered to allow
interchangeable quoting.

I've been using the Virtual Machine Manager from an Ubuntu Desktop
installation to monitor the hosts and the VMs. I was able to use that to
connect to the console of a VM. I had to add a few lines to the template
file: 

INPUT = [ TYPE = "mouse",  BUS = "ps2" ]

GRAPHICS = [TYPE = "vnc", LISTEN = "localhost", PORT = 5910]

Another issue may be the MAC address assigned to the virtual machine. If
it is different from the one used when the virtual machine image was
created ubuntu will add another NIC as eth1 and eth0 won't work. I found
this fix here:

http://www.serenux.com/2009/11/howto-fix-a-missing-
<http://www.serenux.com/2009/11/howto-fix-a-missing-eth0-adapter-after-m
oving-ubuntu-server-from-one-box-to-another/> buntu will add another NIC
<http://www.serenux.com/2009/11/howto-fix-a-missing-eth0-adapter-after-m
oving-ubuntu-server-from-one-box-to-another/>
eth0-adapter-after-moving-ubuntu-server-from-one-box-to-another/
<http://www.serenux.com/2009/11/howto-fix-a-missing-eth0-adapter-after-m
oving-ubuntu-server-from-one-box-to-another/> 

and it worked for me 

Ted Bodfish

tedbs at gtsum.com

+1 519 657 7226

 

From: Luca Lorenzini [mailto:lorenzini.luca at gmail.com] 
Sent: May-12-10 11:41 AM
To: users at lists.opennebula.org
Subject: [one-users] Problem with network

 

I'm starting to use Opennebula v1.2 (i cant update to 1.4 because of
university rules) and i've problems to connect to my VMs via ssh (i cant
ping them either). I put the script vmcontext.sh in /etc/init.d/ and i
linked it in /etc/rcS.d/ but without improvements. I tried using the RAW
option in the VMs' templates to use a console with virsh console command
but the parser of the template raises an error: "Error: Error parsing VM
template". This is what i put into the template:

RAW = [
 type = "kvm",
 data = '<serial type="pty"><source path="/dev/pts/2"/><target
port="1"></serial><console type="pty"><source path="/dev/pts/2"/><target
port="1"></console>' ]
]

(i tried escaping \", wrapping it with <devices></devices> tag, but
without any results)


Here my configuration:



i saw with /sbin/ifconfig that the host have a bridge named virbr0:

virbr0    Link encap:Ethernet  HWaddr 06:65:ee:bc:65:9c  
          inet addr:192.168.122.1  Bcast:192.168.122.255
Mask:255.255.255.0
          inet6 addr: fe80::d8:8aff:feee:96cb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:20 (20.0 B)  TX bytes:509208 (509.2 KB)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My network template is this:

NAME = "Ranged Network"
TYPE = RANGED
BRIDGE = virbr0
NETWORK_SIZE = C
NETWORK_ADDRESS = 192.168.122.0


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My Vm Template:

NAME   = ubuntu-test
MEMORY = 512
CPU=0.5

OS = [boot=hd,kernel=/vmlinuz]

DISK   = [
  source   = "/home/saccorsi/ubuntu.img",
  target   = "hda",
  readonly = "no",
  clone = "no"
]

NIC    = [ NETWORK = "Ranged
Network",IP=192.168.122.5,BRIDGE=virbr0,MAC=00:03:c0:a8:7a:05 ]

FEATURES=[ acpi="no" ]



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

virsh dumpxml return:

<domain type='kvm' id='13'>
  <name>one-9</name>
  <uuid>6b977e17-1424-3a2d-999f-f3571ffe8d8a</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <kernel>/vmlinuz</kernel>
    <boot dev='hd'/>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/public/lorenz/cloud//9/images/disk.0'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='bridge'>
      <mac address='00:03:c0:a8:7a:05'/>
      <source bridge='virbr0'/>
      <target dev='vnet1'/>
    </interface>
  </devices>
</domain>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /sbin/ifconfig vnet1:

vnet1     Link encap:Ethernet  HWaddr 86:4d:64:f7:cb:98  
          inet6 addr: fe80::844d:64ff:fef7:cb98/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:4126 (4.1 KB)

As you can see it has no ip address

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
onevm show return:

VID            : 9                   
UID            : 0                   
STATE          : ACTIVE              
LCM STATE      : RUNNING             
DEPLOY ID      : one-9               
MEMORY         : 524288              
CPU            : 0                   
LAST POLL      : 1273678795          
START TIME     : 05/12 17:37:04      
STOP TIME      : 01/01 01:00:00      
NET TX         : 0
NET RX         : 0

....: Template :....
    CPU             : 0.5                 
    DISK            :
CLONE=no,READONLY=no,SOURCE=/public/lorenz/cloud/ubuntu.qcow2,TARGET=hda
    FEATURES        : ACPI=no             
    MEMORY          : 512                 
    NAME            : ubuntu-test         
    NIC             :
BRIDGE=virbr0,IP=192.168.122.5,MAC=00:03:c0:a8:7a:05,NETWORK=Ranged
Network,VNID=3
    OS              : BOOT=hd,KERNEL=/vmlinuz




I will appreciate your help

Luca

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100517/8eef360e/attachment-0003.htm>


More information about the Users mailing list