]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agoWHATS_NEW vgconvert -M fix
David Teigland [Tue, 10 Mar 2015 14:38:43 +0000 (09:38 -0500)]
WHATS_NEW vgconvert -M fix

9 years agovgconvert: require lvmetad to not be used
David Teigland [Tue, 10 Mar 2015 14:31:54 +0000 (09:31 -0500)]
vgconvert: require lvmetad to not be used

lvmetad does not work with lvm1/format1 metadata,
and vgconvert -M converts to or from lvm1 metadata,
so disallow vgconvert -M when lvmetad is used.

9 years agolibdaemon: map error level properly
Ondrej Kozina [Tue, 10 Mar 2015 13:35:29 +0000 (14:35 +0100)]
libdaemon: map error level properly

internal daemon error log level was wrongly mapped to debug syslog
level causing most error messages were lost in non-debug mode.

9 years agoconfigure: check for sync-nand
Zdenek Kabelac [Tue, 10 Mar 2015 12:36:55 +0000 (13:36 +0100)]
configure: check for sync-nand

Check whether gcc support this flag.
Some older compilers (gcc version 4.3.2) miss it.

9 years agodisplay: fix return values
Zdenek Kabelac [Mon, 9 Mar 2015 13:16:41 +0000 (14:16 +0100)]
display: fix return values

Return 1 on success in pvdisplay_short() and lvdisplay_full()
so commands like vgdisplay are not printinig stracktraces
on successful passes.

As the results of fail/success have been internally ignored for those
calls, it had no other visible side effect - command's return value was
still 0 (success).

9 years agoformat_text: Set system id directly.
Alasdair G Kergon [Mon, 9 Mar 2015 19:33:27 +0000 (19:33 +0000)]
format_text: Set system id directly.

Rearrange _read_vg code to set the appropriate system id field directly.

9 years agosystemid: Use temp status var for LVM_WRITE_LOCKED
Alasdair G Kergon [Mon, 9 Mar 2015 19:18:14 +0000 (19:18 +0000)]
systemid: Use temp status var for LVM_WRITE_LOCKED

9 years agovgchange: Additional system ID warnings.
Alasdair G Kergon [Mon, 9 Mar 2015 19:03:11 +0000 (19:03 +0000)]
vgchange: Additional system ID warnings.

Also prompt before setting a system ID on a VG when none is set
on the host.
Put quotes round system ID in messages where it could be blank.

9 years agovgconvert: Check system ID compatibility.
Alasdair G Kergon [Mon, 9 Mar 2015 19:01:12 +0000 (19:01 +0000)]
vgconvert: Check system ID compatibility.

If system ID is set, don't switch to a format that doesn't support it.

9 years agometadata: Detect internal use of LVM_WRITE_LOCKED.
Alasdair G Kergon [Mon, 9 Mar 2015 18:56:24 +0000 (18:56 +0000)]
metadata: Detect internal use of LVM_WRITE_LOCKED.

Generate internal error if LVM_WRITE_LOCKED ever appears
in struct volume_group: it's only used in external
metadata.

9 years agocomments: Use full flag names.
Alasdair G Kergon [Mon, 9 Mar 2015 18:53:22 +0000 (18:53 +0000)]
comments: Use full flag names.

9 years agosystem_id: detect an lvm1 system id
David Teigland [Mon, 9 Mar 2015 18:27:34 +0000 (13:27 -0500)]
system_id: detect an lvm1 system id

Detect an lvm1 system id by looking at the WRITE_LOCKED flag.
Don't copy this lvm1 system id into vg->system_id so that the
restrictions associated with the new system id are not applied
to the old VG with the inherited lvm1 system id.

9 years agotests: fix systemid uname test
David Teigland [Fri, 6 Mar 2015 15:55:24 +0000 (09:55 -0600)]
tests: fix systemid uname test

The string reported by uname -n may include characters
that lvm omits from the system id (like parens, as seen
on a test machine.)  Check against the final system id
string that lvm uses.

9 years agotests: speed of many PVS in a VG
Zdenek Kabelac [Fri, 6 Mar 2015 13:29:26 +0000 (14:29 +0100)]
tests: speed of many PVS in a VG

9 years agotests: slightly more efficient vgcreate
Zdenek Kabelac [Fri, 6 Mar 2015 12:29:35 +0000 (13:29 +0100)]
tests: slightly more efficient vgcreate

With larger set of devices it's faster to directly call
vgcreate on empty set of devices then going though separate
pvcreate call first.

9 years agolib: drop unneeded vg_read call
Zdenek Kabelac [Fri, 6 Mar 2015 09:22:33 +0000 (10:22 +0100)]
lib: drop unneeded vg_read call

Since we take a lock inside vg_lock_newname() and we do a full
detection of presence of  vgname inside all scanned labels,
there is no point to do this for second time to be sure
there is no such vg.

