Verified Commit fea5a674 authored by anarcat's avatar anarcat
Browse files

ganeti reboots: enable migrate back by default

I've been bitten by this a few times today already: I forgot to pass
the argument and had to redo the migrate by hands.

I can't think of any situation where we would not migrate back
instances: i can think of some where we do not migrate instances in
the first place (when we reboot the instances as well as the nodes),
but those are covered separately anyways.
parent 7fd64a6b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ def shutdown_and_wait(
    delay_up=DEFAULT_DELAY_UP,
    ganeti_checks=True,
    ganeti_empty=True,
    ganeti_migrate_back=False,
    ganeti_migrate_back=True,
):
    """shutdown the machine and possibly wait for the box to return"""
    # TODO: support pooling multiple connexions here.
+9 −2
Original line number Diff line number Diff line
@@ -79,9 +79,16 @@ def parse_args(args=sys.argv[1:]):
        help="reboot instances on the node as well, avoiding migrations",
    )
    parser.add_argument(
        "--ganeti-migrate-back",
        "--no-ganeti-migrate-back",
        action="store_false",
        help="migrate the instances back after reboot",
        dest="ganeti_migrate_back",
        help="do not migrate the instances back after reboot",
    )
    # backwards compatibility
    parser.add_argument(
        "--ganeti-migrate-back",
        action="store_true",
        help=argparse.SUPPRESS,
    )
    # TODO: autodetect from LDAP. current documented behavior is
    # according to rebootPolicy: