Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LVM SNAPSHOT CREATE FAILURE WITH LVM THIN POOL (SPECIFYING SIZE) SUCCEEDS BUT TIMEOUTS AT SNAPSHOT DRAIN #77

Open
grtxghe opened this issue Sep 5, 2024 · 0 comments

Comments

@grtxghe
Copy link

grtxghe commented Sep 5, 2024

Hi,

When trying to use the collection/role infra.lvm_snapshots.snapshot_create with thin pool and specifying a size, the snapshots are created. The rollback does seem to work in the managed node.

But the playbook fails due to the collection/role:
FAILED - RETRYING: [lvmtest5.example.com]: Wait for the snapshot to drain (20 retries left).

I a not sure if the snapshots created are correct or if only the check logic is incorrect (or both).

ANSIBLE IN USE: from RH-SAT 6.15
RH-SATELLITE: ANSIBLE JOB TEMPLATE
ANSIBLE VERSION: ansible-core-2.16.3-2.el8.x86_64
ANSIBLE COLLECTIONS :

# /etc/ansible/collections/ansible_collections
Collection                  Version
--------------------------- -------
ansible.posix               1.5.4
community.general           9.2.0
infra.lvm_snapshots         2.1.0

=> PLAYBOOK (SNAP CREATE) EXECUTION:

TASK [ansible.builtin.debug] ***************************************************
ok: [lvmtest5.example.com] => {
    "msg": [
        "INFO: OPERATING PARAMETERS",
        "---------------------------------",
        "INFO: TGT CONTENT HOST RHEL OS     : '8'",
        "INFO: TGT CONTENT HOST HOSTNAME    : 'lvmtest5'",
        "INFO: TGT CONTENT HOST FQDN        : 'lvmtest5.example.com'",
        "---------------------------------",
        "INFO: TGT RHSM-ENVIRONMENT         : ''",
        "INFO: TGT PATCHING COMMAND         : '/usr/bin/dnf upgrade -y --nobest'",
        "---------------------------------",
        "INFO: TGT AT TASK UNIT             : 'minutes'",
        "INFO: TGT AT TASK COUNT            : '8'",
        "---------------------------------",
        "INFO: TGT LVM SNAP NAME PREFIX     : 'xcustomer_pse_'",
        "INFO: TGT LVM SNAP NAME TIMESTAMP  : '2024090513'",
        "INFO: TGT LVM SNAP SET NAME        : 'xcustomer_pse_2024090513'",
        "INFO: TGT LVM SNAP CREATE BOOT BKP : 'True'",
        "---------------------------------",
        "INFO: TGT LVM SNAP CREATE AUTOEXTEND PCENT  : '20'",
        "INFO: TGT LVM SNAP CREATE AUTOEXTEND TSHOLD : '70'",
        "---------------------------------",
        "INFO: TGT LVM VGs/LVs:",
        [
            {
                "lv": "lv_root",
                "size": "3G",
                "vg": "vg00"
            },
            {
                "lv": "lv_var",
                "size": "3G",
                "vg": "vg00"
            }
        ],
        "---------------------------------",
        "INFO: TGT LVM LVs COUNT : '2'"
    ]
}
TASK [infra.lvm_snapshots.snapshot_create : DEBUG: VAR 'snapshot_create_check_status'] ***
ok: [lvmtest5.example.com] => {
    "msg": [
        "------------------------------------",
        {
            "changed": false,
            "failed": false,
            "failed_when_result": false,
            "rc": 0,
            "stderr": "Shared connection to 10.10.9.35 closed.\r\n",
            "stderr_lines": [
                "Shared connection to 10.10.9.35 closed."
            ],
            "stdout": "[{\"vg\": \"vg00\", \"lv\": \"lv_root\", \"size\": \"3221225472.0B\"}, {\"vg\": \"vg00\", \"lv\": \"lv_var\", \"size\": \"3221225472.0B\"}]\r\n",
            "stdout_lines": [
                "[{\"vg\": \"vg00\", \"lv\": \"lv_root\", \"size\": \"3221225472.0B\"}, {\"vg\": \"vg00\", \"lv\": \"lv_var\", \"size\": \"3221225472.0B\"}]"
            ]
        },
        "------------------------------------"
    ]
}
TASK [infra.lvm_snapshots.snapshot_create : Create snapshots] ******************
changed: [lvmtest5.example.com] => (item={'vg': 'vg00', 'lv': 'lv_root', 'size': '3221225472.0B'})
changed: [lvmtest5.example.com] => (item={'vg': 'vg00', 'lv': 'lv_var', 'size': '3221225472.0B'})

LAB LVM THIN POOL VM (BEFORE PLAYBOOK REVER SNAPSHOT):

[root@lvmtest5 ~]# lvs -a
  LV                           VG   Attr       LSize   Pool   Origin  Data%  Meta%  Move Log Cpy%Sync Convert
  lv_data0                     vg00 Vwi-aotz-- <24,95g pool00         0,05
  lv_home                      vg00 Vwi-aotz--   5,00g pool00         0,22
  lv_root                      vg00 owi-aotz--  19,96g pool00         10,35
  lv_root_xcustomer_pse_2024090513 vg00 swi-a-s---   3,00g        lv_root 49,70
  lv_swap                      vg00 -wi-ao----   4,00g
  lv_var                       vg00 owi-aotz-- <14,98g pool00         9,78
  lv_var_xcustomer_pse_2024090513  vg00 swi-a-s---   3,00g        lv_var  26,16
  [lvol0_pmspare]              vg00 ewi-------  68,00m
  pool00                       vg00 twi-aotz--  64,88g                5,48   12,95
  [pool00_tdata]               vg00 Twi-ao----  64,88g
  [pool00_tmeta]               vg00 ewi-ao----  68,00m

