How to configure IP from within the VM instead of using Sunstone?

Hi guys, I would like some help.

I want to use just 1 public IP while having 2 (or more) VMs running in reachables networks, as keepalived let me do it in FailOver configuration.

image

In the image above each VM will have 2 NICs, each VM’s NIC1 will not have an IP manually fixed because I will let keepalived service to set the IP on VM1 as Master, and VM2 the Backup role. While VM2 will asume the keepalived Master role if VM1 goes down for any reason.

I do know how to achieve this on any other hypervisor, but the thing with OpenNebula is contextualization: if I add a NIC to a VM, that attached NIC will have a contextualizated IP. And if I use a not contextualizated image (let’s say I download an Ubuntu’s .ISO and install it) if I attach a NIC to that VM, the NIC will still have an IP which I need to configured on the VM (via CLI or VNC) to allow that VM have a network access…

I want to attacch a NIC with no fixed IP, and configure the IP via the VM’s CLI and grant it the network access.

So I’m a bit lost here and I would really appreciate any help

You could configure a new network with AR of type Ethernet. Then use this network for the desired VM NIC.

Or you can just remove add network contextualization tick on the context tab on the VM or template.

However it is recommended execute virtual machines in hosts with virtualization … yum install opennebula-server opennebula-sunstone