Revision 2a599282 snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
367 | 367 |
kw['name'] = vm.backend_vm_id |
368 | 368 |
# Defined in settings.GANETI_CREATEINSTANCE_KWARGS |
369 | 369 |
|
370 |
# Identify if provider parameter should be set in disk options. |
|
371 |
# Current implementation support providers only fo ext template. |
|
372 |
# To select specific provider for an ext template, template name |
|
373 |
# should be formated as `ext_<provider_name>`. |
|
374 |
provider = None |
|
375 |
disk_template = flavor.disk_template |
|
376 |
if flavor.disk_template.startswith("ext"): |
|
377 |
disk_template, provider = flavor.disk_template.split("_", 1) |
|
378 |
|
|
379 |
kw['disk_template'] = disk_template |
|
370 |
kw['disk_template'] = flavor.disk_template |
|
380 | 371 |
kw['disks'] = [{"size": flavor.disk * 1024}] |
372 |
provider = flavor.provider |
|
381 | 373 |
if provider: |
382 | 374 |
kw['disks'][0]['provider'] = provider |
383 | 375 |
|
384 | 376 |
if provider == 'vlmc': |
385 |
kw['disks'][0]['origin'] = image['backend_id']
|
|
377 |
kw['disks'][0]['origin'] = flavor.disk_origin
|
|
386 | 378 |
|
387 | 379 |
kw['nics'] = [public_nic] |
388 | 380 |
if settings.GANETI_USE_HOTPLUG: |
... | ... | |
403 | 395 |
'vcpus': flavor.cpu, |
404 | 396 |
'memory': flavor.ram} |
405 | 397 |
|
406 |
if provider == 'vlmc': |
|
407 |
image_id = 'null' |
|
408 |
else: |
|
409 |
image_id = image['backend_id'] |
|
410 |
|
|
411 | 398 |
kw['osparams'] = { |
412 | 399 |
'config_url': vm.config_url, |
413 | 400 |
# Store image id and format to Ganeti |
414 |
'img_id': image_id,
|
|
401 |
'img_id': image['backend_id'],
|
|
415 | 402 |
'img_format': image['format']} |
416 | 403 |
|
417 | 404 |
if password: |
Also available in: Unified diff