"Not owning correct locks"
assert not self.owned_locks(locking.LEVEL_NODE)
+ es_flags = rpc.GetExclusiveStorageForNodeNames(self.cfg,
+ per_node_disks.keys())
+
changed = []
for node, dskl in per_node_disks.items():
newl = [v[2].Copy() for v in dskl]
" dimension information, ignoring", idx,
instance.name)
continue
- (size, _) = dimensions
+ (size, spindles) = dimensions
if not isinstance(size, (int, long)):
self.LogWarning("Disk %d of instance %s did not return valid"
" size information, ignoring", idx, instance.name)
instance.name, disk.size, size)
disk.size = size
self.cfg.Update(instance, feedback_fn)
- changed.append((instance.name, idx, size))
+ changed.append((instance.name, idx, "size", size))
+ if es_flags[node]:
+ if spindles is None:
+ self.LogWarning("Disk %d of instance %s did not return valid"
+ " spindles information, ignoring", idx,
+ instance.name)
+ elif disk.spindles is None or disk.spindles != spindles:
+ self.LogInfo("Disk %d of instance %s has mismatched spindles,"
+ " correcting: recorded %s, actual %s",
+ idx, instance.name, disk.spindles, spindles)
+ disk.spindles = spindles
+ self.cfg.Update(instance, feedback_fn)
+ changed.append((instance.name, idx, "spindles", disk.spindles))
if self._EnsureChildSizes(disk):
self.cfg.Update(instance, feedback_fn)
- changed.append((instance.name, idx, disk.size))
+ changed.append((instance.name, idx, "size", disk.size))
return changed
Parameters: optional instances list, in case we want to restrict the
checks to only a subset of the instances.
- Result: a list of tuples, (instance, disk, new-size) for changed
+ Result: a list of tuples, (instance, disk, parameter, new-size) for changed
configurations.
In normal operation, the list should be empty.
OP_PARAMS = [
("instances", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), None),
]
- OP_RESULT = ht.TListOf(ht.TAnd(ht.TIsLength(3),
+ OP_RESULT = ht.TListOf(ht.TAnd(ht.TIsLength(4),
ht.TItems([ht.TNonEmptyString,
ht.TNonNegativeInt,
+ ht.TNonEmptyString,
ht.TNonNegativeInt])))
disks matches the actual size and updates any mismatches found.
This is needed if the Ganeti configuration is no longer consistent
with reality, as it will impact some disk operations. If no
-arguments are given, all instances will be checked.
+arguments are given, all instances will be checked. When exclusive
+storage is active, also spindles are updated.
Note that only active disks can be checked by this command; in case
a disk cannot be activated it's advised to use
**gnt-instance activate-disks \--ignore-size ...** to force
activation without regard to the current size.
-When the all disk sizes are consistent, the command will return no
+When all the disk sizes are consistent, the command will return no
output. Otherwise it will log details about the inconsistencies in
the configuration.