=> PLAYBOOK (REVERT SNAPSHOT) EXECUTION:

TASK [infra.lvm_snapshots.snapshot_revert : Restore boot backup] ***************
changed: [lvmtest5.example.com]

TASK [infra.lvm_snapshots.snapshot_revert : Revert to snapshots] ***************
ok: [lvmtest5.example.com] => (item={'lv_name': 'lv_root_xcustomer_pse_2024090513', 'vg_name': 'vg00', 'lv_attr': 'swi-a-s---', 'lv_size': '3,00g', 'pool_lv': '', 'origin': 'lv_root', 'data_percent': '49,70', 'metadata_percent': '', 'move_pv': '', 'mirror_log': '', 'copy_percent': '', 'convert_lv': ''})
ok: [lvmtest5.example.com] => (item={'lv_name': 'lv_var_xcustomer_pse_2024090513', 'vg_name': 'vg00', 'lv_attr': 'swi-a-s---', 'lv_size': '3,00g', 'pool_lv': '', 'origin': 'lv_var', 'data_percent': '26,16', 'metadata_percent': '', 'move_pv': '', 'mirror_log': '', 'copy_percent': '', 'convert_lv': ''})

TASK [infra.lvm_snapshots.snapshot_revert : Reboot] ****************************

[root@lvmtest5 ~]# Connection to 10.10.9.35 closed by remote host.
Connection to 10.10.9.35 closed.
TASK [infra.lvm_snapshots.snapshot_revert : Wait for the snapshot to drain] ****
FAILED - RETRYING: [lvmtest5.example.com]: Wait for the snapshot to drain (20 retries left).
FAILED - RETRYING: [lvmtest5.example.com]: Wait for the snapshot to drain (19 retries left).
FAILED - RETRYING: [lvmtest5.example.com]: Wait for the snapshot to drain (1 retries left).
failed: [lvmtest5.example.com] (item={'lv_name': 'lv_var_xcustomer_pse_2024090513', 'vg_name': 'vg00', 'lv_attr': 'swi-a-s---', 'lv_size': '3,00g', 'pool_lv': '', 'origin': 'lv_var', 'data_percent': '26,16', 'metadata_percent': '', 'move_pv': '', 'mirror_log': '', 'copy_percent': '', 'convert_lv': ''}) => {"ansible_loop_var": "item", "attempts": 20, "changed": false, "cmd": ["lvs", "--select", "vg_name = vg00 && lv_name = lv_var", "--reportformat", "json"], "delta": "0:00:00.027582", "end": "2024-09-05 13:42:41.797311", "item": {"convert_lv": "", "copy_percent": "", "data_percent": "26,16", "lv_attr": "swi-a-s---", "lv_name": "lv_var_xcustomer_pse_2024090513", "lv_size": "3,00g", "metadata_percent": "", "mirror_log": "", "move_pv": "", "origin": "lv_var", "pool_lv": "", "vg_name": "vg00"}, "msg": "", "rc": 0, "start": "2024-09-05 13:42:41.769729", "stderr": "", "stderr_lines": [], "stdout": "  {\n      \"report\": [\n          {\n              \"lv\": [\n                  {\"lv_name\":\"lv_var\", \"vg_name\":\"vg00\", \"lv_attr\":\"Vwi-aotz--\", \"lv_size\":\"<14,98g\", \"pool_lv\":\"pool00\", \"origin\":\"\", \"data_percent\":\"9,80\", \"metadata_percent\":\"\", \"move_pv\":\"\", \"mirror_log\":\"\", \"copy_percent\":\"\", \"convert_lv\":\"\"}\n              ]\n          }\n      ]\n  }", "stdout_lines": ["  {", "      \"report\": [", "          {", "              \"lv\": [", "                  {\"lv_name\":\"lv_var\", \"vg_name\":\"vg00\", \"lv_attr\":\"Vwi-aotz--\", \"lv_size\":\"<14,98g\", \"pool_lv\":\"pool00\", \"origin\":\"\", \"data_percent\":\"9,80\", \"metadata_percent\":\"\", \"move_pv\":\"\", \"mirror_log\":\"\", \"copy_percent\":\"\", \"convert_lv\":\"\"}", "              ]", "          }", "      ]", "  }"]}
PLAY RECAP *********************************************************************
lvmtest5.example.com       : ok=30   changed=2    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0
Exit status: 2
StandardError: Job execution failed
Every 2,0s: lvs -a                                                                                                                                                                            lvmtest5.example.com: Thu Sep  5 13:45:44 2024

  LV              VG   Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_data0        vg00 Vwi-aotz-- <24,95g pool00        0,05
  lv_home         vg00 Vwi-aotz--   5,00g pool00        0,23
  lv_root         vg00 Vwi-aotz--  19,96g pool00        10,35
  lv_swap         vg00 -wi-ao----   4,00g
  lv_var          vg00 Vwi-aotz-- <14,98g pool00        9,80
  [lvol0_pmspare] vg00 ewi-------  68,00m
  pool00          vg00 twi-aotz--  64,88g               5,49   12,95
  [pool00_tdata]  vg00 Twi-ao----  64,88g
  [pool00_tmeta]  vg00 ewi-ao----  68,00m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant