[one-users] Assigning fixed IP's to VM's

cmasmas cmasmas cmasmas10 at gmail.com
Sat Oct 3 04:24:38 PDT 2009


Ok. Now the problem is half-solved.

1) The vnet I have created: Note that I didn't include the "bridge". I'm not
sure about this parameter.

*NAME = "fixed"
TYPE = FIXED

#We have to bind this network to ''virbr1'' for Internet Access
#BRIDGE = vbr1

LEASES = [IP=192.168.2.2, MAC=00:16:3e:00:00:01]
LEASES = [IP=192.168.2.3, MAC=00:16:3e:00:00:02]*


2) The VM template:
*NAME   = vm-example
MEMORY = 768
OS     = [
  kernel   = "/boot/vmlinuz-2.6.26-2-xen-686",
  initrd   = "/boot/initrd.img-2.6.26-2-xen-686",
  root     = "sda1 ro"]

DISK   = [
  source   = "/path/debian.img",
  target   = "sda1",
  readonly = "no" ]

NIC    = [ mac  = "00:16:3e:00:00:01", network = "fixed" ]*

3) Of course, I include the vmcontext.sh script in the VM

Now, the result is that the VM seems to ask for the IP, but it still gets IP
from DHCP server.

* As we can see, the IP is "assigned" to the VM:
*NID               : 7
UID               : 0
Network Name      : fixed
Type              : Fixed
Bridge            :

....: Template :....
        LEASES=IP=192.168.2.2,MAC=00:16:3e:00:00:01
        LEASES=IP=192.168.2.3,MAC=00:16:3e:00:00:02
        NAME=fixed
        TYPE=FIXED

....: Leases :....
IP = 192.168.2.2    MAC = 00:16:3e:00:00:01  USED = 0 VID = -1
IP = 192.168.2.3    MAC = 00:16:3e:00:00:02  USED = 1 VID = 73*

* I think that the IP assigned by the script is replaced by the one from
DHCP. So, I thought about disabling DHCP. However, the
/etc/network/interfaces file shows that eth0 is configured as "static"
*
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 62.0.0.2
  network 62.0.0.0
  netmask 255.255.255.0
  gateway 62.0.0.1
*
Thanks again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20091003/b3a09f37/attachment-0003.htm>


More information about the Users mailing list