Revision bd87213f snf-cyclades-app/synnefo/logic/backend.py

b/snf-cyclades-app/synnefo/logic/backend.py
386 386
    # arguments, such as the disk template to use, name of os provider
387 387
    # and hypervisor-specific parameters at will (see Synnefo #785, #835).
388 388
    #
389
    kw = settings.GANETI_CREATEINSTANCE_KWARGS
389
    kw = vm.backend.get_create_params()
390 390
    kw['mode'] = 'create'
391 391
    kw['name'] = vm.backend_vm_id
392 392
    # Defined in settings.GANETI_CREATEINSTANCE_KWARGS
......
401 401
            kw['disks'][0]['origin'] = flavor.disk_origin
402 402

  
403 403
    kw['nics'] = [public_nic]
404
    if settings.GANETI_USE_HOTPLUG:
404
    if vm.backend.use_hotplug():
405 405
        kw['hotplug'] = True
406 406
    # Defined in settings.GANETI_CREATEINSTANCE_KWARGS
407 407
    # kw['os'] = settings.GANETI_OS_PROVIDER
......
475 475
    with pooled_rapi_client(vm) as client:
476 476
        i = client.GetInstance(vm.backend_vm_id)
477 477

  
478
    if i['hvparams']['serial_console']:
478
    if vm.backend.hypervisor == "kvm" and i['hvparams']['serial_console']:
479 479
        raise Exception("hv parameter serial_console cannot be true")
480 480
    console['host'] = i['pnode']
481 481
    console['port'] = i['network_port']
......
600 600

  
601 601
    with pooled_rapi_client(vm) as client:
602 602
        return client.ModifyInstance(vm.backend_vm_id, nics=[('add',  nic)],
603
                                     hotplug=settings.GANETI_USE_HOTPLUG,
603
                                     hotplug=vm.backend.use_hotplug(),
604 604
                                     depends=depends,
605 605
                                     dry_run=settings.TEST)
606 606

  
......
612 612

  
613 613
    with pooled_rapi_client(vm) as client:
614 614
        return client.ModifyInstance(vm.backend_vm_id, nics=op,
615
                                     hotplug=settings.GANETI_USE_HOTPLUG,
615
                                     hotplug=vm.backend.use_hotplug(),
616 616
                                     dry_run=settings.TEST)
617 617

  
618 618

  

Also available in: Unified diff