ONE context not applying IP to ubuntu virtual machine network interface

Hi there,

The network interface on my virtual machine (Ubuntu desktop 18.04) is not assigned any IP address by the Opennebula context. I have to edit my netplan manually, to get the correct network settings on the machine, I would like this to happen automatically.

Virtual machine should get the IP ‘10.3.13.26’, sunstone shows that this IP is assigned in the instances tab.

the context.sh on the virtual machine looks like this:
DISK_ID=‘1’
ETH0_IP=‘10.3.13.26’
ETH0_MAC=‘02:00:0a:03:0d:1a’
ETH_MASK=‘255.255.128.0’
NETWORK=‘YES’

and some other values, but I don’t think those are relevant

ifconfig on the virtual machine looks like this:
ens3: flags=4163<UP ,BROADCAST ,RUNNING, MULTICAST> mtu 1500
ether:02:00:0a:03:0d:1a

so it has the correct MAC-address, but no IP-address assigned

My VM template has these values in ‘CONTEXT’

CONTEXT = [
NETWORK = “YES”,
SSH_PUBLIC_KEY = “$USER[SSH_PUBLIC_KEY]” ]

Things I’ve tried:

  • install ‘opennebula-context’ package
  • assign ‘virtio’ as default hardware model to emulate for all NICs, in the VM template
  • select ‘Virtio’ as BUS, in the VM template

Does anyone know if the IP could be assigned to the network interface on ubuntu automatically when instansiating the vm?

1 Like

The ONE contextualization is supposed to assign the IP- when you grep for ‘context’ in /var/log/syslog do you see any output from the contextualization script, or an error? Is the IP right in the /var/run/onecontext/one_env file?