unexpected output when wipe unassigned disk

Bug #1836633 reported by Ming Lei on 2019-07-15
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Brief Description
Attempted to wipe a unassigned disk, run cmd "system host-disk-wipe --confirm <node> <disk id>", the output result was "None"

Provide the severity of the defect.

Steps to Reproduce
1. On controller or compute node, find a unassigned disk uuid. e.g. "system host-disk-list controller 0"
2. Run "system host-disk-wipe --confirm <node> <disk id>"
3. Will see the output: "None"

Expected Behavior
output should be wipe disk results

Actual Behavior
output: "None"

100% Reproducible

System Configuration
Storage system: WCP_113-121 (Other storage lab had same results)

Branch/Pull Time/Commit
STX_master 20190713T013000Z

Last Pass

[2019-07-13 19:56:08,633] 301 DEBUG MainThread ssh.send :: Send 'system --os-username 'admin' --os-password 'Li69nux*' --os-project-name admin --os-auth-url --os-user-domain-name Default --os-project-domain-name Default --os-endpoint-type internalURL --os-region-name RegionOne host-disk-wipe --confirm controller-0 2f29f54c-243b-4f88-82da-71ab4dc0b2e3'
[2019-07-13 19:56:10,400] 423 DEBUG MainThread ssh.expect :: Output:
[sysadmin@controller-1 extension(keystone_admin)]$
[2019-07-13 19:56:10,400] 301 DEBUG MainThread ssh.send :: Send 'echo $?'
[2019-07-13 19:56:10,503] 423 DEBUG MainThread ssh.expect :: Output:
[sysadmin@controller-1 extension(keystone_admin)]$
[2019-07-13 19:56:10,565] 60 DEBUG MainThread conftest.update_results:: ***Failure at test call: /home/svc-cgcsauto/wassp-repos.new/testcases/cgcs/CGCSAuto/testcases/functional/storage/test_hostpartitions.py:973: AssertionError: Expected wipe disk to pass but instead failed
***Details: def test_host_disk_wipe_unassigned_disk():
        This test attempts to run system host-disk-wipe on a node using any
        unassigned disk.

        Command format is:

        system host-disk-wipe [--confirm] <hostname or id> <disk uuid>

        Note, host-disk-wipe is only applicable to controller and compute nodes. It
        cannot be used on the rootfs disk. It cannot be used for a disk that is
        used by a PV or has partitions used by a PV.

        - None

        Test Steps:
        1. Determine which disks are unassigned by comparing size_gib to
        available_gib in system host-disk-list
        2. Attempt to wipe the disk
        3. Expect it to pass

        - None
        computes = system_helper.get_hosts(personality="compute", availability="available")
        controllers = system_helper.get_hosts(personality="controller", availability="available")
        hosts = controllers + computes

        found_disk = False
        for host in hosts:
            LOG.info("Query disks on host {}".format(host))
            disks = storage_helper.get_host_disks(host)
            for disk_uuid in disks:
                cmd = "host-disk-show {} {}".format(host, disk_uuid)
                rc, out = cli.system(cmd)
                size_gib = table_parser.get_value_two_col_table(table_parser.table(out), "size_gib")
                available_gib = table_parser.get_value_two_col_table(table_parser.table(out), "available_gib")
                if int(float(size_gib)) == int(float(available_gib)):
                    found_disk = True
                    LOG.tc_step("Attempting to wipe disk {} from host {}".format(disk_uuid, host))
                    cmd = 'host-disk-wipe --confirm {} {}'.format(host, disk_uuid)
                    rc, out = cli.system(cmd, fail_ok=True)
> assert rc == 0, "Expected wipe disk to pass but instead failed"
E AssertionError: Expected wipe disk to pass but instead failed
E assert 1 == 0

testcases/functional/storage/test_hostpartitions.py:973: AssertionError

Test Activity
Storage Regression Testing

Ming Lei (mlei) on 2019-07-15
description: updated
description: updated
description: updated
tags: added: stx.regression
Numan Waheed (nwaheed) on 2019-07-17
tags: added: stx.retestneeded
Ghada Khalil (gkhalil) wrote :

Minor / low priority as this is an unlikely operation

Changed in starlingx:
importance: Undecided → Low
tags: added: stx.storage
Changed in starlingx:
status: New → Triaged
assignee: nobody → wanghao (wanghao749)
Wendy Mitchell (wmitchellwr) wrote :

Seeing this problem also on another hw lab (ip20-27)

The command appears to be accepted but returns None in the output even if the --confirm option is not used:

$ system host-disk-wipe controller-0 8142124a-57ed-4e82-b07f-9693586681cf
WARNING: This operation is irreversible and all data on the specified disk will be lost.
Continue [yes/N]: yes

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers