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):
If the ignore_primary is false, errors on the primary node are
ignored.
Modifies the configuration of the instance, so the caller should re-read the
instance configuration, if needed.
"""
all_result = True
......@@ -1316,6 +1319,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
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}
@param lu: the logical unit on whose behalf we execute
@type instance: L{objects.Instance}
......@@ -1339,7 +1345,7 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
if disks is None:
# 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)
......@@ -1407,6 +1413,9 @@ def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False,
def StartInstanceDisks(lu, instance, force):
"""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,
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