master - lvmdump.8.in: describe lvmpolld related option
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4f1c1f3d6bfa08...
Commit: 4f1c1f3d6bfa08b554caea0aae5590613c5ef05b
Parent: e93058ed814f4e669287a6c5e8fa913130f2d591
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Fri May 15 13:38:38 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:32:32 2015 +0200
lvmdump.8.in: describe lvmpolld related option
---
man/lvmdump.8.in | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/man/lvmdump.8.in b/man/lvmdump.8.in
index 9a8c469..f9c2284 100644
--- a/man/lvmdump.8.in
+++ b/man/lvmdump.8.in
@@ -10,6 +10,7 @@ lvmdump \(em create lvm2 information dumps for diagnostic purposes
.RB [ \-h ]
.RB [ \-l ]
.RB [ \-m ]
+.RB [ \-p ]
.RB [ \-s ]
.RB [ \-u ]
.SH DESCRIPTION
@@ -41,6 +42,8 @@ The content of the tarball is as follows:
.br
- if enabled with \-l, lvmetad state if running
.br
+- if enabled with \-p, lvmpolld state if running
+.br
- if enabled with \-s, system info and context
.br
- if enabled with \-u, udev info and context
@@ -75,6 +78,12 @@ This option generates a 1:1 dump of the metadata area from all PVs visible
to the system, which can cause the dump to increase in size considerably.
However, the metadata dump may represent a valuable diagnostic resource.
.TP
+.B \-p
+Include \fBlvmpolld\fP(8) daemon dump if it is running. The dump contains
+all in-progress operation currently monitored by the daemon and partial
+history for all yet uncollected results of polling operations already finished
+including reason.
+.TP
.B \-s
Gather system info and context. Currently, this encompasses systemd info
and context only: overall state of systemd units present in the system,
9 years
master - commands.h: reorder lvpoll options
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e93058ed814f4e...
Commit: e93058ed814f4e669287a6c5e8fa913130f2d591
Parent: ce3c457dcc4385c6740bacf1b0e9ca7575ab8c10
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 19:33:54 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:32:25 2015 +0200
commands.h: reorder lvpoll options
---
tools/commands.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/commands.h b/tools/commands.h
index bbfcd72..8e87681 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -884,12 +884,13 @@ xx(lvpoll,
"Continue already initiated poll operation on a logical volume",
0,
"\t[--abort]\n"
- "\t[--handlemissingpvs]\n"
- "\t[--polloperation\n"
"\t[-A|--autobackup {y|n}]\n"
+ "\t[--commandprofile ProfileName]\n"
"\t[-d|--debug]\n "
"\t[-h|-?|--help]\n"
+ "\t[--handlemissingpvs]\n"
"\t[-i|--interval seconds]\n"
+ "\t[--polloperation]\n"
"\t[-t|--test]\n "
"\t[-v|--verbose]\n "
"\t[--version]\n",
9 years
master - lvm-lvpoll.8.in: man page for built-in command
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ce3c457dcc4385...
Commit: ce3c457dcc4385c6740bacf1b0e9ca7575ab8c10
Parent: 239fb95fde143145f5dc3b3c65189b3549e2f7a6
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Fri May 15 20:16:51 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:32:16 2015 +0200
lvm-lvpoll.8.in: man page for built-in command
---
man/Makefile.in | 2 +-
man/lvm-lvpoll.8.in | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/man/Makefile.in b/man/Makefile.in
index fd92372..d75d916 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -48,7 +48,7 @@ endif
MAN5=lvm.conf.5
MAN7=lvmsystemid.7
-MAN8=lvm-config.8 lvm-dumpconfig.8 \
+MAN8=lvm-config.8 lvm-dumpconfig.8 lvm-lvpoll.8 \
lvchange.8 lvmconfig.8 lvconvert.8 lvcreate.8 lvdisplay.8 lvextend.8 \
lvm.8 lvmchange.8 lvmconf.8 lvmdiskscan.8 lvmdump.8 lvmsadc.8 lvmsar.8 \
lvreduce.8 lvremove.8 lvrename.8 lvresize.8 lvs.8 \
diff --git a/man/lvm-lvpoll.8.in b/man/lvm-lvpoll.8.in
new file mode 100644
index 0000000..8ffbdd4
--- /dev/null
+++ b/man/lvm-lvpoll.8.in
@@ -0,0 +1,89 @@
+.TH "LVPOLL" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
+.SH NAME
+lvpoll \(em Internal command used by lvmpolld to complete some Logical Volume operations.
+
+.SH SYNOPSIS
+.B lvm lvpoll
+.BR \-\-polloperation
+.RI { pvmove | convert | merge | merge_thin }
+.RB [ \-\-abort ]
+.RB [ \-A | \-\-autobackup
+.RI { y | n }]
+.RB [ \-\-commandprofile
+.IR ProfileName ]
+.RB [ \-d | \-\-debug ]
+.RB [ \-h | \-? | \-\-help ]
+.RB [ \-\-handlemissingpvs ]
+.RB [ \-i | \-\-interval
+.IR Seconds ]
+.RB [ \-t | \-\-test ]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-\-version ]
+.IR LogicalVolume [ Path ]
+.SH DESCRIPTION
+\fBlvpoll\fP is an internal command used by \fBlvmpolld\fP(8) to monitor and
+complete \fBlvconvert\fP(8) and \fBpvmove\fP(8) operations.
+\fBlvpoll\fP itself does not initiate these operations and
+you should never normally need to invoke it directly.
+
+.I LogicalVolume
+The Logical Volume undergoing conversion or, in the case of pvmove, the name of
+the internal pvmove Logical Volume (see \fBEXAMPLES\fP).
+.SH OPTIONS
+See \fBlvm\fP(8) for common options.
+.TP
+.BR \-\-polloperation " {" \fIconvert | \fImerge | \fImerge_thin | \fIpvmove }
+Mandatory option.
+\fIpvmove\fP refers to a pvmove operation that is moving data.
+\fIconvert\fP refers to an operation that is increasing the number of redundant copies of data maintained by a mirror.
+\fImerge\fP indicates a merge operation that doesn't involve thin volumes.
+\fImerge_thin\fP indicates a merge operation involving thin snapshots.
+\fBpvmove\fP(8) and \fBlvconvert\fP(8) describe how to initiate these operations.
+.TP
+.B \-\-abort
+Abort pvmove in progress. See \fBpvmove\fP(8).
+.TP
+.B \-\-handlemissingpvs
+Used when the polling operation needs to handle missing PVs to be able to
+continue. This can happen when \fBlvconvert\fP(8) is repairing a mirror
+with one or more faulty devices.
+.TP
+.BR \-i ", " \-\-interval " "\fISeconds
+Report progress at regular intervals
+
+.SH EXAMPLES
+Resume polling of a pvmove operation identified by the Logical Volume vg00/pvmove0:
+.sp
+.B lvm lvpoll --polloperation pvmove vg00/pvmove0
+.P
+Abort the same pvmove operation:
+.sp
+.B lvm lvpoll --polloperation pvmove --abort vg00/pvmove0
+.P
+To find out the name of the pvmove Logical Volume resulting from an original
+\fBpvmove /dev/sda1\fP command you may use the following \fBlvs\fP command.
+(Remove the parentheses from the LV name.)
+.sp
+.B lvs -a -S move_pv=/dev/sda1
+.P
+Resume polling of mirror conversion vg00/lvmirror:
+.sp
+.B lvm lvpoll --polloperation convert vg00/lvmirror
+.P
+Complete mirror repair:
+.sp
+.B lvm lvpoll --polloperation convert vg/damaged_mirror --handlemissingpvs
+.P
+Process snapshot merge:
+.sp
+.B lvm lvpoll --polloperation merge vg/snapshot_old
+.P
+Finish thin snapshot merge:
+.sp
+.B lvm lvpoll --polloperation merge_thin vg/thin_snapshot
+.SH SEE ALSO
+.BR lvconvert (8),
+.BR lvm (8),
+.BR lvmpolld (8),
+.BR lvs (8),
+.BR pvmove (8)
9 years
master - lvmpolld.8.in: hide origin of lvmpolld man page
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=239fb95fde1431...
Commit: 239fb95fde143145f5dc3b3c65189b3549e2f7a6
Parent: 6cdd153b891527d04f36e2c7feb34a6aebdc63df
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 18:43:50 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:32:08 2015 +0200
lvmpolld.8.in: hide origin of lvmpolld man page
:)
---
man/lvmpolld.8.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvmpolld.8.in b/man/lvmpolld.8.in
index 26e7afe..462ac1f 100644
--- a/man/lvmpolld.8.in
+++ b/man/lvmpolld.8.in
@@ -1,4 +1,4 @@
-.TH LVMETAD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
+.TH LVMPOLLD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
.SH NAME
lvmpolld \(em LVM poll daemon
.SH SYNOPSIS
9 years
master - lvmpolld-client.c: explain known return codes
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6cdd153b891527...
Commit: 6cdd153b891527d04f36e2c7feb34a6aebdc63df
Parent: 333fdfd4b69d04ff94eca644d335567dd70bc589
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 16:44:31 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:31:54 2015 +0200
lvmpolld-client.c: explain known return codes
lvmpolld returns few well known return codes. Explain
these to users and suggest reading lvmpolld log files
for more details
---
lib/lvmpolld/lvmpolld-client.c | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/lib/lvmpolld/lvmpolld-client.c b/lib/lvmpolld/lvmpolld-client.c
index 91f77eb..58bc86f 100644
--- a/lib/lvmpolld/lvmpolld-client.c
+++ b/lib/lvmpolld/lvmpolld-client.c
@@ -20,6 +20,7 @@
#include "metadata-exported.h"
#include "polldaemon.h"
#include "toolcontext.h"
+#include "lvm2cmd.h"
struct progress_info {
unsigned error:1;
@@ -88,6 +89,33 @@ void lvmpolld_disconnect(void)
}
}
+static void _explain_error_codes(int retcode)
+{
+ switch (retcode) {
+ /* LVM2 return codes */
+ case LVM2_NO_SUCH_COMMAND:
+ log_error("LVM command run by lvmpolld responded with: 'No such command.'");
+ break;
+ case LVM2_INVALID_PARAMETERS:
+ log_error("LVM command run by lvmpolld failed due to invalid parameters.");
+ break;
+ case LVM2_PROCESSING_FAILED:
+ log_error("LVM command executed by lvmpolld failed.");
+ break;
+
+ /* lvmpolld specific return codes */
+ case LVMPD_RET_DUP_FAILED:
+ log_error("lvmpolld failed to duplicate file descriptors.");
+ case LVMPD_RET_EXC_FAILED:
+ log_error("lvmpolld failed to exec() lvm binary.");
+ break;
+ default:
+ log_error("lvmpolld responded with unexpected return code.");
+ }
+
+ log_print_unless_silent("For more information see lvmpolld messages in syslog or lvmpolld log file.");
+}
+
static void _process_error_response(daemon_reply rep)
{
if (!strcmp(daemon_reply_str(rep, "response", ""), LVMPD_RESP_FAILED))
@@ -102,7 +130,7 @@ static void _process_error_response(daemon_reply rep)
daemon_reply_str(rep, "response", "<empty>"),
daemon_reply_str(rep, "reason", "<empty>"));
- log_print_unless_silent("For more detailed information see lvmpolld log file.");
+ log_print_unless_silent("For more information see lvmpolld messages in syslog or lvmpolld log file.");
}
static struct progress_info _request_progress_info(const char *uuid, unsigned abort_polling)
@@ -310,12 +338,11 @@ int lvmpolld_request_info(const struct poll_operation_id *id, const struct daemo
if (info.finished) {
if (info.cmd_signal)
- log_error("Polling command got terminated by signal (%d).",
+ log_error("Command executed by lvmpolld got terminated by signal (%d).",
info.cmd_signal);
else if (info.cmd_retcode)
- log_error("Polling command exited with return code: %d.",
- info.cmd_retcode);
- else {
+ _explain_error_codes(info.cmd_retcode);
+ else {
log_verbose("Polling finished successfully.");
ret = 1;
}
9 years
master - lvmpolld: label known return codes
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=333fdfd4b69d04...
Commit: 333fdfd4b69d04ff94eca644d335567dd70bc589
Parent: 8d594c409c33884a00be578543589d8207338413
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 15:53:29 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:31:48 2015 +0200
lvmpolld: label known return codes
so that lvmpolld-client can decode and describe these
return codes properly
---
daemons/lvmpolld/lvmpolld-core.c | 4 ++--
daemons/lvmpolld/lvmpolld-protocol.h | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c
index ede6fc2..ad6f5f7 100644
--- a/daemons/lvmpolld/lvmpolld-core.c
+++ b/daemons/lvmpolld/lvmpolld-core.c
@@ -397,11 +397,11 @@ static void *fork_and_poll(void *args)
if ((dup2(outfd, STDOUT_FILENO ) != STDOUT_FILENO) ||
(dup2(errfd, STDERR_FILENO ) != STDERR_FILENO))
- _exit(100);
+ _exit(LVMPD_RET_DUP_FAILED);
execve(*(pdlv->cmdargv), (char *const *)pdlv->cmdargv, (char *const *)pdlv->cmdenvp);
- _exit(101);
+ _exit(LVMPD_RET_EXC_FAILED);
} else {
/* parent */
if (r == -1) {
diff --git a/daemons/lvmpolld/lvmpolld-protocol.h b/daemons/lvmpolld/lvmpolld-protocol.h
index 7d9821b..1f0d6a6 100644
--- a/daemons/lvmpolld/lvmpolld-protocol.h
+++ b/daemons/lvmpolld/lvmpolld-protocol.h
@@ -46,4 +46,7 @@
#define LVMPD_REAS_RETCODE "retcode" /* lvm cmd ret code */
#define LVMPD_REAS_SIGNAL "signal" /* lvm cmd terminating singal */
+#define LVMPD_RET_DUP_FAILED 100
+#define LVMPD_RET_EXC_FAILED 101
+
#endif /* _LVM_LVMPOLLD_PROTOCOL_H */
9 years
master - libdaemon: fprintf(stderr...) -> ERROR()
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8d594c409c3388...
Commit: 8d594c409c33884a00be578543589d8207338413
Parent: f653b123cf41751ebabfc910061c07e6e3c47149
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 15:50:16 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:31:42 2015 +0200
libdaemon: fprintf(stderr...) -> ERROR()
log data structures are ready. so why not pass
error messages through ERROR()
---
libdaemon/server/daemon-server.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 6e497b8..bedd3b2 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -598,7 +598,7 @@ void daemon_start(daemon_state s)
/* Set Close-on-exec */
if (!failed && fcntl(s.socket_fd, F_SETFD, 1))
- fprintf(stderr, "setting CLOEXEC on socket fd %d failed: %s\n", s.socket_fd, strerror(errno));
+ ERROR(&s, "setting CLOEXEC on socket fd %d failed: %s\n", s.socket_fd, strerror(errno));
/* Signal parent, letting them know we are ready to go. */
if (!s.foreground)
9 years
master - libdaemon: suggest daemon already running
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f653b123cf4175...
Commit: f653b123cf41751ebabfc910061c07e6e3c47149
Parent: c0d30da60968e202d1e834dea28869a571bee991
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu May 14 15:43:43 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri May 15 20:31:36 2015 +0200
libdaemon: suggest daemon already running
when dm_creat_lockfile fails, it's probably due to
another instance is holding the same pid file...
---
libdaemon/server/daemon-server.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index e1a9da9..6e497b8 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -568,8 +568,10 @@ void daemon_start(daemon_state s)
* NB. Take care to not keep stale locks around. Best not exit(...)
* after this point.
*/
- if (dm_create_lockfile(s.pidfile) == 0)
+ if (dm_create_lockfile(s.pidfile) == 0) {
+ ERROR(&s, "Failed to acquire lock on %s. Already running?\n", s.pidfile);
exit(EXIT_ALREADYRUNNING);
+ }
(void) dm_prepare_selinux_context(NULL, 0);
}
9 years
master - config: thin_pool_chunk_size_policy should be commented
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c0d30da60968e2...
Commit: c0d30da60968e202d1e834dea28869a571bee991
Parent: b7db994aba358d2dc456eb8b22c6b375961e1b07
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 15 11:43:56 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 15 11:43:56 2015 -0500
config: thin_pool_chunk_size_policy should be commented
It is commented in existing example.conf, so leave
that as it was.
---
lib/config/config_settings.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 9f31f6e..cfcc72e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -491,7 +491,7 @@ cfg(allocation_thin_pool_discards_CFG, "thin_pool_discards", allocation_CFG_SECT
"The discards behaviour of thin pool volumes.\n"
"Possible options are: ignore, nopassdown, passdown.\n")
-cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY, vsn(2, 2, 101), NULL, 0, NULL,
+cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY, vsn(2, 2, 101), NULL, 0, NULL,
"The chunk size calculation policy for thin pool volumes.\n"
"Possible options are: generic, performance.\n"
"generic - If thin_pool_chunk_size is defined, use it.\n"
9 years
master - config: thin_pool_chunk_size_policy is not undefined
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7db994aba358d...
Commit: b7db994aba358d2dc456eb8b22c6b375961e1b07
Parent: 03aec36fc05c7cd78e0a5407c09e4d47b973c02f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 15 11:37:16 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 15 11:37:16 2015 -0500
config: thin_pool_chunk_size_policy is not undefined
The default policy setting does not depend on any
system/kernel values.
---
lib/config/config_settings.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index e255392..9f31f6e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -491,7 +491,7 @@ cfg(allocation_thin_pool_discards_CFG, "thin_pool_discards", allocation_CFG_SECT
"The discards behaviour of thin pool volumes.\n"
"Possible options are: ignore, nopassdown, passdown.\n")
-cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY, vsn(2, 2, 101), NULL, 0, NULL,
+cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY, vsn(2, 2, 101), NULL, 0, NULL,
"The chunk size calculation policy for thin pool volumes.\n"
"Possible options are: generic, performance.\n"
"generic - If thin_pool_chunk_size is defined, use it.\n"
9 years