Please, describe the problem here and provide additional information below (if applicable) …
After the power cycle of VM instance, it changes nic order if I had nic 0 as private, nic 1 as public, nic 2 as storage and eth0 assigned to private IP, eth1 assigned to public IP, eth2 assigned to storage IP (statically inside the VM). Opennebula changes the assignment making eth2 assigned with public IP and eth1 assigned with storage IP. The only recourse for this is to shut down the instance and remove/recreate the nic cards, applying proper security policies
Versions of the related components and OS (frontend, hypervisors, VMs):
One, 5.8.1, Ubuntu 18.0.4.2
Steps to reproduce:
Power cycle VM. It doesn’t happen all the time but it happened to me twice during the same evening
Current results:
NICs internally out of order
Expected results:
NIC ids order match ethernet IDS order inside the VM
0 -> eth0
1 -> eth1
2 -> eth2
Looking at the template I actually wonder if there is a way to insert a tag that would anchor each NIC to a specific order id? I tried inserting eth1 in the device name and VM couldn’t boot.
No, you can’t do that. The way that it is doing is the following:
You have a list of nics in the template.
The core will take that list and will generate the context variables.
Inside the VM there are some contextualisation scripts under /etc/one-context.d.
Those scripts are going to take the context variables stored in the context cd-rom and will contextualise the VM.
So you can check in that cd-rom which is the order, but you can’t change it, because is the core who generates it. Usually the order is the same as the template, I don’t why it changed in your case, maybe you did a detach/attach or some operations with nics.