The only side-effect of such call would be a full validation of
some already exising VG metadata - but that's not the task for
vgcreate when create a new VG.

This call noticable reduces number of scans during 'vgcreate'.

9 years agolib: reduce parsing in vgname_from_mda
Zdenek Kabelac [Fri, 6 Mar 2015 09:24:26 +0000 (10:24 +0100)]
lib: reduce parsing in vgname_from_mda

Use similar logic as with text_vg_import_fd() and avoid repeated
parsing of same mda and its config tree for vgname_from_mda().

Remember last parsed vgname, vgid and creation_host in labeller
structure and if the  metadata have the same size and checksum,
return this stored info.

TODO: The reuse of labeller struct is not ideal, some lvmcache API for
this functionality would be nicer.

9 years agolib: avoid reparsing same metadata
Zdenek Kabelac [Mon, 26 Mar 2012 11:35:26 +0000 (13:35 +0200)]
lib: avoid reparsing same metadata

When reading VG mda from multiple PVs - do all the validation only
when mda is seen for the first time and  when mda checksum and length
is same just return already existing VG pointer.

(i.e. using 300PVs for a VG would lead to create and destroy 300 config trees....)

9 years agocleanup: add stack trace
Zdenek Kabelac [Fri, 6 Mar 2015 10:12:16 +0000 (11:12 +0100)]
cleanup: add stack trace

Missed stack in error path.

9 years agolib: return value
Zdenek Kabelac [Fri, 6 Mar 2015 08:04:31 +0000 (09:04 +0100)]
lib: return value

Drop label out: with goto and return NULL directly.
Add log_debug() for zero metadata offset.

9 years agolib: zero returned labeller struct
Zdenek Kabelac [Fri, 6 Mar 2015 07:42:20 +0000 (08:42 +0100)]
lib: zero returned labeller struct

Return zeroed struct.
(Structure will be extended, so ensure all members are initilized.)

9 years agodevices: avoid extra open() syscall
Zdenek Kabelac [Tue, 3 Mar 2015 14:37:17 +0000 (15:37 +0100)]
devices: avoid extra open() syscall

If the device is already opened by lvm's device cache,
avoid extra syscall opening devices for obtaining its size.

9 years agoman: add info to lvmsystemid
David Teigland [Thu, 5 Mar 2015 18:12:42 +0000 (12:12 -0600)]
man: add info to lvmsystemid

about losing access to a VG if lvm is downgraded
to an earlier version.

9 years agosystem_id: avoid munging vg and lv fields
David Teigland [Thu, 5 Mar 2015 16:23:16 +0000 (10:23 -0600)]
system_id: avoid munging vg and lv fields

Munge the WRITE/WRITE_LOCKED flags in a temp variable
instead of in the vg/lv fields.

9 years agosystem_id: undo the previous changes to the lvm1 code
David Teigland [Thu, 5 Mar 2015 16:13:05 +0000 (10:13 -0600)]
system_id: undo the previous changes to the lvm1 code

The system_id and lock_type compat changes do not apply
to the lvm1 code.

9 years agosystem_id: make new VGs read-only for old lvm versions
David Teigland [Wed, 4 Mar 2015 17:30:53 +0000 (11:30 -0600)]
system_id: make new VGs read-only for old lvm versions

Previous versions of lvm will not obey the restrictions
imposed by the new system_id, and would allow such a VG
to be written.  So, a VG with a new system_id is further
changed to force previous lvm versions to treat it as
read-only.  This is done by removing the WRITE flag from
the metadata status line of these VGs, and putting a new
WRITE_LOCKED flag in the flags line of the metadata.

Versions of lvm that recognize WRITE_LOCKED, also obey the
new system_id.  For these lvm versions, WRITE_LOCKED is
identical to WRITE, and the rules associated with matching
system_id's are imposed.

A new VG lock_type field is also added that causes the same
WRITE/WRITE_LOCKED transformation when set.  A previous
version of lvm will also see a VG with lock_type as read-only.

Versions of lvm that recognize WRITE_LOCKED, must also obey
the lock_type setting.  Until the lock_type feature is added,
lvm will fail to read any VG with lock_type set and report an
error about an unsupported lock_type.  Once the lock_type
feature is added, lvm will allow VGs with lock_type to be
used according to the rules imposed by the lock_type.

When both system_id and lock_type settings are removed, a VG
is written with the old WRITE status flag, and without the
new WRITE_LOCKED flag.  This allows old versions of lvm to
use the VG as before.

9 years agoRevert "systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag."
David Teigland [Wed, 4 Mar 2015 17:11:10 +0000 (11:11 -0600)]
Revert "systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag."

This reverts commit bfbb5d269aa1ed56d9308117b57d4d2da49d53f6.

