Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 2015 12:01:51 -0700
From:      Peter Grehan <grehan@freebsd.org>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        virtualization@freebsd.org
Subject:   Re: bhyve code question, pci_virtio_net.c
Message-ID:  <5557941F.9040608@freebsd.org>
In-Reply-To: <55577814.6040202@freebsd.org>
References:  <55577814.6040202@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Allan,

> 1) According to the comment, the mac address should be based on the md5
> of the DEVICE name, not the VM name. Which is correct? Which is more
> desirable?

  The comment may not be specific enough - dev name meant 
/dev/vmm/<devname>, which is the same as the VM name.

> Would it make sense to include more unique information in this hash?
> like the host's UUID or something, to prevent the chance of more than 1
> VM on the same LAN having the same MAC if they have the same VM Name?

  Yes: see the discussion at
 
http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-February/002187.html

  The issue was the changing the algorithm breaks existing Linux VMs 
which base configuration on MAC addresses.

  Using the host fixes one issue but creates another in that starting a 
VM on another host then gives a different MAC.

  However, there is always the option to set the MAC address manually if 
you feel there will be issues with collisions, using VMs on different 
hosts, etc.

> 2) Should bhyve instead use the FreeBSD assigned OUI for these MAC
> addresses?

  Yes, though switching to that would have had the same issue with 
breaking Linux guests.

  My rough plan to move forward with this is that any new non-virtio NIC 
emulation will get the FreeBSD OUI and perhaps a different default 
algorithm. virtio-net will continue to use the existing one, but maybe 
in the future a "legacy-mac" option will be required to use the old 
algorithm, and then it can be phased out.

  Yet another option is an auto-generated MAC is placed in a config file 
on first boot, ala VMWare. That could be the solution when config file 
work arrives.

later,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5557941F.9040608>