Skip to content

[lvol] Module hangs after resizing metadata volume despite success #10056

Open
@vic-t

Description

@vic-t

Summary

Since it's currently not possible to set the size of the metadata volume when creating a thin pool volume , see #10050, I chose to use the module to extend its size after initial creation.

In Linux, this is easily done using lvextend -L{newsize} {vg_name}/{thinpool_metadatavolume_name}. I confirmed this command works as expected.

So, I suppose it should also work using the following task.

  - name: Ensure metadata LV is at least 512 MiB
    ansible.builtin.lvol:
      vg: "{{ vg }}"
      lv: "{{ thinpool }}_tmeta"
      size: "512M"
    register: metadata_resize_result

Unfortunately, this task hangs. No error is registered, so ignore_errors won't do anything, neither can a rescue block be run. As a result, we can never inspect the register.

A quick look into the journal of the host in question shows that the command was actually successful.

Apr 22 12:29:38 pve-vt python3[1236568]: ansible-ansible.builtin.lvol Invoked with vg=vg_nvme3 lv=tp_nvme3_tmeta size=512M state=present force=False shrink=True active=True resizefs=False opts=None snapshot=None pvs=None thinpool=None
Apr 22 12:29:38 pve-vt dmeventd[1091023]: No longer monitoring thin pool vg_nvme3-tp_nvme3.
Apr 22 12:29:38 pve-vt kernel: device-mapper: thin: 252:8: growing the metadata device from 26624 to 131072 blocks
Apr 22 12:29:38 pve-vt dmeventd[1091023]: Monitoring thin pool vg_nvme3-tp_nvme3.
Apr 22 12:29:48 pve-vt sudo[1236651]:       vt : TTY=pts/7 ; PWD=/home/vt ; USER=root ; COMMAND=/bin/sh -c 'echo BECOME-SUCCESS-cmmrwdkdsfuvvtcojhajnwofwbenhjmk ; /usr/bin/python3 /home/vt/.ansible/tmp/ansible-tmp-1745317788.492271-29626-62717103045922/AnsiballZ_setup.py'

Issue Type

Bug Report

Component Name

lvol

Ansible Version

$ ansible --version
ansible [core 2.16.3]
  config file = None
  configured module search path = ['/home/vt/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/vt/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.3.0

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

Ubuntu 24 Server LTS
Linux dhcp2 6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Steps to Reproduce

  - name: Ensure metadata LV is at least 512 MiB
    ansible.builtin.lvol:
      vg: "{{ vg }}"
      lv: "{{ thinpool }}_tmeta"
      size: "512M"
    register: metadata_resize_result

Expected Results

Confirmed change.

Actual Results

Task does not finish.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions