Revision 1f350e0f lib/cmdlib.py

b/lib/cmdlib.py
7449 7449
    else:
7450 7450
      if instance_running:
7451 7451
        result = self.rpc.call_instance_shutdown(node_current, instance,
7452
                                                 self.op.shutdown_timeout)
7452
                                                 self.op.shutdown_timeout,
7453
                                                 reason)
7453 7454
        result.Raise("Could not shutdown instance for full reboot")
7454 7455
        _ShutdownInstanceDisks(self, instance)
7455 7456
      else:
......
7525 7526
    instance = self.instance
7526 7527
    node_current = instance.primary_node
7527 7528
    timeout = self.op.timeout
7529
    reason = self.op.reason
7528 7530

  
7529 7531
    # If the instance is offline we shouldn't mark it as down, as that
7530 7532
    # resets the offline flag.
......
7535 7537
      assert self.op.ignore_offline_nodes
7536 7538
      self.LogInfo("Primary node offline, marked instance as stopped")
7537 7539
    else:
7538
      result = self.rpc.call_instance_shutdown(node_current, instance, timeout)
7540
      result = self.rpc.call_instance_shutdown(node_current, instance, timeout,
7541
                                               reason)
7539 7542
      msg = result.fail_msg
7540 7543
      if msg:
7541 7544
        self.LogWarning("Could not shutdown instance: %s", msg)
......
8116 8119
                 instance.name, instance.primary_node)
8117 8120

  
8118 8121
    result = self.rpc.call_instance_shutdown(instance.primary_node, instance,
8119
                                             self.op.shutdown_timeout)
8122
                                             self.op.shutdown_timeout,
8123
                                             self.op.reason)
8120 8124
    msg = result.fail_msg
8121 8125
    if msg:
8122 8126
      if self.op.ignore_failures:
......
8481 8485
            self.owned_locks(locking.LEVEL_NODE_RES))
8482 8486

  
8483 8487
    result = self.rpc.call_instance_shutdown(source_node, instance,
8484
                                             self.op.shutdown_timeout)
8488
                                             self.op.shutdown_timeout,
8489
                                             self.op.reason)
8485 8490
    msg = result.fail_msg
8486 8491
    if msg:
8487 8492
      if self.op.ignore_consistency:
......
9254 9259
                 instance.name, source_node)
9255 9260

  
9256 9261
    result = self.rpc.call_instance_shutdown(source_node, instance,
9257
                                             self.shutdown_timeout)
9262
                                             self.shutdown_timeout,
9263
                                             self.lu.op.reason)
9258 9264
    msg = result.fail_msg
9259 9265
    if msg:
9260 9266
      if self.ignore_consistency or primary_node.offline:
......
14927 14933
      # shutdown the instance, but not the disks
14928 14934
      feedback_fn("Shutting down instance %s" % instance.name)
14929 14935
      result = self.rpc.call_instance_shutdown(src_node, instance,
14930
                                               self.op.shutdown_timeout)
14936
                                               self.op.shutdown_timeout,
14937
                                               self.op.reason)
14931 14938
      # TODO: Maybe ignore failures if ignore_remove_failures is set
14932 14939
      result.Raise("Could not shutdown instance %s on"
14933 14940
                   " node %s" % (instance.name, src_node))

Also available in: Unified diff