Skip to content

Commit cfdb2d0

Browse files
F OpenNebula/one#6534: Add Shared AR to define Virtual IPs (#503)
Co-authored-by: mattrowe-opennebula <mrowe@opennebula.io>
1 parent e665b23 commit cfdb2d0

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

content/product/cluster_configuration/networking_system/manage_vnets.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,32 @@ AR=[
6969
]
7070
```
7171

72+
### Shared Address Ranges (Shared AR) for Virtual IPs
73+
74+
Marking an Address Range as `SHARED` converts its IPs into **Virtual IPs**. This allows **multiple VMs** to use the same IP address.
75+
76+
To mark an Address Range as `SHARED`, add the `SHARED` attribute in the AR definition:
77+
78+
```default
79+
AR=[
80+
TYPE = "IP4",
81+
IP = "10.0.0.211",
82+
SIZE = "3",
83+
SHARED = "YES"
84+
]
85+
```
86+
87+
The option to create a Shared AR is also available through a checkbox in the Sunstone UI in the **Add Address Range** dialog.
88+
89+
Shared Address Ranges behave slightly differently from regular Address Ranges:
90+
91+
- Same IP, multiple VMs: The same IP address from a Shared AR can be used by more than one VM.
92+
- Explicit request required: Shared IPs are not assigned automatically. They must be explicitly requested in a NIC or NIC Alias ([more details](#using-virtual-ips)).
93+
- Attribute `USED_LEASES` shows how many different shared IPs are in use, not how many VMs are using them.
94+
95+
{{< alert title="Important" color="success" >}}
96+
The `SHARED` attribute of an Address Range can't be changed after creation. The default value is `NO`. {{< /alert >}}
97+
7298
### Guest Configuration Attributes (Context)
7399

74100
To set up the guest network, the Virtual Network may include additional information to be injected into the VM at boot time. These contextualization attributes may include, for example, network masks, DNS servers, or gateways. For example, to define a gateway and DNS server for the Virtual Machines in the Virtual Network, simply add:
@@ -392,6 +418,30 @@ Any attribute supported by an NIC attribute can be also used in an alias except
392418
{{< alert title="Important" color="success" >}}
393419
The [Security Groups]({{% relref "../../virtual_machines_operation/virtual_machines_networking/security_groups#security-groups" %}}) and IP/MAC spoofing filters from the NIC network will be applied to the NIC_ALIAS. Those ones belonging to the NIC_ALIAS network won’t apply.{{< /alert >}}
394420

421+
### Using Virtual IPs
422+
423+
To request a Virtual IP (VIP) from a [Shared Address Range](#shared-address-ranges-shared-ar-for-virtual-ips) you must explicity request the IP in a `NIC` or `NIC_ALIAS` attribute. The most natural way of using Shared Address Ranges for VIPs is to define a primary NIC in the network with a regular IP and a NIC Alias with the VIP, this way you get a single network interface with two different IPs. The procedure is described below:
424+
425+
1. Define the primary NIC and give it a `NAME` so aliases can refer to it:
426+
427+
```default
428+
NIC = [ NETWORK = "private", NAME = "main" ]
429+
```
430+
431+
2. Add a `NIC_ALIAS` that **explicitly requests the shared IP** from the Shared AR (you must include the `IP` attribute):
432+
433+
```default
434+
NIC_ALIAS = [ NETWORK = "private", PARENT = "main", IP = "10.0.0.211" ]
435+
```
436+
437+
This will result in the VM having a **single network interface** (the parent NIC) with **two IPs** configured:
438+
439+
- The IP assigned to the main NIC
440+
- The explicitly requested shared IP from the `NIC_ALIAS`
441+
442+
{{< alert title="Important" color="success" >}}
443+
Requesting a Shared IP from a Shared AR **without** using `NIC_ALIAS` will create a **new interface** in the VM, with a random MAC assigned by OpenNebula.{{< /alert >}}
444+
395445
### Configuring the Virtual Machine Network
396446

397447
Hypervisors will set the MAC address for the NIC of the Virtual Machines, but not the IP address. The IP configuration inside the guest is performed by the contextualization process, check the [contextualization guide]({{% relref "../../virtual_machines_operation/virtual_machines/vm_templates#context-overview" %}}) to learn how to prepare your Virtual Machines to automatically configure the network

content/software/release_information/release_notes/whats_new.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ We encourage you to review the [Known Issues]({{% relref "known_issues" %}}) and
6969
<!--keeping some examples-->
7070
- [Transparent proxying](../../../product/virtual_machines_operation/virtual_machines_networking/tproxy) allows VMs to access external services like OneGate without requiring complex networking setup.
7171
- [Virtual Machine memory encryption](../../../product/virtual_machines_operation/virtual_machines/vm_templates#memory-encryption) allows VM workloads whose memory cannot be read by the hypervisor.
72+
- [Shared Address Ranges](../../../product/cluster_configuration/networking_system/manage_vnets.md#shared-address-ranges-shared-ar-for-virtual-ips) with [NIC Alias support](../../../product/cluster_configuration/networking_system/manage_vnets.md#using-virtual-ips) to assign Virtual IPs that can be shared across multiple VMs.
7273

7374
## LXC
7475
- NIC Hotplugging, recontextualization and NIC PCI passthrough are now available [driver features](../../../product/operation_references/hypervisor_configuration/lxc_driver.md).

0 commit comments

Comments
 (0)