master - tests: use pvscan after enable_dev in process-each-duplicate-vgnames
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cbf62b9262d493a5df9...
Commit: cbf62b9262d493a5df9ab5a57e68395465d4701a
Parent: 30ad845f3d140f6778775ae5fe901b5d7e4988bc
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jan 28 11:38:05 2019 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jan 28 11:38:05 2019 -0600
tests: use pvscan after enable_dev in process-each-duplicate-vgnames
instead of vgscan, so that new dev is recognized with hints
---
test/shell/process-each-duplicate-vgnames.sh | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/test/shell/process-each-duplicate-vgnames.sh b/test/shell/process-each-duplicate-vgnames.sh
index ea79c91..a59c3bd 100644
--- a/test/shell/process-each-duplicate-vgnames.sh
+++ b/test/shell/process-each-duplicate-vgnames.sh
@@ -20,20 +20,16 @@ pvcreate "$dev2"
aux disable_dev "$dev1" "$dev2"
aux enable_dev "$dev1"
-vgscan
vgcreate $vg1 "$dev1"
UUID1=$(vgs --noheading -o vg_uuid $vg1)
aux disable_dev "$dev1"
aux enable_dev "$dev2"
-vgscan
vgcreate $vg1 "$dev2"
UUID2=$(vgs --noheading -o vg_uuid $vg1)
aux enable_dev "$dev1"
-# need vgscan after enabling/disabling devs
-# so that the next commands properly see them
-vgscan
+pvscan --cache "$dev1"
pvs "$dev1"
pvs "$dev2"
@@ -50,11 +46,10 @@ vgs -o+vg_uuid | tee err
grep $UUID1 err
not grep $UUID2 err
aux enable_dev "$dev2"
-vgscan
+pvscan --cache "$dev2"
aux disable_dev "$dev1"
vgs -o+vg_uuid | tee err
grep $UUID2 err
not grep $UUID1 err
aux enable_dev "$dev1"
-vgscan
5 years, 2 months
master - vgscan: drop 'take a while' message
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=30ad845f3d140f67787...
Commit: 30ad845f3d140f6778775ae5fe901b5d7e4988bc
Parent: 2a45ef030060a28fa152f6245828a97df04c195c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jan 28 11:22:42 2019 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jan 28 11:22:42 2019 -0600
vgscan: drop 'take a while' message
every command does this
---
tools/vgscan.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/tools/vgscan.c b/tools/vgscan.c
index 470e3d8..6138855 100644
--- a/tools/vgscan.c
+++ b/tools/vgscan.c
@@ -57,8 +57,6 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
return ECMD_PROCESSED;
}
- log_print_unless_silent("Reading all physical volumes. This may take a while...");
-
maxret = process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, &_vgscan_single);
if (arg_is_set(cmd, mknodes_ARG)) {
5 years, 2 months
master - rpm: package lvmvdo man page
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2a45ef030060a28fa15...
Commit: 2a45ef030060a28fa152f6245828a97df04c195c
Parent: 2264399b0df9a5f81449fcabca891557a2df4026
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 22 14:33:03 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 22 14:35:47 2019 +0100
rpm: package lvmvdo man page
---
spec/packages.inc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index 81ef539..196cbf6 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -148,6 +148,9 @@ fi
%{_mandir}/man8/lvmpolld.8.gz
%{_mandir}/man8/lvm-lvpoll.8.gz
%endif
+%if %{have_with vdo}
+ %{_mandir}/man7/lvmvdo.7.gz
+%endif
%if %{enable_udev}
%{_udevdir}/11-dm-lvm.rules
%{_udevdir}/69-dm-lvm-metad.rules
5 years, 3 months
master - vdo: some formating updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2264399b0df9a5f8144...
Commit: 2264399b0df9a5f81449fcabca891557a2df4026
Parent: 105a8edea1c4a77cc3681a7cc46a6a5c02656c5c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 22 14:27:55 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 22 14:35:47 2019 +0100
vdo: some formating updates
---
man/lvmvdo.7_main | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/man/lvmvdo.7_main b/man/lvmvdo.7_main
index 11ca3ac..ae507df 100644
--- a/man/lvmvdo.7_main
+++ b/man/lvmvdo.7_main
@@ -5,7 +5,6 @@ lvmvdo \(em EXPERIMENTAL LVM Virtual Data Optimizer support
.SH DESCRIPTION
-
VDO (which includes kvdo and vdo) is software that provides inline
block-level deduplication, compression, and thin provisioning capabilities
for primary storage.
@@ -179,7 +178,9 @@ EOF
Disable or enable compression and deduplication for VDO pool LV
(the volume that maintains all VDO LV(s) associated with it).
+.nf
.B lvchange --compression [y|n] --deduplication [y|n] VG/VDOPoolLV
+.fi
.I Example
.br
@@ -196,7 +197,7 @@ content of virtual data for VDOLV and how much space is already
consumed with all the data and metadata blocks in VDOPoolLV.
For a detailed description use \fBvdostats\fP(8) command.
-Note: vdostats currently understands only /dev/mapper device names.
+Note: \fBvdostats\fP(8) currently understands only /dev/mapper device names.
.I Example
.br
@@ -216,17 +217,19 @@ Note: vdostats currently understands only /dev/mapper device names.
release version : 133524
data blocks used : 79
...
-
.fi
.SS 4. Extending VDOPoolLV size
Adding more space to hold VDO data and metadata can be made via
-extension of VDODataLV.
+extension of VDODataLV with commands
+\fBlvresize\fP(8), \fBlvextend\fP(8).
Note: Size of VDOPoolLV cannot be reduced.
+.nf
.B lvextend -L+AddingSize VG/VDOPoolLV
+.fi
.I Example
.br
@@ -237,14 +240,17 @@ Note: Size of VDOPoolLV cannot be reduced.
.SS 4. Extending or reducing VDOLV size
-VDO LV can be extended or reduced as standard LV.
+VDO LV can be extended or reduced as standard LV with commands
+\fBlvresize\fP(8), \fBlvextend\fP(8), \fBlvreduce\fP(8).
Note: Reduction needs to process TRIM for reduced disk area
to unmap used data blocks from VDOPoolLV and it may take
a long time.
+.nf
.B lvextend -L+AddingSize VG/VDOLV
.B lvreduce -L-ReducingSize VG/VDOLV
+.fi
.I Example
.br
@@ -254,9 +260,7 @@ a long time.
# lvresize -L200G vg/vdo2
.fi
-
.SH VDO Topics
-
.br
\&
@@ -269,9 +273,11 @@ a long time.
.BR lvconvert (8),
.BR lvchange (8),
.BR lvextend (8),
+.BR lvreduce (8),
+.BR lvresize (8),
.BR lvremove (8),
.BR lvs (8),
.BR vdo (8),
-.BR vdoformat (8)
-.BR vdostats (8)
-
+.BR vdoformat (8),
+.BR vdostats (8),
+.BR mkfs (8)
5 years, 3 months
master - lv_manip: better work with PERCENT_VG modifier with lvresize
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=105a8edea1c4a77cc36...
Commit: 105a8edea1c4a77cc3681a7cc46a6a5c02656c5c
Parent: e689bfb5d5a9983205efbccf1e554fde52a0376a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 21 15:37:51 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 15:39:24 2019 +0100
lv_manip: better work with PERCENT_VG modifier with lvresize
Fixing recent commit 022ebb0cfebee4ac8fdbe4e0c61e85db1038a115
Resize already has size that needs to be counted with,
otherwise upsizing operation could turn into size reduction one.
---
lib/metadata/lv_manip.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8c9a933..00039ef 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5053,8 +5053,8 @@ static int _lvresize_extents_from_percent(const struct logical_volume *lv,
case PERCENT_VG:
lp->extents = percent_of_extents(lp->extents, vg->extent_count,
(lp->sign != SIGN_MINUS));
- if (lp->sign == SIGN_NONE && lp->extents > vg->free_count) {
- lp->extents = vg->free_count;
+ if ((lp->sign == SIGN_NONE) && (lp->extents > (lv->le_count + vg->free_count))) {
+ lp->extents = lv->le_count + vg->free_count;
log_print_unless_silent("Reducing %u%%VG to remaining free space %s in VG.",
old_extents,
display_size(vg->cmd, (uint64_t)vg->extent_size * lp->extents));
5 years, 3 months
master - vdo: minor API cleanup
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e689bfb5d5a9983205e...
Commit: e689bfb5d5a9983205efbccf1e554fde52a0376a
Parent: fc02343eff39b80e3b41b74475d9f2d6797062ac
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 21 00:48:05 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100
vdo: minor API cleanup
Since the parse_vdo_pool_status() become vdo_manip API part,
and there will be no 'dm' matching status parser,
the API can be simplified and closely match thin API here.
---
lib/activate/activate.c | 10 ++--------
lib/activate/dev_manager.c | 14 +++++---------
lib/activate/dev_manager.h | 5 ++---
3 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 072e84e..ddc175c 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1359,8 +1359,6 @@ int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
{
int r = 0;
struct dev_manager *dm;
- struct lv_status_vdo *status;
- char *params;
if (!lv_info(lv->vg->cmd, lv, 0, NULL, 0, 0))
return 0;
@@ -1371,14 +1369,10 @@ int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, !lv_is_pvmove(lv))))
return_0;
- if (!dev_manager_vdo_pool_status(dm, lv, flush, ¶ms, &status))
+ if (!dev_manager_vdo_pool_status(dm, lv, vdo_status, flush))
goto_out;
- if (!parse_vdo_pool_status(status->mem, lv, params, status))
- goto_out;
-
- /* User is responsible to dm_pool_destroy memory pool! */
- *vdo_status = status;
+ /* User has to call dm_pool_destroy(vdo_status->mem) */
r = 1;
out:
if (!r)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index f0c5254..dc570c7 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1792,9 +1792,8 @@ out:
int dev_manager_vdo_pool_status(struct dev_manager *dm,
const struct logical_volume *lv,
- int flush,
- char **vdo_params,
- struct lv_status_vdo **vdo_status)
+ struct lv_status_vdo **vdo_status,
+ int flush)
{
struct lv_status_vdo *status;
const char *dlid;
@@ -1805,7 +1804,6 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
char *params = NULL;
int r = 0;
- *vdo_params = NULL;
*vdo_status = NULL;
if (!(status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_vdo)))) {
@@ -1834,13 +1832,11 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
goto out;
}
- if (!(*vdo_params = dm_pool_strdup(dm->mem, params))) {
- log_error("Cannot duplicate VDO status params.");
- goto out;
- }
+ if (!parse_vdo_pool_status(dm->mem, lv, params, status))
+ goto_out;
status->mem = dm->mem;
- *vdo_status = status;
+ *vdo_status = status;
r = 1;
out:
diff --git a/lib/activate/dev_manager.h b/lib/activate/dev_manager.h
index ca8c0d3..6456991 100644
--- a/lib/activate/dev_manager.h
+++ b/lib/activate/dev_manager.h
@@ -84,9 +84,8 @@ int dev_manager_thin_device_id(struct dev_manager *dm,
uint32_t *device_id);
int dev_manager_vdo_pool_status(struct dev_manager *dm,
const struct logical_volume *lv,
- int flush,
- char **vdo_params,
- struct lv_status_vdo **vdo_status);
+ struct lv_status_vdo **vdo_status,
+ int flush);
int dev_manager_suspend(struct dev_manager *dm, const struct logical_volume *lv,
struct lv_activate_opts *laopts, int lockfs, int flush_required);
int dev_manager_activate(struct dev_manager *dm, const struct logical_volume *lv,
5 years, 3 months
master - tests: vdo dmeventd resize
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fc02343eff39b80e3b4...
Commit: fc02343eff39b80e3b41b74475d9f2d6797062ac
Parent: f3c52a515b7b40a76d7dfc64b712020f032cde1d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jan 20 16:08:53 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100
tests: vdo dmeventd resize
---
test/shell/lvextend-vdo-dmeventd.sh | 68 +++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvextend-vdo-dmeventd.sh b/test/shell/lvextend-vdo-dmeventd.sh
new file mode 100644
index 0000000..6dbe4c4
--- /dev/null
+++ b/test/shell/lvextend-vdo-dmeventd.sh
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Test autoextension of VDO pool volume
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+percent_() {
+ get lv_field $vg/vpool data_percent | cut -d. -f1
+}
+
+wait_for_change_() {
+ # dmeventd only checks every 10 seconds :(
+ for i in $(seq 1 25) ; do
+ test "$(percent_)" != "$1" && return
+ sleep 1
+ done
+
+ return 1 # timeout
+}
+
+aux have_vdo 6 2 0 || skip
+
+aux prepare_dmeventd
+
+aux lvmconf "activation/vdo_pool_autoextend_percent = 20" \
+ "activation/vdo_pool_autoextend_threshold = 70" \
+ "allocation/vdo_slab_size_mb = 128"
+
+aux prepare_vg 1 9000
+lvcreate --vdo -V2G -L4G -n $lv1 $vg/vpool
+
+pre=$(percent_)
+# Check out VDO pool is bellow 70%
+test "$pre" -lt 70
+
+# Fill space to be over 70%
+dd if=/dev/urandom of="$DM_DEV_DIR/mapper/$vg-$lv1" bs=1M count=80 conv=fdatasync
+
+# Should be now over 70%
+pre=$(percent_)
+test "$pre" -ge 70
+
+wait_for_change_ $pre
+
+pre=$(percent_)
+# Check out VDO pool gets again bellow 70%
+test "$pre" -lt 70 || die "Data percentage has not changed bellow 70%!"
+
+# 4G * 1.2 (20%) -> 4.8G
+check lv_field $vg/vpool size "4.80g"
+check lv_field $vg/$lv1 size "2.00g"
+
+lvs -a $vg
+
+vgremove -f $vg
5 years, 3 months
master - vdo: enable dmeventd resize
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f3c52a515b7b40a76d7...
Commit: f3c52a515b7b40a76d7dfc64b712020f032cde1d
Parent: 3d367f3348da072360c9dd251d981e627c8444ff
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jan 20 16:08:11 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100
vdo: enable dmeventd resize
---
daemons/dmeventd/plugins/vdo/dmeventd_vdo.c | 3 +--
lib/metadata/lv_manip.c | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c
index d5156cd..9d267eb 100644
--- a/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c
+++ b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c
@@ -255,8 +255,7 @@ void process_event(struct dm_task *dmt,
} else
state->max_fails = 1; /* Reset on success */
- /* FIXME: ATM nothing can be done, drop 0, once it becomes useful */
- if (0 && needs_policy)
+ if (needs_policy)
_use_policy(dmt, state);
out:
if (vdop.status)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 7e542fe..8c9a933 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4795,6 +4795,18 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
"minimum supported 50%%.", policy_threshold);
policy_threshold = 50;
}
+ } else if (lv_is_vdo_pool(lv)) {
+ policy_threshold =
+ find_config_tree_int(cmd, activation_vdo_pool_autoextend_threshold_CFG,
+ lv_config_profile(lv));
+ policy_amount =
+ find_config_tree_int(cmd, activation_vdo_pool_autoextend_percent_CFG,
+ lv_config_profile(lv));
+ if (policy_threshold < 50) {
+ log_warn("WARNING: VDO pool autoextend threshold %d%% is set below "
+ "minimum supported 50%%.", policy_threshold);
+ policy_threshold = 50;
+ }
} else {
policy_threshold =
find_config_tree_int(cmd, activation_snapshot_autoextend_threshold_CFG, NULL);
@@ -4833,6 +4845,9 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
if (!lv_thin_pool_percent(lv, 0, &percent))
return_0;
+ } else if (lv_is_vdo_pool(lv)) {
+ if (!lv_vdo_pool_percent(lv, &percent))
+ return_0;
} else {
if (!lv_snapshot_percent(lv, &percent))
return_0;
@@ -4916,7 +4931,10 @@ static int _lvresize_check(struct logical_volume *lv,
}
}
- if (lp->use_policies && !lv_is_cow(lv) && !lv_is_thin_pool(lv)) {
+ if (lp->use_policies &&
+ !lv_is_cow(lv) &&
+ !lv_is_thin_pool(lv) &&
+ !lv_is_vdo_pool(lv)) {
log_error("Policy-based resize is supported only for snapshot and thin pool volumes.");
return 0;
}
5 years, 3 months
master - vdo: add simple wrapper for getting pool percentage
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3d367f3348da072360c...
Commit: 3d367f3348da072360c9dd251d981e627c8444ff
Parent: cbadf3d3704f1153b2919392ab8259b9a798a221
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 21 00:24:30 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100
vdo: add simple wrapper for getting pool percentage
Just like with i.e. thins provide simple function for
getting percentage of VDO Pool usage (uses existing
status function).
---
lib/activate/activate.c | 13 +++++++++++++
lib/activate/activate.h | 1 +
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 678dec9..072e84e 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1387,6 +1387,19 @@ out:
return r;
}
+int lv_vdo_pool_percent(const struct logical_volume *lv, dm_percent_t *percent)
+{
+ struct lv_status_vdo *vdo_status;
+
+ if (!lv_vdo_pool_status(lv, 0, &vdo_status))
+ return_0;
+
+ *percent = vdo_status->usage;
+ dm_pool_destroy(vdo_status->mem);
+
+ return 1;
+}
+
static int _lv_active(struct cmd_context *cmd, const struct logical_volume *lv)
{
struct lvinfo info;
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index aa5410c..dc13f17 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -198,6 +198,7 @@ int lv_thin_pool_transaction_id(const struct logical_volume *lv,
int lv_thin_device_id(const struct logical_volume *lv, uint32_t *device_id);
int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
struct lv_status_vdo **status);
+int lv_vdo_pool_percent(const struct logical_volume *lv, dm_percent_t *percent);
/*
* Return number of LVs in the VG that are active.
5 years, 3 months
master - tests: initial test for vdo resize
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cbadf3d3704f1153b29...
Commit: cbadf3d3704f1153b2919392ab8259b9a798a221
Parent: 246b0c444bfcea68fe6c6d7174e753ee08dd7d8f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jan 20 12:38:59 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100
tests: initial test for vdo resize
---
test/shell/lvextend-vdo.sh | 34 ++++++++++++++++++++++++++++++++++
test/shell/lvresize-vdo.sh | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvextend-vdo.sh b/test/shell/lvextend-vdo.sh
new file mode 100644
index 0000000..5a68bb1
--- /dev/null
+++ b/test/shell/lvextend-vdo.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_vdo 6 2 0 || skip
+
+aux lvmconf 'allocation/vdo_slab_size_mb = 128'
+
+aux prepare_vg 1 7000
+lvcreate --vdo -V3G -L4G -n $lv1 $vg/$lv2
+
+# Resize data volume
+lvextend -L+1G $vg/$lv2
+check lv_field $vg/$lv2 size "5.00g"
+check lv_field $vg/${lv2}_vdata size "5.00g"
+
+# Resize virtual volume on top of VDO
+lvextend -L+1G $vg/$lv1
+check lv_field $vg/$lv1 size "4.00g"
+
+vgremove -ff $vg
diff --git a/test/shell/lvresize-vdo.sh b/test/shell/lvresize-vdo.sh
new file mode 100644
index 0000000..6fe0e9c
--- /dev/null
+++ b/test/shell/lvresize-vdo.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Test resize of VDO volumes
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_vdo 6 2 0 || skip
+
+aux lvmconf 'allocation/vdo_slab_size_mb = 128'
+
+aux prepare_vg 1 7000
+lvcreate --vdo -V3G -L4G -n $lv1 $vg/$lv2
+
+# Resize data volume
+lvresize -L6G $vg/$lv2
+check lv_field $vg/$lv2 size "6.00g"
+check lv_field $vg/${lv2}_vdata size "6.00g"
+
+# Resize virtual volume on top of VDO
+lvresize -L6G $vg/$lv1
+check lv_field $vg/$lv1 size "6.00g"
+
+vgremove -ff $vg
5 years, 3 months