Revision 1d93a147
ID | 1d93a14781cca791d9e991490a9991fe8626b755 |
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
takes DEFAULT_MAC_PREFIX.
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 <dimara@grnet.gr>
Files
- added
- modified
- copied
- renamed
- deleted