Revision c9c41373

b/lib/client/gnt_instance.py
611 611

  
612 612
  """
613 613
  instance_name = args[0]
614
  op = opcodes.OpInstanceDeactivateDisks(instance_name=instance_name)
614
  op = opcodes.OpInstanceDeactivateDisks(instance_name=instance_name,
615
                                         force=opts.force)
615 616
  SubmitOrSend(op, opts)
616 617
  return 0
617 618

  
......
1465 1466
    "<instance>", "Activate an instance's disks"),
1466 1467
  'deactivate-disks': (
1467 1468
    DeactivateDisks, ARGS_ONE_INSTANCE,
1468
    [SUBMIT_OPT, DRY_RUN_OPT, PRIORITY_OPT],
1469
    "<instance>", "Deactivate an instance's disks"),
1469
    [FORCE_OPT, SUBMIT_OPT, DRY_RUN_OPT, PRIORITY_OPT],
1470
    "[-f] <instance>", "Deactivate an instance's disks"),
1470 1471
  'recreate-disks': (
1471 1472
    RecreateDisks, ARGS_ONE_INSTANCE,
1472 1473
    [SUBMIT_OPT, DISKIDX_OPT, DRY_RUN_OPT, PRIORITY_OPT],
b/lib/cmdlib.py
4822 4822

  
4823 4823
    """
4824 4824
    instance = self.instance
4825
    _SafeShutdownInstanceDisks(self, instance)
4825
    if self.op.force:
4826
      _ShutdownInstanceDisks(self, instance)
4827
    else:
4828
      _SafeShutdownInstanceDisks(self, instance)
4826 4829

  
4827 4830

  
4828 4831
def _SafeShutdownInstanceDisks(lu, instance, disks=None):
b/lib/opcodes.py
941 941
  """Deactivate an instance's disks."""
942 942
  OP_DSC_FIELD = "instance_name"
943 943
  OP_PARAMS = [
944
    _PInstanceName
944
    _PInstanceName,
945
    _PForce,
945 946
    ]
946 947

  
947 948

  
b/man/gnt-instance.rst
1242 1242
DEACTIVATE-DISKS
1243 1243
^^^^^^^^^^^^^^^^
1244 1244

  
1245
**deactivate-disks** [--submit] {*instance*}
1245
**deactivate-disks** [-f] [--submit] {*instance*}
1246 1246

  
1247 1247
De-activates the block devices of the given instance. Note that if
1248 1248
you run this command for an instance with a drbd disk template,
......
1250 1250
devices on the primary node, but it will shutdown the block devices
1251 1251
on the secondary nodes, thus breaking the replication.
1252 1252

  
1253
The ``-f``/``--force`` option will skip checks that the instance is
1254
down; in case the hypervisor is confused and we can't talk to it,
1255
normally Ganeti will refuse to deactivate the disks, but with this
1256
option passed it will skip this check and directly try to deactivate
1257
the disks. This can still fail due to the instance actually running or
1258
other issues.
1259

  
1253 1260
The ``--submit`` option is used to send the job to the master
1254 1261
daemon but not wait for its completion. The job ID will be shown so
1255 1262
that it can be examined via **gnt-job info**.

Also available in: Unified diff