« Previous | Next » 

Revision 1d93a147


Added by Dimitris Aragiorgis about 11 years ago

Let synnefo do the mac generation

To this end only MAC_FILTERED networks should have mac prefix and
synnefo will assure mac uniqueness among clusters. Public
NetworkInterfaces get the same mac prefix (settings.DEFAULT_MAC_PREFIX)

Remove mac_prefix from BackendNetwork.

mac_prefix has only a Network Object. generate_unique_mac()
takes network and vm and assures that will be unique inside the
network. It adds a dummy entry in vm.nics so that future invocations
will produce consistent results. If a network has no mac_prefix then

Base mac_prefix is now aa:00:00.

Ensure atomicity when adding dummy nic after generating a mac. If
it happens more threads to generate same mac then DB will not allow
creating it because mac field is unique. To this end the transaction will
fail. Thus we make use of savepoints.

Signed-off-by: Dimitris Aragiorgis <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences