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):
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,
backends = list(backends)
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