This will be done differently.

9 years agosystem_id: enable the options in config file and command line
David Teigland [Wed, 4 Mar 2015 17:15:45 +0000 (11:15 -0600)]
system_id: enable the options in config file and command line

9 years agoreport: fix seg_monitor field to display monitoring status for thick snapshots and...
Peter Rajnoha [Thu, 5 Mar 2015 09:45:29 +0000 (10:45 +0100)]
report: fix seg_monitor field to display monitoring status for thick snapshots and mirrors

The seg_monitor did not display monitored status for thick snapshots
and mirrors (with mirror log *not* mirrored). The seg monitor did work
correctly even before for other segtypes - thins and raids.

Before (mirrors and snapshots, only mirrors with mirrored log properly displayed monitoring status):

[0] f21/~ # lvs -a -o lv_name,lv_layout,lv_role,seg_monitor vg
  LV                                     Layout     Role                             Monitor
  mirror                                 mirror     public
  [mirror_mimage_0]                      linear     private,mirror,image
  [mirror_mimage_1]                      linear     private,mirror,image
  [mirror_mlog]                          linear     private,mirror,log

  mirror_with_mirror_log                 mirror     public                           monitored
  [mirror_with_mirror_log_mimage_0]      linear     private,mirror,image
  [mirror_with_mirror_log_mimage_1]      linear     private,mirror,image
  [mirror_with_mirror_log_mlog]          mirror     private,mirror,log               monitored
  [mirror_with_mirror_log_mlog_mimage_0] linear     private,mirror,image
  [mirror_with_mirror_log_mlog_mimage_1] linear     private,mirror,image

  thick_origin                           linear     public,origin,thickorigin
  thick_snapshot                         linear     public,snapshot,thicksnapshot

With this patch applied (monitoring status displayed for all mirrors and snapshots):

[0] f21/~ # lvs -a -o lv_name,lv_layout,lv_role,seg_monitor vg
  LV                                     Layout     Role                             Monitor
  mirror                                 mirror     public                           monitored
  [mirror_mimage_0]                      linear     private,mirror,image
  [mirror_mimage_1]                      linear     private,mirror,image
  [mirror_mlog]                          linear     private,mirror,log

  mirror_with_mirror_log                 mirror     public                           monitored
  [mirror_with_mirror_log_mimage_0]      linear     private,mirror,image
  [mirror_with_mirror_log_mimage_1]      linear     private,mirror,image
  [mirror_with_mirror_log_mlog]          mirror     private,mirror,log               monitored
  [mirror_with_mirror_log_mlog_mimage_0] linear     private,mirror,image
  [mirror_with_mirror_log_mlog_mimage_1] linear     private,mirror,image

  thick_origin                           linear     public,origin,thickorigin
  thick_snapshot                         linear     public,snapshot,thicksnapshot    monitored

9 years agopost-release
Alasdair G Kergon [Wed, 4 Mar 2015 14:00:46 +0000 (14:00 +0000)]
post-release

9 years agopre-release v2_02_117
Alasdair G Kergon [Wed, 4 Mar 2015 13:49:51 +0000 (13:49 +0000)]
pre-release

9 years agocleanup: tools: "or use -S for selection" --> "or use --select for selection"
Peter Rajnoha [Wed, 4 Mar 2015 13:40:04 +0000 (14:40 +0100)]
cleanup: tools: "or use -S for selection" --> "or use --select for selection"

9 years agosystemid: Disable --systemid.
Alasdair G Kergon [Wed, 4 Mar 2015 13:14:51 +0000 (13:14 +0000)]
systemid: Disable --systemid.

Disable use of --systemid for this release.

9 years agoconfig: add CFG_DISABLED flag and mark system_id settings with that flag
Peter Rajnoha [Wed, 4 Mar 2015 13:08:47 +0000 (14:08 +0100)]
config: add CFG_DISABLED flag and mark system_id settings with that flag

If configuration setting is marked in config_setting.h with CFG_DISABLED
flag, default value is always used for such setting, no matter if it's defined
by user (in --config/lvm.conf/lvmlocal.conf).

A warning message is displayed if this happens:

For example:

[1] f21/~ # lvm dumpconfig --validate
  WARNING: Configuration setting global/system_id_source is disabled. Using default value.
  LVM configuration valid.

[1] f21/~ # pvs
  WARNING: Configuration setting global/system_id_source is disabled. Using default value.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sdb          lvm2 ---  128.00m 128.00m
  ...

9 years agovgremove: select: direct selection to be done per-VG, not per-LV
Peter Rajnoha [Wed, 4 Mar 2015 09:44:31 +0000 (10:44 +0100)]
vgremove: select: direct selection to be done per-VG, not per-LV

Though vgremove operates per VG by definition, internally, it
actually means iterating over each LV it contains to do the
remove.

