Commit 1e3463f1 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Implement “gnt-node repair-volume”

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 76aef8fc
......@@ -854,6 +854,41 @@ /dev/sdb1 698.6G 1.3G 697.4G
Repairs a storage volume on a node. Only LVM volume groups can be
repaired at this time. They have the storage type
On LVM volume groups, <command>repair-volume</command> runs
<quote>vgreduce --removemissing</quote>.
Running this command can lead to data loss. Use it with care.
# gnt-node repair-volume lvm-vg xenvg
......@@ -541,6 +541,26 @@ def ModifyVolume(opts, args):
def RepairVolume(opts, args):
"""Repairs a storage volume on a node.
@param opts: the command line options selected by the user
@type args: list
@param args: should contain 3 items: node name, storage type and volume name
@rtype: int
@return: the desired exit code
(node_name, user_storage_type, volume_name) = args
storage_type = ConvertStorageType(user_storage_type)
op = opcodes.OpRepairNodeStorage(node_name=node_name,
def SetNodeParams(opts, args):
"""Modifies a node.
......@@ -688,6 +708,10 @@ commands = {
"<node_name> <storage_type> <name>",
"Modify storage volume on a node"),
'repair-volume': (RepairVolume, ARGS_FIXED(3),
"<node_name> <storage_type> <name>",
"Repairs a storage volume on a node"),
'list-tags': (ListTags, ARGS_ONE, [DEBUG_OPT],
"<node_name>", "List the tags of the given node"),
'add-tags': (AddTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT],
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