mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmlockd: update method for changing clustered VG
The previous method for forcibly changing a clustered VG to a local VG involved using -cn and locking_type 0. Since those options are deprecated, replace it with the same command used for other forced lock type changes: vgchange --locktype none --lockopt force.
This commit is contained in:
parent
9b79f0244a
commit
e53cfc6a88
@ -153,6 +153,7 @@ struct cmd_context {
|
|||||||
unsigned include_shared_vgs:1; /* report/display cmds can reveal lockd VGs */
|
unsigned include_shared_vgs:1; /* report/display cmds can reveal lockd VGs */
|
||||||
unsigned include_active_foreign_vgs:1; /* cmd should process foreign VGs with active LVs */
|
unsigned include_active_foreign_vgs:1; /* cmd should process foreign VGs with active LVs */
|
||||||
unsigned vg_read_print_access_error:1; /* print access errors from vg_read */
|
unsigned vg_read_print_access_error:1; /* print access errors from vg_read */
|
||||||
|
unsigned force_access_clustered:1;
|
||||||
unsigned lockd_gl_disable:1;
|
unsigned lockd_gl_disable:1;
|
||||||
unsigned lockd_vg_disable:1;
|
unsigned lockd_vg_disable:1;
|
||||||
unsigned lockd_lv_disable:1;
|
unsigned lockd_lv_disable:1;
|
||||||
|
@ -4689,6 +4689,15 @@ int vg_flag_write_locked(struct volume_group *vg)
|
|||||||
static int _access_vg_clustered(struct cmd_context *cmd, const struct volume_group *vg)
|
static int _access_vg_clustered(struct cmd_context *cmd, const struct volume_group *vg)
|
||||||
{
|
{
|
||||||
if (vg_is_clustered(vg)) {
|
if (vg_is_clustered(vg)) {
|
||||||
|
/*
|
||||||
|
* force_access_clustered is only set when forcibly
|
||||||
|
* converting a clustered vg to lock type none.
|
||||||
|
*/
|
||||||
|
if (cmd->force_access_clustered) {
|
||||||
|
log_debug("Allowing forced access to clustered vg %s", vg->name);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!cmd->ignore_clustered_vgs)
|
if (!cmd->ignore_clustered_vgs)
|
||||||
log_error("Skipping clustered volume group %s", vg->name);
|
log_error("Skipping clustered volume group %s", vg->name);
|
||||||
else
|
else
|
||||||
|
@ -814,8 +814,8 @@ dlm), first change it to a local VG, then to the new type.
|
|||||||
|
|
||||||
All LVs must be inactive to change the lock type.
|
All LVs must be inactive to change the lock type.
|
||||||
|
|
||||||
First change the clvm VG to a local VG. Within a running clvm cluster,
|
First change the clvm/clustered VG to a local VG. Within a running clvm
|
||||||
change a clvm VG to a local VG with the command:
|
cluster, change a clustered VG to a local VG with the command:
|
||||||
|
|
||||||
vgchange -cn <vgname>
|
vgchange -cn <vgname>
|
||||||
|
|
||||||
@ -823,10 +823,7 @@ If the clvm cluster is no longer running on any nodes, then extra options
|
|||||||
can be used to forcibly make the VG local. Caution: this is only safe if
|
can be used to forcibly make the VG local. Caution: this is only safe if
|
||||||
all nodes have stopped using the VG:
|
all nodes have stopped using the VG:
|
||||||
|
|
||||||
vgchange --config 'global/locking_type=0 global/use_lvmlockd=0'
|
vgchange --lock-type none --lock-opt force <vgname>
|
||||||
.RS
|
|
||||||
-cn <vgname>
|
|
||||||
.RE
|
|
||||||
|
|
||||||
After the VG is local, follow the steps described in "changing a local VG
|
After the VG is local, follow the steps described in "changing a local VG
|
||||||
to a lockd VG".
|
to a lockd VG".
|
||||||
|
@ -1039,6 +1039,7 @@ int vgchange_locktype_cmd(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
cmd->lockd_vg_disable = 1;
|
cmd->lockd_vg_disable = 1;
|
||||||
cmd->lockd_lv_disable = 1;
|
cmd->lockd_lv_disable = 1;
|
||||||
cmd->handles_missing_pvs = 1;
|
cmd->handles_missing_pvs = 1;
|
||||||
|
cmd->force_access_clustered = 1;
|
||||||
goto process;
|
goto process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user