Commit 1afc284c authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Consider IPv6 only networks in allocator

Backend allocator excludes backends that do not have a free IPv4
address. Since, from now on, not all instances are connected to a public
network, this check is only needed when 'SNF:ANY_PUBIC' network is used.
parent f58b1628
......@@ -32,7 +32,8 @@ import datetime
from django.utils import importlib
from synnefo.settings import (BACKEND_ALLOCATOR_MODULE, BACKEND_REFRESH_MIN,
BACKEND_PER_USER, ARCHIPELAGO_BACKENDS)
BACKEND_PER_USER, ARCHIPELAGO_BACKENDS,
DEFAULT_INSTANCE_NETWORKS)
from synnefo.db.models import Backend
from synnefo.logic.backend import update_resources
from synnefo.api.util import backend_public_networks
......@@ -101,7 +102,9 @@ def get_available_backends():
"""
backends = list(Backend.objects.select_for_update().filter(drained=False,
offline=False))
return filter(lambda x: has_free_ip(x), backends)
if "SNF:ANY_PUBLIC" in DEFAULT_INSTANCE_NETWORKS:
backends = filter(lambda x: has_free_ip(x), backends)
return backends
def filter_archipelagos_backends(available_backends, disk_template):
......
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