summaryrefslogtreecommitdiffstats
path: root/tools/vgchange.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: use proper activation_change_tZdenek Kabelac2012-08-231-1/+2
|
* activate: skip manual activation for --sysinit -aayPeter Rajnoha2012-07-101-0/+7
| | | | | | | | | | | | | When --sysinit -a ay is used with vg/lvchange and lvmetad is up and running, we should skip manual activation as that would be a useless step - all volumes are autoactivated once all the PVs for a VG are present. If lvmetad is not active at the time of the vgchange --sysinit -a ay call, the activation proceeds in standard 'manual' way. This way, we can still have vg/lvchange --sysinit -a ay called unconditionally in system initialization scripts no matter if lvmetad is used or not.
* vgchange: add --activate ay option (autoactivate)Peter Rajnoha2012-06-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | Normally, the 'vgchange -ay' activates all volume groups (that pass the activation/volume_list filter if set). This call can appear in two scenarios: - system boot (so activation within a script in general) - manual call on command line (so activaton on user's direct request) For the former one, we would like to select which VGs should be actually activated. One can define the list of VGs directly to do that. But that would require the same list to be provided in all the scripts. The 'vgchange -aay' will check for the activation/auto_activation_volume_list in adition and it will activate only those VGs/LVs that pass this filter (assuming all to be activated if the list is not defined - the same logic we already have for activation/volume_list). Init/boot scripts should use this form of activation primarily (which, anyway, becomes only a fallback now with autoactivation done on PV appearance in tandem with lvmetad in place).
* activate: add autoactivation hooksPeter Rajnoha2012-06-281-17/+14
| | | | | | | | | | | | | | | | Define an 'activation_handler' that gets called automatically on PV appearance/disappearance while processing the lvmetad_pv_found and lvmetad_pv_gone functions that are supposed to update the lvmetad state based on PV availability state. For now, the actual support is for PV appearance only, leaving room for PV disappearance support as well (which is a more complex problem to solve as this needs to count with possible device stack). Add a new activation change mode - CHANGE_AAY exposed as '--activate ay/-aay' argument ('activate automatically'). Factor out the vgchange activation functionality for use in other tools (like pvscan...).
* args: add --activate synonym for --available argPeter Rajnoha2012-06-281-13/+13
| | | | | | | | We're refererring to 'activation' all over the code and we're talking about 'LVs being activated' all the time so let's use 'activation/activate' everywhere for clarity and consistency (still providing the old 'available' keyword as a synonym for backward compatibility with existing environments).
* Update and fix monitoring of thin pool devicesZdenek Kabelac2012-03-231-7/+5
| | | | | | | | | | | | | Code adds better support for monitoring of thin pool devices. update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring. vgchange & lvchange are checking real thin pool device for existance as we are using _tpool real device and visible LV pool device might not be even active (_tpool is activated implicitely for any thin volume). monitor_dev_for_events is another _lv_postorder like code it might be worth to think about reusing it here - for now update the code to properly monitory thin volume deps. For unmonitoring add extra code to check the usage of thin pool - in case it's in use unmonitoring of thin volume is skipped.
* Using enum types for enumsZdenek Kabelac2012-02-281-3/+3
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Initialize dmeventd monitoring for every commandZdenek Kabelac2012-02-151-6/+0
| | | | | | | | | | Read lvm.conf setting for monitoring for each command. So we should not activate monitoring if the default compilation is set to monitor during lvconvert commnads. Patch also removes check for clustered VG and allows to disable monitoring for clustered VG with the assumption, the problem with monitoring and dmeventd flag passing for INGNORE is already fixed.
* Thin revert code for exclusive pool activationZdenek Kabelac2011-11-071-4/+0
| | | | | There are no limits on thin-pool activation now. Revert code that is no longer needed.
* Thin avoids need of having writable VG for activationZdenek Kabelac2011-11-031-6/+0
|
* Thin creation without activationZdenek Kabelac2011-10-301-0/+6
| | | | | | | | | All thins are created with the next activation and VG is updated without messages. Only some basic commands works. (i.e. lvcreate -an -V10 -T mvg/pool) There can be some combination to confuse this system. This functionality for snapshots is going to be interesting.
* Thin works only with exclusive activationZdenek Kabelac2011-10-281-4/+4
| | | | Enforce exclusive activation with thin targets.
* Thin pool activation changeZdenek Kabelac2011-10-281-0/+4
| | | | | | | | | | | To ensure we properly handle LV cluster locking - explicitely do not allow to change the availability of the thin pool that is in use for some thin LV. As soon as the thin volume is created the only way to activate pool is via implicit dependency. Ignore thinpool open count for lv/vgchange operations.
* Ensure thin LVs take an exclusive activationZdenek Kabelac2011-10-221-1/+4
|
* Fix vgchange activation of snapshot with virtual origin.Milan Broz2011-09-141-0/+4
|
* Support break for vgchange and vgrefresh operationZdenek Kabelac2011-09-071-0/+6
| | | | Allow to break some lengthy vgchange and vgrefresh operation.
* Major pvmove fix to issue ioctls in the correct order when multiple LVsAlasdair Kergon2011-06-111-1/+1
| | | | | | | | | | | are affected by the move. (Currently it's possible for I/O to become trapped between suspended devices amongst other problems. The current fix was selected so as to minimise the testing surface. I hope eventually to replace it with a cleaner one that extends the deptree code. Some lvconvert scenarios still suffer from related problems.
* PE size overflows, on most architectures it is catch by "PE cannot be 0"Milan Broz2011-03-021-0/+6
| | | | | | but s390x unfortunately return something usable. Always use unit64 in inital parameter check.
* Allow snapshots in a cluster as long as they are exclusivelyJonathan Earl Brassow2011-02-041-0/+10
| | | | | | | | | | | | | | | activated. In order to achieve this, we need to be able to query whether the origin is active exclusively (a condition of being able to add an exclusive snapshot). Once we are able to query the exclusive activation of an LV, we can safely create/activate the snapshot. A change to 'hold_lock' was also made so that a request to aquire a WRITE lock did not replace an EX lock, which is already a form of write lock.
* Add change_tag to toollib.Alasdair Kergon2011-01-241-25/+2
| | | | Allow multiple pvchange command line options to be specified together.
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-6/+13
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* Update VG metadata only once in vgchange when making multiple changes.Alasdair Kergon2010-10-291-275/+154
| | | | | Allow independent vgchange arguments to be used together. (Still more inconsistencies to iron out here.)
* Fix vgchange to process -a, --refresh, --monitor and --poll like lvchange.Mike Snitzer2010-10-261-9/+38
| | | | | | | Simultaneous -a and --refresh is not valid. poll+monitor are valid together with or without -ay* (but not with -an*) No longer print polling results summary if no LVs in the VG were polled.
* Don't take write lock in vgchange --refresh, --poll or --monitor.Alasdair Kergon2010-10-251-1/+4
|
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-3/+3
|
* Monitor origin -real device below snapshot instead of overlay device. (brassow)Alasdair Kergon2010-08-171-1/+1
|
* Various small cleanups and fixes related to monitoring.Alasdair Kergon2010-08-161-15/+16
|
* Remove unneeded "active" variable in vgchange_monitoring().Dave Wysochanski2010-07-261-2/+2
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-2/+2
|
* improve vgmetadatacopies unmanaged messageAlasdair Kergon2010-06-301-10/+8
|
* Fix compile warning in vgchange.c regarding mda_copies initialization.Dave Wysochanski2010-06-281-1/+1
|
* Update vgchange tool to accept --vgmetadatacopies.Dave Wysochanski2010-06-281-2/+47
| | | | | | | | | | Update logic in vgchange to handle --vgmetadatacopies, allow --metadatacopies as a synonym to --vgmetadatacopies, and add these parameters to args.h and commands.h Forbit both --vgmetadatacopies and --metadatacopies as only one allowed. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Fix typo: premitted -> permittedZdenek Kabelac2010-06-231-1/+1
| | | | Signed-off-by: Takahiro Yasui<tyasui@redhat.com>
* Replicator: update activate code for vgchangeZdenek Kabelac2010-05-241-0/+5
| | | | | | Activate only the first replicator-dev LV, that activates all other related LVs from Replicator. In case of error during this activation, it will not retry again for other heads (less confusing error log).
* Replicator: VG with cmd_missing_vgs does not generate outputZdenek Kabelac2010-05-241-2/+4
| | | | Do not print message if missing VG is found.
* Add new --sysinit option for vgchange and lvchange.Peter Rajnoha2010-05-061-5/+13
| | | | | | A shortcut for --ignorelockingfailure, --ignoremonitoring, --poll n options and LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable used all at once in initialisation scripts (e.g. rc.sysinit or initrd).
* Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.Mike Snitzer2010-03-291-1/+1
| | | | | | | | | | | | clvmd does not propagate DMEVENTD_MONITOR_IGNORE. Update get_activation_monitoring_mode() to check if the VG that the LV is being activated in is clustered. If so, skip it. Any get_activation_monitoring_mode() error will cause the associated LV (or VG) to be skipped during activation. Both vgchange_single() and lvchange_single(), which call get_activation_monitoring_mode(), are called by their respective process_each_..() method.
* Improve activation monitoring option processingMike Snitzer2010-03-231-4/+5
| | | | | | | | | | | | | . Add "monitoring" option to "activation" section of lvm.conf . Have clvmd consult the lvm.conf "activation/monitoring" too. . Introduce toollib.c:get_activation_monitoring_mode(). . Error out when both --monitor and --ignoremonitoring are provided. . Add --monitor and --ignoremonitoring support to lvcreate. Update lvcreate man page accordingly. . Clarify that '--monitor' controls the start and stop of monitoring in the {vg,lv}change man pages. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Refactor _vgchange_tag() to vg_change_tag() library function.Dave Wysochanski2010-02-241-17/+3
| | | | | | | | | Pull out common code to be called from tools as well as lvm2app. Leave archive() at tool level so we can use from vgcreate as well as vgchange. Should be no functional change. - add stack macro in vgchange Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Rename segment and lv status flag from SNAPSHOT_MERGE to MERGING.Mike Snitzer2010-01-131-4/+2
| | | | | | Eliminate 'merging_snapshot' from 'struct logical_volume' and just use 'snapshot' for origin lv's reference to the merging snapshot; also set MERGING in the origin lv's status.
* Add snapshot merge wrappers to abstract the associations and flags usedMike Snitzer2010-01-131-2/+2
| | | | to represent merging origin and snapshot volumes.
* Start background polling of merging stores on:Mike Snitzer2010-01-131-7/+8
| | | | | - lvchange -ay or vgchange -ay. - lvchange --refresh or vgchange --refresh.
* . update documentation for --poll in the vgchange and lvchange man pagesMike Snitzer2010-01-061-0/+7
| | | | . add high-level --poll FIXMEs to vgchange.c and lvchange.c
* Add missing 'stack;' for all activate_lv and deactivate_lv callers.Mike Snitzer2010-01-051-5/+15
| | | | Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Add a [--poll {y|n}] flag to vgchange and lvchange to control whetherMike Snitzer2010-01-051-4/+60
| | | | | | | | | | | | | | | | | | | | | | the background polldaemon is allowed to start. It can be used standalone or in conjunction with --refresh or --available y. Control over when the background polldaemon starts will be particularly important for snapshot-merge of a root filesystem. Dracut will be updated to activate all LVs with: --poll n The lvm2-monitor initscript will start polling with: --poll y NOTE: Because we currently have no way of knowing if a background polldaemon is active for a given LV the following limitations exist and have been deemed acceptable: 1) it is not possible to stop an active polldaemon; so the lvm2-monitor initscript doesn't stop running polldaemon(s) 2) redundant polldaemon instances will be started for all specified LVs if vgchange or lvchange are repeatedly used with '--poll y' Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Fix activated/deactivated log_verbose messageDave Wysochanski2009-12-071-2/+2
| | | | | | | | | I see "Deactivated" message when I activate and "Activated" message when I deactivate. The code uses "activate" as boolean but it can be any one of the enum values from CHANGE_AY, CHANGE_AN, CHANGE_AE, etc. Signed-off-by: Malahal Naineni <malahal@us.ibm.com> Acked-by: Dave Wysochanski <dwysocha@redhat.com>
* Return error status if vgchange fails to activate some volume.Milan Broz2009-11-241-11/+12
| | | | | | | | | | | | | | | | | (on one node a storage connection failed): # vgchange -a y vg_bar ; echo $? Error locking on node bar-02: Refusing activation of partial LV lv1. Use --partial to override. 1 logical volume(s) in volume group "vg_bar" now active 0 So activation fails on one node, error is correctly printed but status code is wrong. This patch fixes the top level (vgchange) to return proper code (and print # of activated LVs). (lvchange returns error properly here.)
* Never activate hidden volumes directly in vgchange.Milan Broz2009-11-181-0/+3
| | | | | | | | | | | | All hidden (not visible) volumes should be activated through other visible volumes. (There are already exceptions like snapshot, mirror log and image, which should be cleaned one day...) This solves problems for future types of hidden volumes, which can have special meaning and must not be activated implicitly (e.g. key store volume).
* Add vg_set_clustered() - move logic from vgchange.Dave Wysochanski2009-10-311-16/+2
| | | | | | Similar to other vg_set_* functions, we create a vg_set_clustered() function which does a few checks and sets a flag. This is where we check for any limitations of clusters.
* Just a cleanup from previous commit. We don't need pvname local var in ↵Peter Rajnoha2009-09-301-1/+0
| | | | _activate_lvs_in_vg anymore...