So we need to direct selection a bit in this case so that the
selection is done per-VG, not per-LV.

That means, use processing handle with void_handle.internal_report_for_select=0
for the process_each_lv_in_vg that is called later in vgremove_single fn.
We need to disable internal selection for process_each_lv_in_vg
here as selection is already done by process_each_vg which calls
vgremove_single. Otherwise selection would be done per-LV and not
per-VG as we intend!

An intra-release fix for commit 00744b053f395be79ab1cb80fdf7342548aa79e2.

9 years agosystemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag.
Alasdair G Kergon [Wed, 4 Mar 2015 01:16:32 +0000 (01:16 +0000)]
systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag.

Set ACCESS_NEEDS_SYSTEM_ID VG status flag whenever there is
a non-lvm1 system_id set.  Prevents concurrent access from
older LVM2 versions.
Not set on VGs that bear a system_id only due to conversion
from lvm1 metadata.

9 years agosystemid: Init and merge lvm2 and lvm1 fields.
Alasdair G Kergon [Wed, 4 Mar 2015 01:00:51 +0000 (01:00 +0000)]
systemid: Init and merge lvm2 and lvm1 fields.

Use system_id field in preference to lvm1_system_id.
Initialise both for now.

9 years agovgchange: Prevent lvm1 system ID changes.
Alasdair G Kergon [Wed, 4 Mar 2015 00:50:54 +0000 (00:50 +0000)]
vgchange: Prevent lvm1 system ID changes.

