lvm_import_vdo
Import external VDO volume into LVM
TLDR
Import a VDO volume with automatic names for the VG/LV
Import and set the destination VG/LV name
Show what would be done without changing anything
Convert in place without using a temporary snapshot (less safe)
Verbose output and automatically answer "yes" to prompts
Use a VDO manager configuration file during import
SYNOPSIS
lvm_import_vdo [OPTIONS] <VDO_DEVICE_PATH> <VG_NAME> [<LV_NAME>]
PARAMETERS
-h, --help
Displays a help message and exits.
-v, --verbose
Enables verbose output, showing more details about the operation.
-y, --yes
Assumes 'yes' to all interactive prompts, proceeding without confirmation.
--name <NAME>
Specifies the name for the new LVM Logical Volume. If omitted, a name derived from the VDO device path is used.
--pool-name <NAME>
Specifies the name for the new LVM Thin Pool. If omitted, a default name like 'vdo_<VDO_DEVICE_BASENAME>_pool' is used.
--uuid <UUID>
Assigns a specific UUID to the newly created LVM Logical Volume.
--force
Forces the import operation, overriding some warnings or checks. Use with caution as it might lead to unintended consequences.
--tags <TAGS>
Adds one or more tags (comma-separated) to the created Logical Volume and Thin Pool.
--readonly
Imports the VDO volume as a read-only LVM Logical Volume.
--alloc <AllocationPolicy>
Specifies the allocation policy for the LVM thin pool. For example, 'contiguous', 'anywhere', 'inherit'.
--addtag <TAG>
Adds a single tag to the created logical volume.
--driverstatus
Reports information about the VDO driver itself rather than performing an import.
DESCRIPTION
The `lvm_import_vdo` command is a specialized utility designed to bring an existing VDO (Virtual Data Optimizer) volume under the management of LVM (Logical Volume Manager).
VDO is a Linux kernel module that provides inline block-level deduplication, compression, and thin provisioning, significantly reducing storage requirements. When a VDO volume is created directly using the `vdo` command (outside of LVM), it can be managed independently. However, to leverage LVM's advanced features like snapshots, mirroring, or easier resizing alongside VDO's data reduction, the `lvm_import_vdo` command bridges this gap.
This command imports the specified VDO device into an LVM Volume Group, creating a new LVM thin pool and a thin logical volume within that pool. The data device for this LVM thin pool is the underlying VDO device itself. This allows LVM to manage the VDO volume as a regular logical volume, making it accessible and manageable through standard LVM tools.
CAVEATS
Before importing, the target VDO volume must be stopped using `vdo stop <VDO_NAME>`.
The `lvm_import_vdo` command creates a thin logical volume on top of the VDO device. While LVM can manage this volume, operations like `lvresize` will typically modify the thin volume's reported size within LVM, not necessarily the underlying VDO's physical allocation.
This command is intended for VDO volumes created outside of LVM. For new VDO volumes, it's generally recommended to create them directly using `lvcreate --type vdo` for seamless LVM integration from the start.
IMPORT PROCESS OVERVIEW
1. Stop the VDO Volume: Ensure the VDO volume to be imported is not active. Use `sudo vdo stop <VDO_NAME>` or `sudo systemctl stop vdo.service` if configured as a service.
2. Run `lvm_import_vdo`: Execute the command with the VDO device path, target Volume Group name, and optionally the desired Logical Volume name.
Example: `sudo lvm_import_vdo /dev/vdodev1 my_vg my_vdo_lv`
3. Activate LVM Volume: After import, activate the newly created logical volume: `sudo vgchange -ay my_vg`
4. Start VDO Volume: If needed for direct VDO tools, the underlying VDO volume might need to be started, though LVM will manage its access. However, typically the VDO service handles this automatically upon system boot, or LVM will activate it as part of the LV activation.
RESULTING LVM STRUCTURE
After a successful import, `lvm_import_vdo` creates an LVM thin pool and a thin logical volume. The thin pool's data device will be the original VDO device (e.g., `/dev/vdodev1`), and the metadata device for the thin pool will typically be created from other physical extents in the target Volume Group. The thin logical volume will then represent the VDO volume within LVM, allowing you to interact with it using commands like `lvs`, `lvdisplay`, `lvcreate -s` for snapshots, etc.
HISTORY
The LVM (Logical Volume Manager) suite has been a cornerstone of flexible storage management in Linux for decades. VDO (Virtual Data Optimizer) is a more recent addition, providing advanced data reduction capabilities. As VDO gained traction, the need for seamless integration with LVM became apparent. While LVM itself gained the ability to create VDO volumes directly via `lvcreate --type vdo`, `lvm_import_vdo` was developed to address the scenario where users already had existing VDO volumes created independently. This utility allows administrators to bring these pre-existing VDO volumes into the LVM ecosystem without recreating them, ensuring backward compatibility and offering greater flexibility in managing diverse storage environments.


