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

b/snf-cyclades-app/synnefo/logic/backend.py
682 682

  
683 683
def reboot_instance(vm, reboot_type):
684 684
    assert reboot_type in ('soft', 'hard')
685
    # Note that reboot type of Ganeti job must be always hard. The 'soft' and
686
    # 'hard' type of OS API is different from the one in Ganeti, and maps to
687
    # 'shutdown_timeout'.
685 688
    kwargs = {"instance": vm.backend_vm_id,
686 689
              "reboot_type": "hard"}
687
    # XXX: Currently shutdown_timeout parameter is not supported from the
688
    # Ganeti RAPI. Until supported, we will fallback for both reboot types
689
    # to the default shutdown timeout of Ganeti (120s). Note that reboot
690
    # type of Ganeti job must be always hard. The 'soft' and 'hard' type
691
    # of OS API is different from the one in Ganeti, and maps to
692
    # 'shutdown_timeout'.
693
    #if reboot_type == "hard":
694
    #    kwargs["shutdown_timeout"] = 0
690
    # 'shutdown_timeout' parameter is only support from snf-ganeti>=2.8.2 and
691
    # Ganeti > 2.10. In other versions this parameter will be ignored and
692
    # we will fallback to default timeout of Ganeti (120s).
693
    if reboot_type == "hard":
694
        kwargs["shutdown_timeout"] = 0
695 695
    if settings.TEST:
696 696
        kwargs["dry_run"] = True
697 697
    with pooled_rapi_client(vm) as client:

Also available in: Unified diff