(This system_id setting code shouldn't be in two places.)

9 years agoformat1: Export generate_lvm1_system_id.
Alasdair G Kergon [Wed, 4 Mar 2015 00:44:15 +0000 (00:44 +0000)]
format1: Export generate_lvm1_system_id.

Export _lvm1_system_id as generate_lvm1_system_id and call it in
vg_setup() so it is set before writing the metadata to disk
and not missing from the initial metadata backup file.

9 years agoarchives: Preserve format type in file.
Alasdair G Kergon [Wed, 4 Mar 2015 00:30:26 +0000 (00:30 +0000)]
archives: Preserve format type in file.

format_text processes both lvm2 on-disk metadata and metadata read
from other sources such as backup files.  Add original_fmt field
to retain the format type of the original metadata.
Before this patch, /etc/lvm/archives would contain backups of
lvm1 metadata with format = "lvm2" unless the source was lvm1 on-disk
metadata.

9 years agolvchange, vgchange: fix the system_id check
David Teigland [Tue, 3 Mar 2015 22:45:16 +0000 (16:45 -0600)]
lvchange, vgchange: fix the system_id check

The check for matching system_id needs to check
that the system_id is not blank.

9 years agovgchange: deactivate LVs in foreign VG
David Teigland [Tue, 3 Mar 2015 19:23:13 +0000 (13:23 -0600)]
vgchange: deactivate LVs in foreign VG

Apply the same logic as lvchange, which allows
deactivating LVs in a foreign VG.

9 years agospec: Add lvmlocal.conf to RPMs.
Petr Rockai [Tue, 3 Mar 2015 14:45:47 +0000 (15:45 +0100)]
spec: Add lvmlocal.conf to RPMs.

9 years agometadata: vg: alloc lvm1_system_id in alloc_vg sooner
Peter Rajnoha [Mon, 2 Mar 2015 12:00:37 +0000 (13:00 +0100)]
metadata: vg: alloc lvm1_system_id in alloc_vg sooner

9 years agometadata: vg: add missing vg->lvm1_system_id initialization
Peter Rajnoha [Mon, 2 Mar 2015 11:16:55 +0000 (12:16 +0100)]
metadata: vg: add missing vg->lvm1_system_id initialization

The vg->lvm1_systemd_id needs to be initialized as all the code around
counts with that. Just like we initialize lvm1_system_id in vg_create
(no matter if it's actually LVM1 or LVM2 format), this patch adds this
init in alloc_vg as well so the rest of the code does not segfaul
 when trying to access vg->lvm1_system_id.

9 years agoreport: check value of args_are_pvs, not the pointer (fix for commit 9ea77b7)
Peter Rajnoha [Mon, 2 Mar 2015 09:36:32 +0000 (10:36 +0100)]
report: check value of args_are_pvs, not the pointer (fix for commit 9ea77b7)

9 years agosystem_id: apply consistent naming
David Teigland [Fri, 27 Feb 2015 19:32:00 +0000 (13:32 -0600)]
system_id: apply consistent naming

In log messages refer to it as system ID (not System ID).

Do not put quotes around the system_id string when printing.

On the command line use systemid.

In code, metadata, and config files use system_id.

In lvmsystemid refer to the concept/entity as system_id.

9 years agoinitscripts: lvm2-monitor: use @DMEVENTD_PIDFILE@ instead of hardcoded /var/run/dmeve...
Peter Rajnoha [Fri, 27 Feb 2015 14:48:10 +0000 (15:48 +0100)]
initscripts: lvm2-monitor: use @DMEVENTD_PIDFILE@ instead of hardcoded /var/run/dmeventd.pid

9 years agoinitscripts: lvm2-monitor: implement status action
Jose Castillo [Fri, 27 Feb 2015 14:38:34 +0000 (15:38 +0100)]
initscripts: lvm2-monitor: implement status action

Two new functions added in the init script: rh_status and rh_status_q.
First one to be used in status() and second one to be used in start(),
stop(), force_stop(). Check for 'dmeventd' added and print list of
lvs being monitored in status().

9 years agocleanup: change check order in condition in _check_pv_list fn
Peter Rajnoha [Fri, 27 Feb 2015 13:52:31 +0000 (14:52 +0100)]
cleanup: change check order in condition in _check_pv_list fn

"!dev_cache_get(argv[i], cmd->full_filter) && !rescan_done" --> "!rescan_done && !dev_cache_get(argv[i], cmd->full_filter)

Check the simple condition first (variable), then the function return value
(which in this case certainly takes more time to evaluate) - save some time.

9 years agolvchange: Allow -pr to change kernel only.
Alasdair G Kergon [Fri, 27 Feb 2015 13:38:26 +0000 (13:38 +0000)]
lvchange: Allow -pr to change kernel only.

9 years agoreport: one more comment explaining change of report type when tags are used for...
Peter Rajnoha [Fri, 27 Feb 2015 12:48:47 +0000 (13:48 +0100)]
report: one more comment explaining change of report type when tags are used for original LABEL reporting

9 years agoreport: fix handling of reports with pure label fields
Peter Rajnoha [Fri, 27 Feb 2015 12:32:52 +0000 (13:32 +0100)]
report: fix handling of reports with pure label fields

Two problems fixed by this patch:
  - PV tags were not recognized at all when using them with pvs
    report that has only label fields (regression since 2.02.105)
  - incorrect persistent .cache file to be generated after pvs
    report that has only label fields (regression since 2.02.106)

These bugs come from the transition from process_each_pv to
process_each_label introduced by commit
67a7b7a87da65b2350f975272e581be5f41976e0 and commit
490226fc475232e0b158cf9fdc8670a663da4efe and related.

9 years agoconf: be more clear about wipe_signatures_when_zeroing_new_lvs option in comments
Peter Rajnoha [Fri, 27 Feb 2015 07:53:15 +0000 (08:53 +0100)]
conf: be more clear about wipe_signatures_when_zeroing_new_lvs option in comments

9 years agosystem_id: remove unwanted foreign error for some commands
David Teigland [Thu, 26 Feb 2015 22:06:32 +0000 (16:06 -0600)]
system_id: remove unwanted foreign error for some commands

Commands that can never use foreign VGs begin with
cmd->error_foreign_vgs = 1.  This tells the vg_read
lib layer to print an error as soon as a foreign VG
is read.

The toollib process_each layer also prints an error if a
foreign VG is read, but is more selective about it.  It
won't print an error if the command did not explicitly
name the foreign VG.  We want to silently ignore foreign VGs
unless a command attempts to use one explicitly.

So, foreign VG errors are printed from two different layers:
vg_read (lower layer) and process_each (upper layer).

Commands that use toollib process_each, only want errors from
the process_each layer, not from both layers.  So, process_each
disables the lower layer vg_read error message by setting
error_foreign_vgs = 0.

Commands that do not use toollib process_each, want errors
from the vg_read layer, otherwise they would get no error
message.  The original cmd->error_foreign_vgs setting
enables this error.

(Commands that are allowed to operate on foreign VGs always
begin with cmd->error_foreign_vgs = 0, and all the commands
in this group use toollib process_each with the selective
error reporting.)

9 years agomirror: Explicit cast in region_size_max
Alasdair G Kergon [Thu, 26 Feb 2015 19:49:25 +0000 (19:49 +0000)]
mirror: Explicit cast in region_size_max

9 years agomirror: Avoid region size compiler warning.
Alasdair G Kergon [Thu, 26 Feb 2015 19:45:55 +0000 (19:45 +0000)]
mirror: Avoid region size compiler warning.

format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘uint64_t’

9 years agotests: more system_id tests
David Teigland [Thu, 26 Feb 2015 19:22:47 +0000 (13:22 -0600)]
tests: more system_id tests

9 years agolvchange: Allow -prw to change kernel only.
Alasdair G Kergon [Thu, 26 Feb 2015 18:38:26 +0000 (18:38 +0000)]
lvchange: Allow -prw to change kernel only.

If an LV is already rw but still ro in the kernel, allow -prw to issue a
refresh to try to change the kernel state to rw.

Intended for use after clearing activation/read_only_volume_list in
lvm.conf.

9 years agoman: lvmsystemid: empty string equals no system_id
David Teigland [Wed, 25 Feb 2015 22:55:56 +0000 (16:55 -0600)]
man: lvmsystemid: empty string equals no system_id

9 years agotests: add more system_id tests
David Teigland [Wed, 25 Feb 2015 22:13:28 +0000 (16:13 -0600)]
tests: add more system_id tests

9 years agopvscan, vgscan: include foreign vgs with --cache
David Teigland [Wed, 25 Feb 2015 21:41:15 +0000 (15:41 -0600)]
pvscan, vgscan: include foreign vgs with --cache

pvscan --cache and vgscan --cache scan devices to refresh lvmetad,
and they should also refresh the lvmetad copy of foreign vgs.

9 years agoWHATS_NEW: vgimport with lvmetad
David Teigland [Wed, 25 Feb 2015 18:30:00 +0000 (12:30 -0600)]
WHATS_NEW: vgimport with lvmetad

9 years agotests: fix the system_id tests
David Teigland [Wed, 25 Feb 2015 18:27:49 +0000 (12:27 -0600)]
tests: fix the system_id tests

That were broken by yesterday's system_id changes.

9 years agotests: add more systemid tests
David Teigland [Wed, 25 Feb 2015 18:23:34 +0000 (12:23 -0600)]
tests: add more systemid tests

9 years agolvchange: deactivate is always possible in foreign vgs
David Teigland [Wed, 25 Feb 2015 17:33:11 +0000 (11:33 -0600)]
lvchange: deactivate is always possible in foreign vgs

The only realistic way for a host to have active LVs in a
foreign VG is if the host's system_id (or system_id_source)
is changed while LVs are active.

In this case, the active LVs produce an warning, and access
to the VG is implicitly allowed (without requiring --foreign.)
This allows the active LVs to be deactivated.

In this case, rescanning PVs for the VG offers no benefit.
It is not possible that rescanning would reveal an LV that
is active but wasn't previously in the VG metadata.

9 years agocmirror: Adjust region size to work around CPG msg limit to avoid hang.
Jonathan Brassow [Wed, 25 Feb 2015 20:42:15 +0000 (14:42 -0600)]
cmirror: Adjust region size to work around CPG msg limit to avoid hang.

cmirror uses the CPG library to pass messages around the cluster and maintain
its bitmaps.  When a cluster mirror starts-up, it must send the current state
to any joining members - a checkpoint.  When mirrors are large (or the region
size is small), the bitmap size can exceed the message limit of the CPG
library.  When this happens, the CPG library returns CPG_ERR_TRY_AGAIN.
(This is also a bug in CPG, since the message will never be successfully sent.)

There is an outstanding bug (bug 682771) that is meant to lift this message
length restriction in CPG, but for now we work around the issue by increasing
the mirror region size.  This limits the size of the bitmap and avoids any
issues we would otherwise have around checkpointing.

Since this issue only affects cluster mirrors, the region size adjustments
are only made on cluster mirrors.  This patch handles cluster mirror issues
involving pvmove, lvconvert (from linear to mirror), and lvcreate.  It also
ensures that when users convert a VG from single-machine to clustered, any
mirrors with too many regions (i.e. a bitmap that would be too large to
properly checkpoint) are trapped.

9 years agolvcreate.8: Mention --cachepolicy and --cachesettings.
Petr Rockai [Wed, 25 Feb 2015 17:34:01 +0000 (18:34 +0100)]
lvcreate.8: Mention --cachepolicy and --cachesettings.

9 years agolvmcache.7: add a section on --cachepolicy/--cachesettings
Petr Rockai [Wed, 25 Feb 2015 17:20:06 +0000 (18:20 +0100)]
lvmcache.7: add a section on --cachepolicy/--cachesettings

9 years agovgcfgbackup: enable foreign VG access
David Teigland [Wed, 25 Feb 2015 17:01:37 +0000 (11:01 -0600)]
vgcfgbackup: enable foreign VG access

Backup of a foreign VG is allowed.

9 years agosystemid: silently ignore foreign vgs unless named
David Teigland [Wed, 25 Feb 2015 16:44:42 +0000 (10:44 -0600)]
systemid: silently ignore foreign vgs unless named

A foreign VG should be silently ignored by a reporting/display
command like 'vgs'.  If the reporting/display command specifies
a foreign VG by name on the command line, it should produce an
error message.

Scanning commands pvscan/vgscan/lvscan are always allowed to
read and update caches from all PVs, including those that belong
to foreign VGs.

Other non-report/display/scan commands always ignore a foreign
VG, or report an error if they attempt to use a foreign VG.

vgimport should always invalidate the lvmetad cache because
lvmetad likely holds a pre-vgexported copy of the VG.
(This is unrelated to using foreign VGs; the pre-vgexported
VG may have had no system_id at all.)

9 years agotoolcontext: Fix lvmlocal.conf load fail path.
Alasdair G Kergon [Wed, 25 Feb 2015 16:36:47 +0000 (16:36 +0000)]
toolcontext: Fix lvmlocal.conf load fail path.

9 years agoexample.conf: Update systemid comments.
Alasdair G Kergon [Wed, 25 Feb 2015 14:22:24 +0000 (14:22 +0000)]
example.conf: Update systemid comments.

Avoid using 'cluster' (ambiguous).
Add holding ref for machine-id source.

9 years agosystemid: Improve concurrent warning.
Alasdair G Kergon [Wed, 25 Feb 2015 14:17:35 +0000 (14:17 +0000)]
systemid: Improve concurrent warning.

9 years agosystemid: Allow empty systemid with warnings.
Alasdair G Kergon [Wed, 25 Feb 2015 14:12:24 +0000 (14:12 +0000)]
systemid: Allow empty systemid with warnings.

Add warning messages when empty system ID is set.

9 years agocache: Fix a segfault when passing --cachepolicy without --cachesettings.
Petr Rockai [Tue, 24 Feb 2015 10:36:30 +0000 (11:36 +0100)]
cache: Fix a segfault when passing --cachepolicy without --cachesettings.

9 years agosystemid: Extend --foreign to reporting commands.
Alasdair G Kergon [Mon, 23 Feb 2015 23:41:38 +0000 (23:41 +0000)]
systemid: Extend --foreign to reporting commands.

Add --foreign to the remaining reporting and display commands plus
vgcfgbackup.
Add a NEEDS_FOREIGN_VGS flag for vgimport to always set --foreign.
If lvmetad is being used with --foreign, scan foreign VGs (currently
implemented as a full PV scan).
Handle these things centrally in lvmcmdline.c.
Also allow lvchange and vgchange -an/-aln to deactivate any foreign
LVs that happen to be active if something went wrong.
Remember to set the system ID when creating a new VG in vgsplit.

9 years agosystemid: Fix access restrictions.
Alasdair G Kergon [Mon, 23 Feb 2015 23:19:36 +0000 (23:19 +0000)]
systemid: Fix access restrictions.

When checking whether the system ID permits access to a VG, check for
each permitted situation first, and only then issue the appropriate
error message.  Always issue a message for now.  (We'll try to
suppress some of those later when the VG concerned wasn't explicitly
requested.)
Add more messages to try to ensure every return code is checked and
every error path (and only an error path) contains a log_error().
Add self-correction to vgchange -c to deal with situations where
the cluster state and system ID state are out-of-sync (e.g. if
old tools were used).

9 years agolvm1: Reenable sys ID.
Alasdair G Kergon [Mon, 23 Feb 2015 23:03:52 +0000 (23:03 +0000)]
lvm1: Reenable sys ID.

Move the lvm1 sys ID into vg->lvm1_system_id and reenable the #if 0
LVM1 code.  Still display the new-style system ID in the same
reporting field, though, as only one can be set.
Add a format feature flag FMT_SYSTEM_ON_PVS for LVM1 and disallow
access to LVM1 VGs if a new-style system ID has been set.
Treat the new vg->system_id as const.

9 years agoconfig: Rename allow_system_id to extra_system_ids.
Alasdair G Kergon [Mon, 23 Feb 2015 22:19:08 +0000 (22:19 +0000)]
config: Rename allow_system_id to extra_system_ids.

Add warnings to the config file templates and briefly document
each value.
Configure lvmlocal.conf and install in /etc/lvm.

9 years agoconfig: Adjust system_id defaults.
Alasdair G Kergon [Mon, 23 Feb 2015 21:20:51 +0000 (21:20 +0000)]
config: Adjust system_id defaults.

Allow cmd->unknown_system_id to be cleared during toolcontext
refresh.
Set a default value of "none" for global/system_id_source.
Allow local/system_id to be empty so it's not impossible for
a later config file to remove it.

9 years agosystemid: Define file content more precisely.
Alasdair G Kergon [Mon, 23 Feb 2015 20:49:15 +0000 (20:49 +0000)]
systemid: Define file content more precisely.

In a file containing a system ID:
  Any whitespace at the start of a line is ignored;
  Blank lines are ignored;
  Any characters after a # are ignored along with the #.
  The system ID is obtained by processing the first line with
non-ignored characters.
  If further lines with non-ignored characters follow, a warning is
issued.

9 years agosystemid: Add warnings if invalid.
Alasdair G Kergon [Mon, 23 Feb 2015 20:36:27 +0000 (20:36 +0000)]
systemid: Add warnings if invalid.

Add WARNING messages if there are problems setting the requested
system ID.
Ban "localhost" as a prefix regardless of the system_id_source.
Use cmd->hostname instead of calling uname again.
Make system_id_source values case-insensitive (as with new settings like
log_debug_classes) and also accept machine-id to match the filename.

9 years agotoolcontext: Include system_id in refresh.
Alasdair G Kergon [Mon, 23 Feb 2015 20:21:00 +0000 (20:21 +0000)]
toolcontext: Include system_id in refresh.

Move _init_system_id() into _process_config() so it's also called when
refreshing the toolcontext.  Add WARNING to log_warn messages.

9 years agotoolcontext: Move lvmlocal.conf loading.
Alasdair G Kergon [Mon, 23 Feb 2015 20:11:00 +0000 (20:11 +0000)]
toolcontext: Move lvmlocal.conf loading.

Load lvmlocal.conf after basic initialisation from lvm.conf.

9 years agosystemid: Require alphanumeric 1st character.
Alasdair G Kergon [Mon, 23 Feb 2015 19:47:03 +0000 (19:47 +0000)]
systemid: Require alphanumeric 1st character.

Require system ID to begin with an alphanumeric character.
Rename fn to make clear it's only validation for systemid
and always terminate result rather than imposing this on the caller.

9 years agoformat_text: Fix creation_host_system_id.
Alasdair G Kergon [Mon, 23 Feb 2015 19:19:48 +0000 (19:19 +0000)]
format_text: Fix creation_host_system_id.

Don't escape quotes - forbidden characters.

9 years agoformat_text: Store creation_host_system_id.
Alasdair G Kergon [Mon, 23 Feb 2015 17:54:47 +0000 (17:54 +0000)]
format_text: Store creation_host_system_id.

Record the current system ID at the time of writing out VG metadata
in the outer section of it alongside the hostname and time.

9 years agoconfig: Reinstate recursive tags setting.
Alasdair G Kergon [Mon, 23 Feb 2015 17:40:58 +0000 (17:40 +0000)]
config: Reinstate recursive tags setting.

In 2.02.99, _init_tags() inadvertently began to ignore the
dm_config_tree struct passed to it.  "tags" sections are not
merged together, so the "tags" section in the main config file was
being processed repeatedly and other "tags" sections were ignored.

9 years agosystemid: Add built-in systemid command.
Alasdair G Kergon [Mon, 23 Feb 2015 17:26:50 +0000 (17:26 +0000)]
systemid: Add built-in systemid command.

Make it easy to find the system ID when testing.
Also show in general debug output.

9 years agolvm-string: Fix HYPEN typo.
Alasdair G Kergon [Mon, 23 Feb 2015 17:09:35 +0000 (17:09 +0000)]
lvm-string: Fix HYPEN typo.

9 years agolvmetad: Add fn to scan only foreign VGs.
Alasdair G Kergon [Mon, 23 Feb 2015 17:03:03 +0000 (17:03 +0000)]
lvmetad: Add fn to scan only foreign VGs.

Not implemented yet - just a wrapper.

9 years agoman lvmsystemid: update changing the system_id
David Teigland [Fri, 20 Feb 2015 22:55:27 +0000 (16:55 -0600)]
man lvmsystemid: update changing the system_id

9 years agoman lvm: document --foreign option
David Teigland [Fri, 20 Feb 2015 22:26:04 +0000 (16:26 -0600)]
man lvm: document --foreign option

9 years agovgchange, vgcreate: add systemid option to command help
David Teigland [Fri, 20 Feb 2015 21:31:17 +0000 (15:31 -0600)]
vgchange, vgcreate: add systemid option to command help

9 years agoman: systemid option for vgcreate and vgchange
David Teigland [Fri, 20 Feb 2015 20:58:01 +0000 (14:58 -0600)]
man: systemid option for vgcreate and vgchange

9 years agotests: skip system_id machineid case when not available
David Teigland [Fri, 20 Feb 2015 19:12:38 +0000 (13:12 -0600)]
tests: skip system_id machineid case when not available

instead of creating a fake /etc/machine-id file on the
system to test with.

9 years agoman lvmsystemid: expanded limitations and warnings
David Teigland [Fri, 20 Feb 2015 18:21:23 +0000 (12:21 -0600)]
man lvmsystemid: expanded limitations and warnings

9 years agoreport: fix foreign reporting without lvmetad
David Teigland [Thu, 19 Feb 2015 21:24:31 +0000 (15:24 -0600)]
report: fix foreign reporting without lvmetad

9 years agotests: add system_id test
David Teigland [Thu, 19 Feb 2015 20:08:51 +0000 (14:08 -0600)]
tests: add system_id test

This page took 0.066002 seconds and 5 git commands to generate.