red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
109 stars 166 forks source link

Device replacement test fails on LSO cluster with the error: ocs_ci.ocs.exceptions.VSLMNotFoundException #9898

Closed mashetty330 closed 1 month ago

mashetty330 commented 4 months ago

When you run the device replacement tests on LSO cluster, I got the below error:

def test_device_replacement(self, nodes):
    """
    Test device replacement in stretch cluster

    """
  osd_device_replacement(nodes)

tests/functional/disaster-recovery/sc_arbiter/test_device_replacement.py:25:


ocs_ci/ocs/osd_operations.py:49: in osd_device_replacement volume_path = nodes.get_volume_path(backing_volume) ocs_ci/ocs/platform_nodes.py:540: in get_volume_path return self.vsphere.get_volume_path( ocs_ci/utility/vsphere.py:1689: in get_volume_path vslm = self.get_vslm_id(volume_id, ds, storage)


self = <ocs_ci.utility.vsphere.VSPHERE object at 0x7f30737b6220>, volume_id = '/mnt/local-storage/localblock/scsi-36000c29d920431d5657a21749bc20860', datastore = 'vim.Datastore:datastore-26305' storage = 'vim.vslm.vcenter.VStorageObjectManager:VStorageObjectManager'

def get_vslm_id(self, volume_id, datastore, storage):
    """
    Gets the VSLM ID

    Args:
        volume_id (str): Volume ID
        datastore (vim.Datastore): Datastore instance
        storage (vim.vslm.vcenter.VStorageObjectManager): vStorageObjectManager

    Returns:
        vim.vslm.ID

    Raises:
        VSLMNotFoundException: In case VSLM not found

    """
    vslms = storage.ListVStorageObject(datastore)
    for vslm in vslms:
        if vslm.id == volume_id:
            return vslm
    else:
        logger.error(f"vslm not found for volume {volume_id}")
      raise VSLMNotFoundException

E ocs_ci.ocs.exceptions.VSLMNotFoundException

I did a basic analysis and found out that below expectation in the code is not meeting.

 if vslm.id == volume_id:
vavuthu commented 3 months ago

@mashetty330 could you provide the job link

vavuthu commented 3 months ago

When you run the device replacement tests on LSO cluster, I got the below error:

def test_device_replacement(self, nodes):
    """
    Test device replacement in stretch cluster

    """
  osd_device_replacement(nodes)

tests/functional/disaster-recovery/sc_arbiter/test_device_replacement.py:25:

didn't see this test case in https://github.com/red-hat-storage/ocs-ci/tree/master/tests/functional/disaster-recovery/sc_arbiter

mashetty330 commented 2 months ago

@mashetty330 could you provide the job link

@vavuthu you can run device replacement test in LSO cluster. I will provide you with the job

mashetty330 commented 1 month ago

@vavuthu please find the job https://url.corp.redhat.com/d9814df

vavuthu commented 1 month ago

u can run device replacement test in L

test case doesn't exist in repo. you are running test case from your PR ( https://github.com/red-hat-storage/ocs-ci/pull/9548 ) which is not merged