[one-users] Problem with network

tedbs tedbs at gtsum.com
Fri May 14 14:17:31 PDT 2010


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-eth0-adapter-after-mo
ving-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/20100514/6ea9a549/attachment-0002.htm>


More information about the Users mailing list