Feature #197

Custom Network Context Attributes

Added by Ruben S. Montero over 10 years ago. Updated about 10 years ago.

Status:ClosedStart date:03/01/2010
Priority:NormalDue date:
Assignee:Tino Vázquez% Done:

100%

Category:Core & System
Target version:Release 2.0
Resolution: Pull request:

Description

This has been proposed by Willem van Engen in the mailing list:

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??


Related issues

Related to Feature #189: Template variables should allow cross reference like CONT... Closed 01/27/2010

Associated revisions

Revision f658f188
Added by Juan Jose Montiel Cano over 3 years ago

Max input slider (#197)

Revision a94e9d0a
Added by Juan Jose Montiel Cano over 3 years ago

Max input slider (#197)

History

#1 Updated by Ruben S. Montero over 10 years ago

  • Target version set to Release 2.0

This is a very nice to have feature. Right now, the only way to do that is hard code the network data in the template :(

CONTEXT = [
target = "sdc",
hostname = "$NAME",
ip = "$NIC[IP]",
netmask = "255.255.255.0",
gateway = "10.198.6.240",
ns = "10.198.6.240" ]

As this is not really related to the NIC but to the network our proposal is to us a special name (NETWORK) so you may have

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

#2 Updated by Ruben S. Montero over 10 years ago

  • % Done changed from 0 to 80

This is now in feature-189. Documentation needs to be updated...

#3 Updated by Ruben S. Montero over 10 years ago

  • % Done changed from 80 to 90

#4 Updated by Daniel Molina about 10 years ago

  • Status changed from New to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF