- Status: accepted
- Date: 2021-11-08
- Authors: @yitsushi
- Deciders: @Callisto13 @jmickey @richardcase @yitsushi
With the POC, network interface names are generated from the name of the MicroVM and its Namespace. It works for short VM name and Namespace combinations, but device names can't be longer than 15 bytes12.
Because of this limitation, we have to find a better way to generate network device name on the host.
Considered options:
- Generate a UUID and use the first N bytes.
- Generate a hash of the Name and Namespace combination and use the first N bytes.
- Generate a random value.
Following the device name generator in docker-ce3, we decided to use a random value. Docker-ce tries to generate a name 3 times, if the generated name is already taken. To reduce possible failures, we decided to retry 5 times, it's still not slow, but gives more opportunities on machines with a lot of network devices.
It is not possible to determine which MicroVM is the owner of the network device from its name and we have to query external resources to see if given resource is in use or not.
Resources: MicroVM API, Flitlock API
As a result, it is possible to leak resources, when the MicroVM deletion failed and we lost track of a network device status from MicroVMSpec. For that reason, Resource cleanup ADR #90 priority might be raised to higher priority.