Bug 1854189

Summary: [RHEL7] storage: format entire disk with ext4 fs will be failed
Product: Red Hat Enterprise Linux 7 Reporter: Zhang Yi <yizhan>
Component: rhel-system-rolesAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Zhang Yi <yizhan>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.9CC: nhosoi, pcahyna, rmeggins, vcrhonek
Target Milestone: rcKeywords: Extras
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:storage
Fixed In Version: rhel-system-roles-1.0.1-2.el7_9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-31 08:04:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zhang Yi 2020-07-06 17:09:22 UTC
Description of problem:
storage: format entire disk with ext4 fs will be failed

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

---playbook---
[root@storageqe-62 storage]# cat tests/b.yml 
---
- hosts: all
  become: true
  vars:
    mount_location: '/opt/test1'
    volume_group_size: '5g'

  tasks:
    - include_role:
        name: storage

    - include_tasks: get_unused_disk.yml
      vars:
        min_size: "{{ volume_group_size }}"
        max_return: 1

    - name: tests default fs
      block:
        - name: tests default fs
          include_role:
            name: storage
          vars:
            storage_volumes:
              - name: images
                type: disk
                fs_type: 'ext4'
#                fs_create_options: '-F'
                disks: "{{ unused_disks }}" 
                mount_point: /opt/images

---execution log---
TASK [storage : manage the pools and volumes to match the specified state] *******************************************************************************************************************************
task path: /root/test/storage/tasks/main-blivet.yml:104
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419 && echo ansible-tmp-1594026521.65-26203-200113320838419="` echo /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419 `" ) && sleep 0'
Using module file /root/test/storage/library/blivet.py
<localhost> PUT /root/.ansible/tmp/ansible-local-25540Evjebv/tmpuruiKs TO /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419/AnsiballZ_blivet.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419/ /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419/AnsiballZ_blivet.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419/AnsiballZ_blivet.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1594026521.65-26203-200113320838419/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_blivet_payload_UdK0Ld/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1173, in run_module
  File "/usr/lib/python2.7/site-packages/blivet3/actionlist.py", line 48, in wrapped_func
    return func(obj, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blivet3/actionlist.py", line 327, in process
    action.execute(callbacks)
  File "/usr/lib/python2.7/site-packages/blivet3/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blivet3/deviceaction.py", line 637, in execute
    options=self.device.format_args)
  File "/usr/lib/python2.7/site-packages/blivet3/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blivet3/formats/__init__.py", line 515, in create
    self._create(**kwargs)
  File "/usr/lib/python2.7/site-packages/blivet3/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blivet3/formats/fs.py", line 409, in _create
    raise FormatCreateError(e, self.device)
fatal: [localhost]: FAILED! => {
    "actions": [], 
    "changed": false, 
    "crypts": [], 
    "invocation": {
        "module_args": {
            "disklabel_type": null, 
            "packages_only": false, 
            "pools": [], 
            "safe_mode": true, 
            "use_partitions": null, 
            "volumes": [
                {
                    "_device": "/dev/sdd", 
                    "_mount_id": "/dev/sdd", 
                    "_raw_device": "/dev/sdd", 
                    "disks": [
                        "sdd"
                    ], 
                    "encryption": false, 
                    "encryption_cipher": null, 
                    "encryption_key_file": null, 
                    "encryption_key_size": null, 
                    "encryption_luks_version": null, 
                    "encryption_passphrase": null, 
                    "fs_create_options": "", 
                    "fs_label": "", 
                    "fs_overwrite_existing": true, 
                    "fs_type": "ext4", 
                    "mount_check": 0, 
                    "mount_device_identifier": "uuid", 
                    "mount_options": "defaults", 
                    "mount_passno": 0, 
                    "mount_point": "/opt/images", 
                    "name": "images", 
                    "raid_chunk_size": null, 
                    "raid_device_count": null, 
                    "raid_level": null, 
                    "raid_metadata_version": null, 
                    "raid_spare_count": null, 
                    "size": 0, 
                    "state": "present", 
                    "type": "disk"
                }
            ]
        }
    }, 
    "leaves": [], 
    "mounts": [], 
    "msg": "Failed to commit changes to disk: (FSError('format failed: 1',), u'/dev/sdd')", 
    "packages": [
        "dosfstools", 
        "xfsprogs", 
        "e2fsprogs", 
        "lvm2"
    ], 
    "pools": [], 
    "volumes": []
}

PLAY RECAP ***********************************************************************************************************************************************************************************************
localhost                  : ok=31   changed=0    unreachable=0    failed=1    skipped=19   rescued=0    ignored=0 


---cat /tmp/blivet3.log---
2020-07-06 05:08:46,224 INFO program/MainThread: Running... mke2fs -t ext4 /dev/sdd
2020-07-06 05:08:46,233 INFO program/MainThread: stdout:
2020-07-06 05:08:46,233 INFO program/MainThread: /dev/sdd is entire device, not just one partition!
2020-07-06 05:08:46,233 INFO program/MainThread: Proceed anyway? (y,n) 
2020-07-06 05:08:46,233 INFO program/MainThread: stderr:
2020-07-06 05:08:46,233 INFO program/MainThread: mke2fs 1.42.9 (28-Dec-2013)
2020-07-06 05:08:46,234 DEBUG program/MainThread: Return code: 1

Comment 2 Zhang Yi 2020-07-13 09:56:10 UTC
This will blocking the whole disk formating on RHEL7.

Comment 3 Zhang Yi 2020-07-13 09:57:14 UTC
(In reply to Zhang Yi from comment #2)
> This will blocking the whole disk formating on RHEL7.

For ext4

Comment 14 errata-xmlrpc 2021-08-31 08:04:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rhel-system-roles bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3341