master - dm: migration_threshold for old linked tools
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=74ae1c5bc1150005ae6...
Commit: 74ae1c5bc1150005ae6e82c90415c433f4a24cbd
Parent: 30a3dda9d60ad0d53c1cff361bdd7af540790d5c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jan 20 11:45:27 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:52:16 2019 +0100
dm: migration_threshold for old linked tools
Just like with precending lvm2 device_mapper patch, ensure
that old users of libdm will also get fixed migration threshold
for caches.
---
WHATS_NEW_DM | 1 +
libdm/libdm-deptree.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3d45bc3..7c8b853 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.155 -
====================================
+ Ensure migration_threshold for cache is at least 8 chunks.
Include correct internal header inside libdm list.c.
Enhance ioctl flattening and add parameters only when needed.
Add DM_DEVICE_ARM_POLL for API completness matching kernel.
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 3f95a0d..ee12da2 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -192,6 +192,7 @@ struct load_segment {
uint64_t transaction_id; /* Thin_pool */
uint64_t low_water_mark; /* Thin_pool */
uint32_t data_block_size; /* Thin_pool + cache */
+ uint32_t migration_threshold; /* Cache */
unsigned skip_block_zeroing; /* Thin_pool */
unsigned ignore_discard; /* Thin_pool target vsn 1.1 */
unsigned no_discard_passdown; /* Thin_pool target vsn 1.1 */
@@ -2462,10 +2463,14 @@ static int _cache_emit_segment_line(struct dm_task *dmt,
EMIT_PARAMS(pos, " %s", name);
- EMIT_PARAMS(pos, " %u", seg->policy_argc * 2);
+ /* Do not pass migration_threshold 2048 which is default */
+ EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
+ if (seg->migration_threshold != 2048)
+ EMIT_PARAMS(pos, " migration_threshold %u", seg->migration_threshold);
if (seg->policy_settings)
for (cn = seg->policy_settings->child; cn; cn = cn->sib)
- EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i);
+ if (cn->v) /* Skip deleted entry */
+ EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i);
return 1;
}
@@ -3373,6 +3378,7 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
seg->data_block_size = data_block_size;
seg->flags = feature_flags;
seg->policy_name = policy_name;
+ seg->migration_threshold = 2048; /* Default migration threshold 1MiB */
/* FIXME: better validation missing */
if (policy_settings) {
@@ -3385,10 +3391,18 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
log_error("Cache policy parameter %s is without integer value.", cn->key);
return 0;
}
- seg->policy_argc++;
+ if (strcmp(cn->key, "migration_threshold") == 0) {
+ seg->migration_threshold = cn->v->v.i;
+ cn->v = NULL; /* skip this entry */
+ } else
+ seg->policy_argc++;
}
}
+ /* Always some throughput available for cache to proceed */
+ if (seg->migration_threshold < data_block_size * 8)
+ seg->migration_threshold = data_block_size * 8;
+
return 1;
}
5 years, 3 months
master - dm: ensure migration_threshold is big enough
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=30a3dda9d60ad0d53c1...
Commit: 30a3dda9d60ad0d53c1cff361bdd7af540790d5c
Parent: 9a0535e354d3027ec085d802ac6d016fec17ec75
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jan 20 11:45:10 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:48:50 2019 +0100
dm: ensure migration_threshold is big enough
When using caches with BIG pool size (>TB) there is required
to use relatively huge chunk size. Once the chunksize has
got over 1MiB - kernel cache target stopped writing such chunks
back on this if the migration_threshold remained on default 1MiB
(2048 sectors) size.
This patch ensure, DM layer will not let pass table line which
has not big enough migration threshold that can let pass
at least 8 chunks (independently of lvm2 metadata).
---
WHATS_NEW | 1 +
device_mapper/libdm-deptree.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 74def38..c8ea3d4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.02 -
===================================
+ Ensure migration_threshold for cache is at least 8 chunks.
Restore missing man info lvcreate --zero for thin-pools.
Drop misleadning comment for metadata minimum_io_size for VDO segment.
Add device hints to reduce scanning.
diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c
index 91ccdd4..4c030fc 100644
--- a/device_mapper/libdm-deptree.c
+++ b/device_mapper/libdm-deptree.c
@@ -203,6 +203,7 @@ struct load_segment {
uint64_t transaction_id; /* Thin_pool */
uint64_t low_water_mark; /* Thin_pool */
uint32_t data_block_size; /* Thin_pool + cache */
+ uint32_t migration_threshold; /* Cache */
unsigned skip_block_zeroing; /* Thin_pool */
unsigned ignore_discard; /* Thin_pool target vsn 1.1 */
unsigned no_discard_passdown; /* Thin_pool target vsn 1.1 */
@@ -2610,10 +2611,14 @@ static int _cache_emit_segment_line(struct dm_task *dmt,
EMIT_PARAMS(pos, " %s", name);
- EMIT_PARAMS(pos, " %u", seg->policy_argc * 2);
+ /* Do not pass migration_threshold 2048 which is default */
+ EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
+ if (seg->migration_threshold != 2048)
+ EMIT_PARAMS(pos, " migration_threshold %u", seg->migration_threshold);
if (seg->policy_settings)
for (cn = seg->policy_settings->child; cn; cn = cn->sib)
- EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i);
+ if (cn->v) /* Skip deleted entry */
+ EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i);
return 1;
}
@@ -3665,6 +3670,7 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
seg->data_block_size = data_block_size;
seg->flags = feature_flags;
seg->policy_name = policy_name;
+ seg->migration_threshold = 2048; /* Default migration threshold 1MiB */
/* FIXME: better validation missing */
if (policy_settings) {
@@ -3677,10 +3683,18 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
log_error("Cache policy parameter %s is without integer value.", cn->key);
return 0;
}
- seg->policy_argc++;
+ if (strcmp(cn->key, "migration_threshold") == 0) {
+ seg->migration_threshold = cn->v->v.i;
+ cn->v = NULL; /* skip this entry */
+ } else
+ seg->policy_argc++;
}
}
+ /* Always some throughput available for cache to proceed */
+ if (seg->migration_threshold < data_block_size * 8)
+ seg->migration_threshold = data_block_size * 8;
+
return 1;
}
5 years, 3 months
master - man: initial man page for VDO support
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=21742c3f3d00e8df274...
Commit: 21742c3f3d00e8df274e4d56995e6346b849acf8
Parent: e8ea3c9a61b9d3bea50c7e5957660caf45a89dd9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 18 16:59:13 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:39:23 2019 +0100
man: initial man page for VDO support
Basic lvm2 command support for VDO.
---
man/Makefile.in | 3 +-
man/lvmvdo.7_main | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 243 insertions(+), 1 deletions(-)
diff --git a/man/Makefile.in b/man/Makefile.in
index e73f834..114e92b 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -33,6 +33,7 @@ LVMCACHEMAN = lvmcache.7
LVMTHINMAN = lvmthin.7
LVMDBUSDMAN = lvmdbusd.8
LVMRAIDMAN = lvmraid.7
+LVMVDOMAN = lvmvdo.7
MAN5=lvm.conf.5
MAN7=lvmsystemid.7 lvmreport.7
@@ -96,7 +97,7 @@ else
endif
endif
-MAN7+=$(LVMCACHEMAN) $(LVMTHINMAN) $(LVMRAIDMAN)
+MAN7+=$(LVMCACHEMAN) $(LVMTHINMAN) $(LVMRAIDMAN) $(LVMVDOMAN)
MAN5DIR=$(mandir)/man5
MAN7DIR=$(mandir)/man7
MAN8DIR=$(mandir)/man8
diff --git a/man/lvmvdo.7_main b/man/lvmvdo.7_main
new file mode 100644
index 0000000..e789f7f
--- /dev/null
+++ b/man/lvmvdo.7_main
@@ -0,0 +1,241 @@
+.TH "LVMVDO" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
+
+.SH NAME
+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.
+
+Deduplication is a technique for reducing the consumption of storage
+resources by eliminating multiple copies of duplicate blocks. Compression
+takes the individual unique blocks and shrinks them with coding
+algorithms; these reduced blocks are then efficiently packed together into
+physical blocks. Thin provisioning manages the mapping from LBAs presented
+by VDO to where the data has actually been stored, and also eliminates any
+blocks of all zeroes.
+
+With deduplication, instead of writing the same data more than once each
+duplicate block is detected and recorded as a reference to the original
+block. VDO maintains a mapping from logical block addresses (used by the
+storage layer above VDO) to physical block addresses (used by the storage
+layer under VDO). After deduplication, multiple logical block addresses
+may be mapped to the same physical block address; these are called shared
+blocks and are reference-counted by the software.
+
+With VDO's compression, multiple blocks (or shared blocks) are compressed
+with the fast LZ4 algorithm, and binned together where possible so that
+multiple compressed blocks fit within a 4 KB block on the underlying
+storage. Mapping from LBA is to a physical block address and index within
+it for the desired compressed data. All compressed blocks are individually
+reference counted for correctness.
+
+Block sharing and block compression are invisible to applications using
+the storage, which read and write blocks as they would if VDO were not
+present. When a shared block is overwritten, a new physical block is
+allocated for storing the new block data to ensure that other logical
+block addresses that are mapped to the shared physical block are not
+modified.
+
+For usage of VDO with \fBlvm\fP(8) standard VDO userspace tools
+\fBvdoformat\fP(8) and currently non-standard kernel VDO module
+"\fIkvdo\fP" needs to be installed on the system.
+
+The "\fIkvdo\fP" module implements fine-grained storage virtualization,
+thin provisioning, block sharing, and compression;
+the "\fIuds\fP" module provides memory-efficient duplicate
+identification. The userspace tools include \fBvdostats\fP(8)
+for extracting statistics from those volumes.
+
+
+.SH VDO Terms
+
+.TP
+VDODataLV
+.br
+VDO data LV
+.br
+large hidden LV with suffix _vdata created in a VG.
+.br
+used by VDO target to store all data and metadata blocks.
+
+.TP
+VDOPoolLV
+.br
+VDO pool LV
+.br
+maintains virtual for LV(s) stored in attached VDO data LV
+and it has same size.
+.br
+contains VDOLV(s) (currently supports only a single VDOLV).
+
+.TP
+VDOLV
+.br
+VDO LV
+.br
+created from VDOPoolLV
+.br
+appears blank after creation
+
+.SH VDO Usage
+
+The primary methods for using VDO with lvm2:
+
+.SS 1. Create VDOPoolLV with VDOLV
+
+Create an VDOPoolLV that will holds VDO data togehther with
+virtual size VDOLV, that user can use. When the virtual size
+is not specified, then such LV is created with maximum size that
+always fits into data volume even if there cannot happen any
+deduplication and compression
+(i.e. it can hold uncompressible content of /dev/urandom).
+When the name of VDOPoolLV is not specified, it tales name from
+sequence of vpool0, vpool1 ...
+
+Note: As the performance of TRIM/Discard operation is slow for large
+volumes of VDO type, please try to avoid sending discard requests unless
+necessary as it may take considerable amount of time to finish discard
+operation.
+
+.nf
+.B lvcreate --type vdo -n VDOLV -L DataSize -V LargeVirtualSize VG/VDOPoolLV
+.B lvcreate --vdo -L DataSize VG
+.fi
+
+.I Example
+.br
+.nf
+# lvcreate --type vdo -n vdo0 -L 10G -V 100G vg/vdopool0
+# mkfs.ext4 -E nodiscard /dev/vg/vdo0
+.fi
+
+.SS 2. Create VDOPoolLV and convert existing LV into VDODataLV
+
+Convert an already created/existing LV into a volume that can hold
+VDO data and metadata (a volume reference by VDOPoolLV).
+User will be prompted to confirm such conversion as it is \fBIRREVERSIBLY
+DESTROYING\fP content of such volume, as it's being immediatelly
+formated by \fBvdoformat\fP(8) as VDO pool data volume. User can
+specify virtual size of associated VDOLV with this VDOPoolLV.
+When the virtual size is not specified, it will set to the maximum size
+that can keep 100% uncompressible data there.
+
+.nf
+.B lvconvert --type vdo-pool -n VDOLV -V VirtualSize VG/VDOPoolLV
+.B lvconvert --vdopool VG/VDOPoolLV
+.fi
+
+.I Example
+.br
+.nf
+# lvconvert --type vdo-pool -n vdo0 -V10G vg/existinglv
+.fi
+
+.SS 3. Change default setting used for creating VDOPoolLV
+
+VDO allows to set large variety of option. Lots of these setting
+can be specified by lvm.conf or profile settings. User can prepare
+number of different profiles and just specify profile file name.
+Check output of \fBlvmconfig --type full\fP for detailed description
+of all individual vdo settings.
+
+.I Example
+.br
+.nf
+# cat <<EOF > vdo.profile
+allocation {
+ vdo_use_compression=1
+ vdo_use_deduplication=1
+ vdo_use_metadata_hints=1
+ vdo_minimum_io_size=4096
+ vdo_block_map_cache_size_mb=128
+ vdo_block_map_period=16380
+ vdo_check_point_frequency=0
+ vdo_use_sparse_index=0
+ vdo_index_memory_size_mb=256
+ vdo_slab_size_mb=2048
+ vdo_ack_threads=1
+ vdo_bio_threads=1
+ vdo_bio_rotation=64
+ vdo_cpu_threads=2
+ vdo_hash_zone_threads=1
+ vdo_logical_threads=1
+ vdo_physical_threads=1
+ vdo_write_policy="auto"
+ vdo_max_discard=1
+}
+EOF
+
+# lvcreate --vdo -L10G --metadataprofile vdo.profile vg/vdopool0
+# lvcreate --vdo -L10G --config 'allocation/vdo_cpu_threads=4' vg/vdopool1
+.fi
+
+.SS 4. Change compression and deduplication of VDOPoolLV
+
+Disable or enable compression and deduplication for VDO pool LV
+(the volume that maintains all VDO LV(s) associated with it).
+
+.B lvchange --compression [y|n] --deduplication [y|n] VG/VDOPoolLV
+
+.I Example
+.br
+.nf
+# lvchange --compression n vg/vdpool0
+# lvchange --deduplication y vg/vdpool1
+.fi
+
+.SS 4. Checking usage of VDOPoolLV
+
+To quickly check how much data of VDOPoolLV are already consumed
+use \fBlvs\fP(8). Field Data% will report how much data occupies
+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.
+
+.I Example
+.br
+.nf
+# lvcreate --type vdo -L10G -V20G -n vdo0 vg/vdopool0
+# mkfs.ext4 -E nodiscard /dev/vg/vdo0
+# lvs -a vg
+
+ LV VG Attr LSize Pool Origin Data%
+ vdo0 vg vwi-a-v--- 20.00g vdopool0 0.01
+ vdopool0 vg dwi-ao---- 10.00g 30.16
+ [vdopool0_vdata] vg Dwi-ao---- 10.00g
+
+# vdostats --all /dev/mapper/vg-vdopool0
+/dev/mapper/vg-vdopool0 :
+ version : 30
+ release version : 133524
+ data blocks used : 79
+ ...
+
+.fi
+
+.SH VDO Topics
+
+.br
+
+\&
+
+.SH SEE ALSO
+.BR lvm (8),
+.BR lvm.conf (5),
+.BR lvmconfig (8),
+.BR lvcreate (8),
+.BR lvconvert (8),
+.BR lvchange (8),
+.BR lvextend (8),
+.BR lvremove (8),
+.BR lvs (8),
+.BR vdo (8),
+.BR vdoformat (8)
+.BR vdostats (8)
+
5 years, 3 months
master - man: document dD attrs for VDO lvs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9a0535e354d3027ec08...
Commit: 9a0535e354d3027ec085d802ac6d016fec17ec75
Parent: 21742c3f3d00e8df274e4d56995e6346b849acf8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 18 17:33:41 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:39:23 2019 +0100
man: document dD attrs for VDO lvs
New attrs v(d)o pool and v(D) pool data.
---
man/lvs.8_end | 5 +++--
man/lvs.8_pregen | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/man/lvs.8_end b/man/lvs.8_end
index 4f83516..6efc9cb 100644
--- a/man/lvs.8_end
+++ b/man/lvs.8_end
@@ -6,8 +6,9 @@ Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin,
(O)rigin with merging snapshot, (r)aid, (R)aid without initial sync,
(s)napshot, merging (S)napshot, (p)vmove, (v)irtual,
mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device,
-under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or
-pool m(e)tadata or pool metadata spare.
+under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data,
+v(d)o pool, v(D)o pool data,
+raid or pool m(e)tadata or pool metadata spare.
.IP 2 3
Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only
volume
diff --git a/man/lvs.8_pregen b/man/lvs.8_pregen
index 9659b70..c92ba14 100644
--- a/man/lvs.8_pregen
+++ b/man/lvs.8_pregen
@@ -519,8 +519,9 @@ Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin,
(O)rigin with merging snapshot, (r)aid, (R)aid without initial sync,
(s)napshot, merging (S)napshot, (p)vmove, (v)irtual,
mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device,
-under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or
-pool m(e)tadata or pool metadata spare.
+under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data,
+v(d)o pool, v(D)o pool data,
+raid or pool m(e)tadata or pool metadata spare.
.IP 2 3
Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only
volume
5 years, 3 months
master - man: missed --zero option for thin-pool creation
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e8ea3c9a61b9d3bea50...
Commit: e8ea3c9a61b9d3bea50c7e5957660caf45a89dd9
Parent: 28f3125aaa1d7843d2ce01d25b172478b0836bba
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 18 22:38:34 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:38:47 2019 +0100
man: missed --zero option for thin-pool creation
During man page rewrite this info got lost and remained
only for lvconvert. So restore it back for lvcreate.
---
WHATS_NEW | 1 +
man/lvcreate.8_pregen | 1 +
tools/args.h | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5bb5797..74def38 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.02 -
===================================
+ Restore missing man info lvcreate --zero for thin-pools.
Drop misleadning comment for metadata minimum_io_size for VDO segment.
Add device hints to reduce scanning.
Introduce LVM_SUPPRESS_SYSLOG to suppress syslog usage by generator.
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index 2a5e05d..ff68447 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -2715,6 +2715,7 @@ answer yes. Use with extreme caution.
Controls zeroing of the first 4KiB of data in the new LV.
Default is \fBy\fP.
Snapshot COW volumes are always zeroed.
+For thin pools, this controls zeroing of provisioned blocks.
LV is not zeroed if the read only flag is set.
Warning: trying to mount an unzeroed LV can cause the system to hang.
.ad b
diff --git a/tools/args.h b/tools/args.h
index 522cccf..898e756 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -1464,6 +1464,7 @@ arg(zero_ARG, 'Z', "zero", bool_VAL, 0, 0,
"Controls zeroing of the first 4KiB of data in the new LV.\n"
"Default is \\fBy\\fP.\n"
"Snapshot COW volumes are always zeroed.\n"
+ "For thin pools, this controls zeroing of provisioned blocks.\n"
"LV is not zeroed if the read only flag is set.\n"
"Warning: trying to mount an unzeroed LV can cause the system to hang.\n"
"#pvcreate\n"
5 years, 3 months
master - vdo: fix archived metadata comment
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f87dd7b12745815c391...
Commit: f87dd7b12745815c391257afc0b9631c708c2b6c
Parent: 0d142f65141d591430ced6a7a7fcccb4d2198d28
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 14 16:21:02 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:37:52 2019 +0100
vdo: fix archived metadata comment
lvm uses 'minimum_io_size' name to exactly match VDO naming here,
however in all common cases _size is using 'sector/512b' unit.
But in this case the value is in bytes and can have only 2 values:
either 512 or 4096.
It's probably not worth to rename it internaly, so we can just
drop comment - instead of using 1 or 8.
Thought let's think about it....
---
WHATS_NEW | 1 +
lib/vdo/vdo.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 1187fb4..5bb5797 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.02 -
===================================
+ Drop misleadning comment for metadata minimum_io_size for VDO segment.
Add device hints to reduce scanning.
Introduce LVM_SUPPRESS_SYSLOG to suppress syslog usage by generator.
Fix generator quering lvmconfig unpresent config option.
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
index c34eb93..ed051fc 100644
--- a/lib/vdo/vdo.c
+++ b/lib/vdo/vdo.c
@@ -308,7 +308,7 @@ static int _vdo_pool_text_export(const struct lv_segment *seg, struct formatter
if (vtp->use_metadata_hints)
outf(f, "use_metadata_hints = 1");
- outsize(f, vtp->minimum_io_size, "minimum_io_size = %u", vtp->minimum_io_size);
+ outf(f, "minimum_io_size = %u", vtp->minimum_io_size);
outsize(f, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024),
"block_map_cache_size_mb = %u", vtp->block_map_cache_size_mb);
5 years, 3 months
master - vdo: update vdo profile
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=28f3125aaa1d7843d2c...
Commit: 28f3125aaa1d7843d2ce01d25b172478b0836bba
Parent: f87dd7b12745815c391257afc0b9631c708c2b6c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 18 16:59:43 2019 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 21 12:38:00 2019 +0100
vdo: update vdo profile
---
conf/vdo-small.profile | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/conf/vdo-small.profile b/conf/vdo-small.profile
index 0bd47b5..2044fc2 100644
--- a/conf/vdo-small.profile
+++ b/conf/vdo-small.profile
@@ -1,25 +1,24 @@
# Demo configuration for 'VDO' using less memory.
-#
+# ~lvmconfig --type full | grep vdo
allocation {
- vdo_use_compression = 1
- vdo_use_deduplication = 1
- vdo_emulate_512_sectors = 0
- vdo_block_map_cache_size_mb = 128
- vdo_block_map_period = 16380
- vdo_check_point_frequency = 0
- vdo_use_sparse_index = 0
- vdo_index_memory_size_mb = 256
- vdo_use_read_cache = 0
- vdo_read_cache_size_mb = 0
- vdo_slab_size_mb = 2048
-
- vdo_ack_threads = 1
- vdo_bio_threads = 1
- vdo_bio_rotation = 64
- vdo_cpu_threads = 2
- vdo_hash_zone_threads = 1
- vdo_logical_threads = 1
- vdo_physical_threads = 1
- vdo_write_policy = "auto"
+ vdo_use_compression=1
+ vdo_use_deduplication=1
+ vdo_use_metadata_hints=1
+ vdo_minimum_io_size=4096
+ vdo_block_map_cache_size_mb=128
+ vdo_block_map_period=16380
+ vdo_check_point_frequency=0
+ vdo_use_sparse_index=0
+ vdo_index_memory_size_mb=256
+ vdo_slab_size_mb=2048
+ vdo_ack_threads=1
+ vdo_bio_threads=1
+ vdo_bio_rotation=64
+ vdo_cpu_threads=2
+ vdo_hash_zone_threads=1
+ vdo_logical_threads=1
+ vdo_physical_threads=1
+ vdo_write_policy="auto"
+ vdo_max_discard=1
}
5 years, 3 months
master - lvmdbusd: Use UUID instead of name for VG rename
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0d142f65141d591430c...
Commit: 0d142f65141d591430ced6a7a7fcccb4d2198d28
Parent: f43b7bb46159d00a4eba56df92ad5e572fa2038c
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Wed Jan 16 15:43:39 2019 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Jan 16 16:29:05 2019 -0600
lvmdbusd: Use UUID instead of name for VG rename
Use the UUID to specify the VG to rename instead of the name as this
approach works when we have duplicate VG names.
---
daemons/lvmdbusd/cmdhandler.py | 4 ++--
daemons/lvmdbusd/vg.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index fde7f5e..df854eb 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -263,10 +263,10 @@ def lv_tag(lv_name, add, rm, tag_options):
return _tag('lvchange', lv_name, add, rm, tag_options)
-def vg_rename(vg, new_name, rename_options):
+def vg_rename(vg_uuid, new_name, rename_options):
cmd = ['vgrename']
cmd.extend(options_to_cli_args(rename_options))
- cmd.extend([vg, new_name])
+ cmd.extend([vg_uuid, new_name])
return call(cmd)
diff --git a/daemons/lvmdbusd/vg.py b/daemons/lvmdbusd/vg.py
index 64ad0f0..7011ff8 100644
--- a/daemons/lvmdbusd/vg.py
+++ b/daemons/lvmdbusd/vg.py
@@ -177,7 +177,7 @@ class Vg(AutomatedProperties):
# Make sure we have a dbus object representing it
Vg.validate_dbus_object(uuid, vg_name)
rc, out, err = cmdhandler.vg_rename(
- vg_name, new_name, rename_options)
+ uuid, new_name, rename_options)
Vg.handle_execute(rc, out, err)
return '/'
5 years, 3 months
master - lvmdbusd: Handle duplicate VG names
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f43b7bb46159d00a4eb...
Commit: f43b7bb46159d00a4eba56df92ad5e572fa2038c
Parent: b4c33829908015acc6ce0690ee5d33c1eb87e98e
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Wed Jan 16 15:41:27 2019 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Jan 16 16:29:05 2019 -0600
lvmdbusd: Handle duplicate VG names
Lvm can at times have duplicate names. When this happens the daemon will
internally use vg_name:vg_uuid as the name for lookups, but display just
the vg_name externally. If an API user uses the Manager.LookUpByLvmId and
queries the vg name they will only get returned one result as the API
can only accommodate returning 1. The one returned is the first instance
found when sorting the volume groups by UUID.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1583510
---
daemons/lvmdbusd/lvmdb.py.in | 30 ++++++++++++++++++++++++++----
daemons/lvmdbusd/vg.py | 21 ++++++++++++++++-----
2 files changed, 42 insertions(+), 9 deletions(-)
diff --git a/daemons/lvmdbusd/lvmdb.py.in b/daemons/lvmdbusd/lvmdb.py.in
index 13ee391..0155d90 100644
--- a/daemons/lvmdbusd/lvmdb.py.in
+++ b/daemons/lvmdbusd/lvmdb.py.in
@@ -141,13 +141,22 @@ class DataStore(object):
@staticmethod
def _parse_vgs(_vgs):
- vgs = sorted(_vgs, key=lambda vk: vk['vg_name'])
+ vgs = sorted(_vgs, key=lambda vk: vk['vg_uuid'])
c_vgs = OrderedDict()
c_lookup = {}
for i in vgs:
- c_lookup[i['vg_name']] = i['vg_uuid']
+ vg_name = i['vg_name']
+
+ # Lvm allows duplicate vg names. When this occurs, each subsequent
+ # matching VG name will be called vg_name:vg_uuid. Note: ':' is an
+ # invalid character for lvm VG names
+ if vg_name in c_lookup:
+ vg_name = "%s:%s" % (vg_name, i['vg_uuid'])
+ i['vg_name'] = vg_name
+
+ c_lookup[vg_name] = i['vg_uuid']
DataStore._insert_record(c_vgs, i['vg_uuid'], i, [])
return c_vgs, c_lookup
@@ -162,13 +171,22 @@ class DataStore(object):
tmp_vg.extend(r['vg'])
# Sort for consistent output, however this is optional
- vgs = sorted(tmp_vg, key=lambda vk: vk['vg_name'])
+ vgs = sorted(tmp_vg, key=lambda vk: vk['vg_uuid'])
c_vgs = OrderedDict()
c_lookup = {}
for i in vgs:
- c_lookup[i['vg_name']] = i['vg_uuid']
+ vg_name = i['vg_name']
+
+ # Lvm allows duplicate vg names. When this occurs, each subsequent
+ # matching VG name will be called vg_name:vg_uuid. Note: ':' is an
+ # invalid character for lvm VG names
+ if vg_name in c_lookup:
+ vg_name = "%s:%s" % (vg_name, i['vg_uuid'])
+ i['vg_name'] = vg_name
+
+ c_lookup[vg_name] = i['vg_uuid']
c_vgs[i['vg_uuid']] = i
return c_vgs, c_lookup
@@ -521,6 +539,10 @@ if __name__ == "__main__":
for v in ds.vgs.values():
pp.pprint(v)
+ print("VG name to UUID")
+ for k, v in ds.vg_name_to_uuid.items():
+ print("%s: %s" % (k, v))
+
print("LVS")
for v in ds.lvs.values():
pp.pprint(v)
diff --git a/daemons/lvmdbusd/vg.py b/daemons/lvmdbusd/vg.py
index b9a23c2..64ad0f0 100644
--- a/daemons/lvmdbusd/vg.py
+++ b/daemons/lvmdbusd/vg.py
@@ -52,18 +52,23 @@ def load_vgs(vg_specific=None, object_path=None, refresh=False,
# noinspection PyPep8Naming,PyUnresolvedReferences,PyUnusedLocal
class VgState(State):
+
@property
- def lvm_id(self):
+ def internal_name(self):
return self.Name
+ @property
+ def lvm_id(self):
+ return self.internal_name
+
def identifiers(self):
- return (self.Uuid, self.Name)
+ return (self.Uuid, self.internal_name)
def _lv_paths_build(self):
rc = []
for lv in cfg.db.lvs_in_vg(self.Uuid):
(lv_name, meta, lv_uuid) = lv
- full_name = "%s/%s" % (self.Name, lv_name)
+ full_name = "%s/%s" % (self.internal_name, lv_name)
gen = utils.lv_object_path_method(lv_name, meta)
@@ -92,7 +97,7 @@ class VgState(State):
def create_dbus_object(self, path):
if not path:
path = cfg.om.get_object_path_by_uuid_lvm_id(
- self.Uuid, self.Name, vg_obj_path_generate)
+ self.Uuid, self.internal_name, vg_obj_path_generate)
return Vg(path, self)
# noinspection PyMethodMayBeStatic
@@ -102,7 +107,6 @@ class VgState(State):
# noinspection PyPep8Naming
@utils.dbus_property(VG_INTERFACE, 'Uuid', 's')
-(a)utils.dbus_property(VG_INTERFACE, 'Name', 's')
@utils.dbus_property(VG_INTERFACE, 'Fmt', 's')
@utils.dbus_property(VG_INTERFACE, 'SizeBytes', 't', 0)
@utils.dbus_property(VG_INTERFACE, 'FreeBytes', 't', 0)
@@ -135,6 +139,7 @@ class Vg(AutomatedProperties):
_AllocNormal_meta = ('b', VG_INTERFACE)
_AllocAnywhere_meta = ('b', VG_INTERFACE)
_Clustered_meta = ('b', VG_INTERFACE)
+ _Name_meta = ('s', VG_INTERFACE)
# noinspection PyUnusedLocal,PyPep8Naming
def __init__(self, object_path, object_state):
@@ -730,6 +735,12 @@ class Vg(AutomatedProperties):
cfg.worker_q.put(r)
@property
+ def Name(self):
+ if ':' in self.state.Name:
+ return self.state.Name.split(':')[0]
+ return self.state.Name
+
+ @property
def Tags(self):
return utils.parse_tags(self.state.tags)
5 years, 3 months
master - lvmdbusd: Correct object manager lookups
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b4c33829908015acc6c...
Commit: b4c33829908015acc6ce0690ee5d33c1eb87e98e
Parent: 1ed4b3f23baf13e224d0c24735304f872c0930e8
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Wed Jan 16 15:27:55 2019 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Jan 16 16:29:05 2019 -0600
lvmdbusd: Correct object manager lookups
When we have two logical volumes which switch their names at the
same time we are left with incorrect lookups. Anytime we find
an entry by doing a lookup by UUID or by name we will ensure
that the lookups are indeed correct.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1642176
---
daemons/lvmdbusd/objectmanager.py | 50 +++++++++++-------------------------
1 files changed, 15 insertions(+), 35 deletions(-)
diff --git a/daemons/lvmdbusd/objectmanager.py b/daemons/lvmdbusd/objectmanager.py
index 563b9ec..e40e9a1 100644
--- a/daemons/lvmdbusd/objectmanager.py
+++ b/daemons/lvmdbusd/objectmanager.py
@@ -189,8 +189,8 @@ class ObjectManager(AutomatedProperties):
path = dbus_object.dbus_object_path()
interfaces = dbus_object.interface()
- # print 'UN-Registering object path %s for %s' % \
- # (path, dbus_object.lvm_id)
+ # print('UN-Registering object path %s for %s' %
+ # (path, dbus_object.lvm_id))
self._lookup_remove(path)
@@ -240,39 +240,19 @@ class ObjectManager(AutomatedProperties):
return lookup_rc
return '/'
- def _uuid_verify(self, path, uuid, lvm_id):
+ def _id_verify(self, path, uuid, lvm_id):
"""
- Ensure uuid is present for a successful lvm_id lookup
+ Ensure our lookups are correct
NOTE: Internal call, assumes under object manager lock
:param path: Path to object we looked up
- :param uuid: lvm uuid to verify
- :param lvm_id: lvm_id used to find object
+ :param uuid: uuid lookup
+ :param lvm_id: lvm_id lookup
:return: None
"""
- # This gets called when we found an object based on lvm_id, ensure
- # uuid is correct too, as they can change. There is no durable
- # non-changeable name in lvm
+ # There is no durable non-changeable name in lvm
if lvm_id != uuid:
- if uuid and uuid not in self._id_to_object_path:
- obj = self.get_object_by_path(path)
- self._lookup_add(obj, path, lvm_id, uuid)
-
- def _lvm_id_verify(self, path, uuid, lvm_id):
- """
- Ensure lvm_id is present for a successful uuid lookup
- NOTE: Internal call, assumes under object manager lock
- :param path: Path to object we looked up
- :param uuid: uuid used to find object
- :param lvm_id: lvm_id to verify
- :return: None
- """
- # This gets called when we found an object based on uuid, ensure
- # lvm_id is correct too, as they can change. There is no durable
- # non-changeable name in lvm
- if lvm_id != uuid:
- if lvm_id and lvm_id not in self._id_to_object_path:
- obj = self.get_object_by_path(path)
- self._lookup_add(obj, path, lvm_id, uuid)
+ obj = self.get_object_by_path(path)
+ self._lookup_add(obj, path, lvm_id, uuid)
def _id_lookup(self, the_id):
path = None
@@ -339,22 +319,22 @@ class ObjectManager(AutomatedProperties):
# Lets check for the uuid first
path = self._id_lookup(uuid)
if path:
- # Verify the lvm_id is sane
- self._lvm_id_verify(path, uuid, lvm_id)
+ # Ensure table lookups are correct
+ self._id_verify(path, uuid, lvm_id)
else:
# Unable to find by UUID, lets lookup by lvm_id
path = self._id_lookup(lvm_id)
if path:
- # Verify the uuid is sane
- self._uuid_verify(path, uuid, lvm_id)
+ # Ensure table lookups are correct
+ self._id_verify(path, uuid, lvm_id)
else:
# We have exhausted all lookups, let's create if we can
if path_create:
path = path_create()
self._lookup_add(None, path, lvm_id, uuid)
- # print('get_object_path_by_lvm_id(%s, %s, %s, %s: return %s' %
- # (uuid, lvm_id, str(path_create), str(gen_new), path))
+ # print('get_object_path_by_lvm_id(%s, %s, %s): return %s' %
+ # (uuid, lvm_id, str(path_create), path))
return path
5 years, 3 months