[one-users] additional parameters in network templates

Willem van Engen wvengen at nikhef.nl
Mon Mar 1 06:06:02 PST 2010


Hi,

I'm using the default MAC assignment schema so that OpenNebula can hand 
out a MAC and IP to each instance. The resulting IP is given to the 
instance using the contextualization feature:

   CONTEXT = [
     target = "sdc",
     hostname = "$NAME",
     ip = "$NIC[IP]"
   ]

Now I would like to add netmask, nameserver and gateway to the context 
as well so that it can be set in the bootscript in the guest. My gateway 
and nameserver are dependent on the selected network, however. Now would 
it be possible to add extra variables to a network template, which can 
be referenced from the vm template? This would allow me to specify all 
network-related settings in a single place.


I'm thinking of a network config like the following:
   NAME = "Private"
   TYPE = RANGED
   BRIDGE = xenbr1
   NETWORK_ADDRESS = 10.198.6.0
   NETWORK_SIZE    = 200
   # other network settings
   NETMASK         = 255.255.255.0
   GATEWAY         = 10.198.6.240
   NS              = 10.198.6.240

with a context like this:

   CONTEXT = [
     target = "sdc",
     hostname = "$NAME",
     ip = "$NIC[IP]",
     netmask = "$NIC[NETMASK]",
     gateway = "$NIC[GATEWAY]",
     ns = "$NIC[NS]"
   ]

I'm eager to learn if there is a way to propagate additional 
network-specific settings to a vm template.

Kind regards,
- Willem



More information about the Users mailing list