Virtual Network Definition File 3.0
This page describes how to define a new Virtual Network template. A Virtual Network template follows the same syntax as the VM template.
If you want to learn more about the Virtual Network management, you can do so here.
There are two types of Virtual Networks, ranged and fixed. Their only difference is how the leases are defined in the template.
These are the common attributes for both types of VNets:
|NAME||String||Name of the Virtual Network||YES|
|BRIDGE||String||Name of the physical bridge in the physical host where the VM should connect its network interface||YES|
|PUBLIC||YES/NO||Public scope of the image. If set to YES, the Virtual Network can be used by any user in the VNet's group. If omitted, the default value is NO||NO|
|TYPE||RANGED/FIXED||Type of this VNet||YES|
Please note that any arbitrary value can be set in the Virtual Network template, and then used in the contextulization section of the VM. For instance, NETWORK_GATEWAY=“x.x.x.x” might be used to define the Virtual Network, and then used in the context section of the VM to configure its network to connect through the GATEWAY.
A lease is a definition of an IP-MAC pair. From an IP address, OpenNebula generates an associated MAC using the following rule:
MAC = MAC_PREFFIX:IP. All Virtual Networks share a default value for the MAC_PREFIX, set in the
So, for example, from IP 10.0.0.1 and MAC_PREFFIX 02:00, we get 02:00:0a:00:00:01.
The available leases for new VNets are defined differently for each type.
Fixed VNets need a series of
LEASES vector attributes, defined with the following sub-attributes:
|IP||IP address||IP for this lease||YES|
|MAC||MAC address||MAC associated to this IP||NO|
|NETWORK_ADDRESS||IP address||Base network address to generate IP addresses.||YES|
|NETWORK_SIZE|| || Number of VMs that can be connected using this network. It can be defined either using a number or a network class (B or C). The default value for the network size can be found in ||NO|
Sample fixed VNet:
NAME = "Blue LAN" TYPE = FIXED # We have to bind this network to ''virbr1'' for Internet Access BRIDGE = vbr1 LEASES = [IP=18.104.22.168] LEASES = [IP=22.214.171.124, MAC=50:20:20:20:20:21] LEASES = [IP=126.96.36.199] LEASES = [IP=188.8.131.52] # Custom Attributes to be used in Context GATEWAY = 184.108.40.206 DNS = 220.127.116.11 LOAD_BALANCER = 18.104.22.168
Sample ranged VNet:
NAME = "Red LAN" TYPE = RANGED # This vnet can be only used by the owner user PUBLIC = NO # Now we'll use the host private network (physical) BRIDGE = vbr0 NETWORK_SIZE = C NETWORK_ADDRESS = 192.168.0.0 # Custom Attributes to be used in Context GATEWAY = 192.168.0.1 DNS = 192.168.0.1 LOAD_BALANCER = 192.168.0.3