Commit 154f63b4 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Start pool indexing from 0

parent a5b12a9a
......@@ -29,6 +29,7 @@ GANETI_PUBLIC_NETWORK = 'snf-net-1'
# The first mac prefix to use
MAC_POOL_BASE = 'aa:00:0'
# Max number of mac prefixes to use
MAC_POOL_LIMIT = 65536
ENABLED_NETWORKS = ['PUBLIC_ROUTED',
......@@ -64,7 +65,7 @@ PRIVATE_MAC_FILTERED_TAGS = ['private-filtered']
# ------------------------------------------
# Each network of this type is mapped to an isolated physical VLAN, which must
# be preconfigured in the backend. Each vlan corresponds to a bridge named
# $PRIVATE_PHYSICAL_VLAN_PREFIX{1..$PRIVATE_PHYSICAL_VLAN_MAX_NUMBER} (e.g. prv5)
# $PRIVATE_PHYSICAL_VLAN_PREFIX{0..$PRIVATE_PHYSICAL_VLAN_MAX_NUMBER} (e.g. prv5)
# VirtualMachine's taps are eventually bridged to the corresponding bridge.
PRIVATE_PHYSICAL_VLAN_BRIDGE_PREFIX = 'prv'
# The max limit of physical vlan pool
......
......@@ -715,7 +715,7 @@ class Pool(models.Model):
last = cls.objects.order_by('-index')[0]
index = last.index + 1
except IndexError:
index = 1
index = 0
if index <= cls.max_index:
return cls.objects.create(index=index,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment