Revision aa7a5c90

b/lib/cli.py
1088 1088

  
1089 1089
CLEANUP_OPT = cli_option("--cleanup", dest="cleanup",
1090 1090
                         default=False, action="store_true",
1091
                         help="Instead of performing the migration, try to"
1092
                         " recover from a failed cleanup. This is safe"
1091
                         help="Instead of performing the migration/failover,"
1092
                         " try to recover from a failed cleanup. This is safe"
1093 1093
                         " to run even if the instance is healthy, but it"
1094 1094
                         " will create extra replication traffic and "
1095 1095
                         " disrupt briefly the replication (like during the"
1096
                         " migration")
1096
                         " migration/failover")
1097 1097

  
1098 1098
STATIC_OPT = cli_option("-s", "--static", dest="static",
1099 1099
                        action="store_true", default=False,
b/lib/client/gnt_instance.py
1467 1467
    FailoverInstance, ARGS_ONE_INSTANCE,
1468 1468
    [FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT, SHUTDOWN_TIMEOUT_OPT,
1469 1469
     DRY_RUN_OPT, PRIORITY_OPT, DST_NODE_OPT, IALLOCATOR_OPT,
1470
     IGNORE_IPOLICY_OPT],
1470
     IGNORE_IPOLICY_OPT, CLEANUP_OPT],
1471 1471
    "[-f] <instance>", "Stops the instance, changes its primary node and"
1472 1472
    " (if it was originally running) starts it on the new node"
1473 1473
    " (the secondary for mirrored instances or any node"
b/lib/cmdlib/instance_migration.py
117 117
    _ExpandNamesForMigration(self)
118 118

  
119 119
    self._migrater = \
120
      TLMigrateInstance(self, self.op.instance_name, False, True, False,
121
                        self.op.ignore_consistency, True,
120
      TLMigrateInstance(self, self.op.instance_name, self.op.cleanup, True,
121
                        False, self.op.ignore_consistency, True,
122 122
                        self.op.shutdown_timeout, self.op.ignore_ipolicy)
123 123

  
124 124
    self.tasklets = [self._migrater]
......
140 140
      "SHUTDOWN_TIMEOUT": self.op.shutdown_timeout,
141 141
      "OLD_PRIMARY": source_node,
142 142
      "NEW_PRIMARY": target_node,
143
      "FAILOVER_CLEANUP": self.op.cleanup,
143 144
      }
144 145

  
145 146
    if instance.disk_template in constants.DTS_INT_MIRROR:
b/lib/opcodes.py
1520 1520
    _PIgnoreIpolicy,
1521 1521
    _PIAllocFromDesc("Iallocator for deciding the target node for"
1522 1522
                     " shared-storage instances"),
1523
    ("cleanup", False, ht.TBool,
1524
     "Whether a previously failed failover should be cleaned up"),
1523 1525
    ]
1524 1526
  OP_RESULT = ht.TNone
1525 1527

  
b/src/Ganeti/HTools/Program/Harep.hs
318 318
                                , opTargetNode = Nothing
319 319
                                , opIgnoreIpolicy = False
320 320
                                , opIallocator = Nothing
321
                                , opMigrationCleanup = False
321 322
                                }
322 323
           ])
323 324
       | offSec ->
b/src/Ganeti/OpCodes.hs
84 84
     , pMigrationTargetNode
85 85
     , pIgnoreIpolicy
86 86
     , pIallocator
87
     , pMigrationCleanup
87 88
     ])
88 89
  , ("OpInstanceMigrate",
89 90
     [ pInstanceName
b/test/hs/Test/Ganeti/OpCodes.hs
116 116
          genMaybe genNodeNameNE <*> genMaybe genNameNE
117 117
      "OP_INSTANCE_FAILOVER" ->
118 118
        OpCodes.OpInstanceFailover <$> genFQDN <*> arbitrary <*> arbitrary <*>
119
          genMaybe genNodeNameNE <*> arbitrary <*> genMaybe genNameNE
119
          genMaybe genNodeNameNE <*> arbitrary <*> genMaybe genNameNE <*>
120
          arbitrary
120 121
      "OP_INSTANCE_MIGRATE" ->
121 122
        OpCodes.OpInstanceMigrate <$> genFQDN <*> arbitrary <*> arbitrary <*>
122 123
          genMaybe genNodeNameNE <*> arbitrary <*>

Also available in: Unified diff