Commit d9adac23 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Instance storage: Mark functions that modify instances



.. in the configuration with comments.

Also re-read an instance object where needed.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent d05566f2
...@@ -1278,6 +1278,9 @@ def ShutdownInstanceDisks(lu, instance, disks=None, ignore_primary=False): ...@@ -1278,6 +1278,9 @@ def ShutdownInstanceDisks(lu, instance, disks=None, ignore_primary=False):
If the ignore_primary is false, errors on the primary node are If the ignore_primary is false, errors on the primary node are
ignored. ignored.
Modifies the configuration of the instance, so the caller should re-read the
instance configuration, if needed.
""" """
all_result = True all_result = True
...@@ -1316,6 +1319,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False, ...@@ -1316,6 +1319,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
This sets up the block devices on all nodes. This sets up the block devices on all nodes.
Modifies the configuration of the instance, so the caller should re-read the
instance configuration, if needed.
@type lu: L{LogicalUnit} @type lu: L{LogicalUnit}
@param lu: the logical unit on whose behalf we execute @param lu: the logical unit on whose behalf we execute
@type instance: L{objects.Instance} @type instance: L{objects.Instance}
...@@ -1339,7 +1345,7 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False, ...@@ -1339,7 +1345,7 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
if disks is None: if disks is None:
# only mark instance disks as active if all disks are affected # only mark instance disks as active if all disks are affected
lu.cfg.MarkInstanceDisksActive(instance.uuid) instance = lu.cfg.MarkInstanceDisksActive(instance.uuid)
disks = ExpandCheckDisks(instance, disks) disks = ExpandCheckDisks(instance, disks)
...@@ -1407,6 +1413,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False, ...@@ -1407,6 +1413,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
def StartInstanceDisks(lu, instance, force): def StartInstanceDisks(lu, instance, force):
"""Start the disks of an instance. """Start the disks of an instance.
Modifies the configuration of the instance, so the caller should re-read the
instance configuration, if needed.
""" """
disks_ok, _ = AssembleInstanceDisks(lu, instance, disks_ok, _ = AssembleInstanceDisks(lu, instance,
ignore_secondaries=force) ignore_secondaries=force)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment