diff --git a/lib/cmdlib.py b/lib/cmdlib.py index a83878703b28bfea4825dc6d85b274e762f6fdc2..71d4698aee06bf3c26eecd4a12b3ecbb36e75f55 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -8174,14 +8174,9 @@ class TLMigrateInstance(Tasklet): # check if failover must be forced instead of migration if (not self.cleanup and not self.failover and i_be[constants.BE_ALWAYS_FAILOVER]): - if self.fallback: - self.lu.LogInfo("Instance configured to always failover; fallback" - " to failover") - self.failover = True - else: - raise errors.OpPrereqError("This instance has been configured to" - " always failover, please allow failover", - errors.ECODE_STATE) + self.lu.LogInfo("Instance configured to always failover; fallback" + " to failover") + self.failover = True # check bridge existance _CheckInstanceBridgesExist(self.lu, instance, node=target_node) diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index c08ea4f4ccd00f3f6adee457dce09c42e4a7c9e7..b208954edf070cbc5c8f114167d715afc844df4c 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -1573,6 +1573,9 @@ The ``--no-runtime-changes`` option forbids migrate to alter an instance's runtime before migrating it (eg. ballooning an instance down because the target node doesn't have enough available memory). +If an instance has the backend parameter ``always\_failover`` set to +true, then the migration is automatically converted into a failover. + See **ganeti(7)** for a description of ``--submit`` and other common options. diff --git a/qa/qa_instance.py b/qa/qa_instance.py index 9b9168db80e9dcd5d313f87542d504d9f3850d6d..5cc628760edc70957211fbd586dd4263c3e67968 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -275,10 +275,9 @@ def TestInstanceMigrate(instance): (constants.BE_ALWAYS_FAILOVER, constants.VALUE_TRUE)), instance["name"]]) - AssertCommand(cmd, fail=True) + AssertCommand(cmd) qa_utils.RunInstanceCheck(instance, True) - AssertCommand(["gnt-instance", "migrate", "--force", "--allow-failover", - instance["name"]]) + # TODO: Verify that a failover has been done instead of a migration # TODO: Verify whether the default value is restored here (not hardcoded) AssertCommand(["gnt-instance", "modify", "-B",