Commit a5bd4611 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Fix bug in backend_allocator

The 'disk_template' attribute for flavors of external disk template
included the name of the provider. The backend allocator tried to find a
backend with an enabled 'ext_$(provider)' disk template. This commit
fixes this by searching only for 'ext' in the enabled disk templates.
parent 3edbbf00
......@@ -104,9 +104,15 @@ def get_available_backends(flavor):
excluded.
"""
disk_template = flavor.disk_template
# Ganeti knows only the 'ext' disk template, but the flavors disk template
# includes the provider.
if disk_template.startswith("ext_"):
disk_template = "ext"
backends = Backend.objects.select_for_update()
backends = backends.filter(offline=False, drained=False,
disk_templates__contains=flavor.disk_template)
disk_templates__contains=disk_template)
backends = list(backends)
if "SNF:ANY_PUBLIC" in DEFAULT_INSTANCE_NETWORKS:
backends = filter(lambda x: has_free_ip(x), backends)
......
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