> For the complete documentation index, see [llms.txt](https://docs.platform9.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform9.com/private-cloud-director/getting-started/pre-requisites/hypervisor-lvm-configuration.md). Agents can also search and read this documentation through its [MCP server](https://docs.platform9.com/~gitbook/mcp).

# Hypervisor LVM Configuration

### Overview

Hypervisor hosts that have LVM installed must keep LVM from scanning the volumes attached to their VMs. When LVM scans those volumes, the host can hang or slow down (see [Symptoms When Not Configured](#symptoms-when-not-configured)). How you prevent this depends on the host operating system:

* **Platform9 OS:** no configuration is needed. Platform9 OS uses the LVM devices file, so LVM uses only the devices listed in that file. Do not add `filter` or `global_filter` settings to `/etc/lvm/lvm.conf`. See [Platform9 OS Hosts](#platform9-os-hosts).
* **Ubuntu:** configure LVM filters in `/etc/lvm/lvm.conf` by following the steps on this page, starting with [Check if LVM Package is Installed](#check-if-lvm-package-is-installed).

In this guide, you will configure LVM filters on an Ubuntu hypervisor host.

### Platform9 OS Hosts

Platform9 OS hosts use the LVM devices file (`/etc/lvm/devices/system.devices`), which lists the devices LVM is allowed to use. The installer creates this file. Volumes attached to the host's VMs are not listed in it, so LVM never scans them.

While the devices file is in use, LVM ignores the `filter` and `global_filter` settings in `/etc/lvm/lvm.conf`. The LVM filter steps on this page do not apply to Platform9 OS hosts.

To review the LVM configuration of a Platform9 OS host, open the [Host Management Console](https://docs.platform9.com/private-cloud-director/getting-started/platform9-os/platform9-os-host-management-console.md) and navigate to **Storage**. The **LVM Devices** section shows whether the devices file is in use, lists the devices LVM is allowed to use, and reports the result of `lvmdevices --check`.

You can also list the entries in the devices file from a shell on the host:

```bash
lvmdevices
```

### Remove LVM Filters from Platform9 OS Hosts

If you added `filter` or `global_filter` lines to `/etc/lvm/lvm.conf` on a Platform9 OS host, LVM ignores them and prints the following warnings every time you run `pvs`, `vgs`, or `lvs`:

```
  Please remove the lvm.conf global_filter, it is ignored with the devices file.
  Please remove the lvm.conf filter, it is ignored with the devices file.
```

The **LVM Devices** section of the **Storage** page in the Host Management Console also reports that a filter is still defined in `/etc/lvm/lvm.conf`.

To clear the warnings, remove the `filter` and `global_filter` lines from the `devices` section of `/etc/lvm/lvm.conf`.

{% hint style="warning" %}
If you rebuilt the initramfs after adding the filter lines (for example, with `dracut -f --regenerate-all`), rebuild it again after you remove them. The initramfs keeps its own copy of `/etc/lvm/lvm.conf` but does not use the devices file, so it applies the old filter at boot. If that filter does not match the boot disk, the host cannot find its root volume and fails to boot.

```bash
dracut -f --regenerate-all
```

{% endhint %}

### Check if LVM Package is Installed

{% hint style="info" %}
This step and the remaining LVM filter steps on this page apply to Ubuntu hosts only. For Platform9 OS hosts, see [Platform9 OS Hosts](#platform9-os-hosts).
{% endhint %}

Run the following command to check if LVM package is installed on your system.

```bash
dpkg -l | grep lvm
ii  libllvm15:amd64                        1:15.0.7-0ubuntu0.22.04.3               amd64        Modular compiler and toolchain technologies, runtime library
ii  liblvm2cmd2.03:amd64                   2.03.11-2.1ubuntu4                      amd64        LVM2 command library
ii  lvm2                                   2.03.11-2.1ubuntu5                      amd64        Linux Logical Volume Manager
```

If LVM is installed, you will see output similar to above. In that case, follow the steps below to set LVM filters.

### Identify Physical Disk Devices On Your System

Run the command below to identify all the block devices mounted on this host. NOTE however that this command will also list any VM disks as well.

```bash
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,VENDOR,MODEL | grep disk
sda                        1.7T disk                    HPE      LOGICAL VOLUME
sdb                        1.0T disk                    HPE      LOGICAL VOLUME
sdg                         49G disk                    3PARdata VV
sdk                         49G disk                    3PARdata VV
sdl                         49G disk                    3PARdata VV
sdm                         49G disk                    3PARdata VV
```

Identify from the output above the **subset of entries that are the physical disks for your hypervisor host**.

In this example, you would only pick `sda` and `sdb`. The other four devices are volumes attached to VMs running on this host.

### Add Or Enable LVM Filters For All Disks

Edit `/etc/lvm/lvm.conf` and locate the devices section.

Then edit the `filter` and `global_filter` values and add the **entries for the physical disks for your hypervisor host** that you identified above.

Note that this is a regular expression, where 'a' stands for accepting the path and 'r' stands for rejecting the path in the syntax below.

This example

```bash
devices {
    filter = [ "a|^/dev/sda|", "a|^/dev/sdb|", "r|.*|" ]
    global_filter = [ "a|^/dev/sda|", "a|^/dev/sdb|", "r|.*|" ]
}
```

### Validate that the LVM Filters are Active

```bash
sudo lvm dumpconfig devices | grep -E "filter|global_filter"
```

### Symptoms When Not Configured

If LVM is installed on your hypervisor but the LVM filters are not configured properly, here are some of the side effects and symptoms that you may observe on your <code class="expression">space.vars.product\_name</code> hosts:

* QEMU processes stuck in uninterruptible sleep (D state)
* VM operations hang or timeout
* Slow system responsiveness on the host
* High I/O wait times during LVM operations
* VMs fail to start or become unresponsive

### Related Pages

* [Pre-requisites](https://docs.platform9.com/private-cloud-director/getting-started/pre-requisites.md): hypervisor host requirements, including supported operating systems
* [Host Management Console](https://docs.platform9.com/private-cloud-director/getting-started/platform9-os/platform9-os-host-management-console.md): the local console on Platform9 OS hosts, including the **Storage** page
* [NetApp Storage Configurations](https://docs.platform9.com/private-cloud-director/storage/block-storage/volume-backend-configuration-examples/netapp-storage-configurations.md): multipath and LVM filter steps for NetApp iSCSI and Fibre Channel backends


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.platform9.com/private-cloud-director/getting-started/pre-requisites/hypervisor-lvm-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
