Virtual Network Template¶
This page describes how to define a new Virtual Network. A Virtual Network includes three different aspects:
Physical network attributes.
Address Range.
Configuration attributes for the guests.
When writing a Virtual Network template in a file, it follows the same syntax as the VM template.
Physical Network Attributes¶
It defines the underlying networking infrastructure that will support the Virtual Network, such as the VLAN ID
or the hypervisor interface to bind the Virtual Network to.
Attribute |
Description |
Value |
Mandatory |
Drivers |
---|---|---|---|---|
|
Name of the Virtual Network. |
String |
YES |
All |
|
The network driver to implement the network. |
802.1Q fw ovswitch vxlan vcenter dummy |
YES |
All |
|
Device to attach the virtual machines to, depending on the network driver it may refer to different technologies or require host setups. |
String |
|
dummy 802.1Q vxlan ovswitch fw vcenter |
|
Identifier for the VLAN. |
Integer |
|
802.1Q vxlan ovswitch vcenter |
|
If set to YES, OpenNebula will generate a VLAN ID automatically if VLAN_ID is not defined. Mandatory YES for 802.1Q if VLAN_ID is not defined, optional otherwise. |
String |
|
802.1Q vxlan ovswitch vcenter |
|
Name of the physical network device that will be attached to the bridge. |
String |
Optional for vCenter |
802.1Q vxlan vcenter |
More information about the attributes used by the vCenter network driver are available in the vCenter Network Overview section.
Important
The vCenter driver is a legacy component, and no longer receives updates or bug fixes.
Quality of Service Attributes¶
This set of attributes limit the bandwidth of each NIC attached to the Virtual Network. Note that the limits are applied to each NIC individually and are not averaged over all the NICs (e.g. a VM with two interfaces in the same network).
Attribute |
Description |
Drivers |
---|---|---|
|
Average bitrate for the interface in kilobytes/second for inbound traffic. |
All |
|
Maximum bitrate for the interface in kilobytes/second for inbound traffic. |
All |
|
Data that can be transmitted at peak speed in kilobytes. |
All except vCenter |
|
Average bitrate for the interface in kilobytes/second for outbound traffic. |
All except ovswitch |
|
Maximum bitrate for the interface in kilobytes/second for outbound traffic. |
All except ovswitch |
|
Data that can be transmitted at peak speed in kilobytes. |
All except vCenter and ovswitch |
Warning
For Outbound QoS when using Open vSwitch, you can leverage the Open vSwitch QoS capabilities.
The Address Range¶
IPv4 Address Range¶
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First |
YES |
|
First |
NO |
|
Number of addresses in this range. |
YES |
IPv6 Address Range¶
Important
IPv6 Address Ranges can use SIZE up to 2^128. However note that a MAC address (48 bits) is also assigned to each lease. MAC addresses will be reused when the number of IPv6 addresses is bigger than 2^48.
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First |
NO |
|
A |
NO |
|
A |
NO |
|
Number of addresses in this range. |
YES |
IPv6 Address Range (no-SLAAC)¶
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First |
NO |
|
First |
YES |
|
Length of the prefix to configure VM interfaces. |
YES |
|
Number of addresses in this range. If not provided
it will be computed from |
NO |
Dual IPv4-IPv6 Address Range¶
For the IPv6 SLAAC version the following attributes are supported:
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First IPv4 in the range in dot notation. |
YES |
|
First |
NO |
|
A |
NO |
|
A |
NO |
|
Number of addresses in this range. |
YES |
The no-SLAAC IPv6 version supports the following attributes:
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First |
YES |
|
First |
NO |
|
First |
YES |
|
Length of the prefix to configure VM interfaces. |
YES |
|
Number of addresses in this range. If not provided
it will be computed from |
NO |
Ethernet Address Range¶
Attribute |
Description |
Mandatory |
---|---|---|
|
|
YES |
|
First |
NO |
|
Number of addresses in this range. |
YES |
Contextualization Attributes¶
Attribute |
Description |
---|---|
|
Base network address. |
|
Network mask. |
|
Default gateway for the network. |
|
IPv6 router for this network. |
|
DNS servers, a space separated list of servers. |
|
Sets the |
|
Route metric for default IPv4 gateway. |
|
Route metric for default IPv6 gateway. |
|
Sets IPv4 guest conf. method for NIC in this network. |
|
Sets IPv6 guest conf. method for NIC in this network. |
|
Default search domains for DNS resolution. |
These attributes can be set in the (in precedence order): VM Template NIC section, Address Range (AR) and Virtual Network Template.
Interface Creation Options¶
For 802.1Q
, VXLAN
and Open vSwitch
drivers you can specify parameters in the VNET template. Option can be overridden or added per network.
Attribute |
Description |
---|---|
|
Driver configuration options. |
|
Parameters for Linux bridge creation. |
|
Parameters for Open vSwitch bridge creation. |
|
Parameters for link creation. |
CONF="vxlan_mc=239.0.100.0,test=false,validate_vlan_id=true"
BRIDGE_CONF="sethello=6"
OVS_BRIDGE_CONF="stp_enable=true"
IP_LINK_CONF="tos=10,udpcsum=,udp6zerocsumrx=__delete__"
Options can have empty value when they don’t need a parameter. Also the special value “__delete__” can be used to delete parameters set here.
You can find more information about these parameters in 802.1Q and VXLAN documentation.
Virtual Network Definition Examples¶
Sample IPv4 VNet:
# Configuration attributes (dummy driver)
NAME = "Private Network"
DESCRIPTION = "A private network for VM inter-communication"
BRIDGE = "bond-br0"
# Context attributes
NETWORK_ADDRESS = "10.0.0.0"
NETWORK_MASK = "255.255.255.0"
DNS = "10.0.0.1"
GATEWAY = "10.0.0.1"
#Address Ranges, only these addresses will be assigned to the VMs
AR=[TYPE = "IP4", IP = "10.0.0.10", SIZE = "100" ]
AR=[TYPE = "IP4", IP = "10.0.0.200", SIZE = "10" ]
Sample IPv4 VNet, using AR of just one IP:
# Configuration attributes (OpenvSwitch driver)
NAME = "Public"
DESCRIPTION = "Network with public IPs"
BRIDGE = "br1"
VLAN = "YES"
VLAN_ID = 12
DNS = "8.8.8.8"
GATEWAY = "130.56.23.1"
LOAD_BALANCER = 130.56.23.2
AR=[ TYPE = "IP4", IP = "130.56.23.2", SIZE = "1"]
AR=[ TYPE = "IP4", IP = "130.56.23.34", SIZE = "1"]
AR=[ TYPE = "IP4", IP = "130.56.23.24", SIZE = "1"]
AR=[ TYPE = "IP4", IP = "130.56.23.17", MAC= "50:20:20:20:20:21", SIZE = "1"]
AR=[ TYPE = "IP4", IP = "130.56.23.12", SIZE = "1"]