emc-openstack / storops

Python storage management library for VNX and Unity.
Apache License 2.0
53 stars 29 forks source link

Issue unmapping or removing LUN from consistency group after disabling replication #357

Closed kuttattz closed 2 years ago

kuttattz commented 2 years ago

In a scenario where we create a CG with replication and later disable the replication and then try to unmap the LUN's from the CG results in failure.

The failure message we get from SDK is "The LUN cannot be removed from the Consistency group because there are snapshots of the Consistency group that include the selected LUN. Please remove all snapshots containing the selected LUN and try again. (Error Code:0x6000c16)". Error message indicates CG has snapshots and this is preventing LUN unmap but is not the case when checked in UI. CG doesn't have any snapshots and able to unmap LUN's for same CG in UI.

This failure happens intermittently.

On debugging further we were able to identify that after disabling the replication some snapshots are getting added to the CG. But similar issue we don't face in UI. Please find the below snapshots for reference.

"snapshots": [
            {
                "access_type": null,
                "attached_wwn": null,
                "creation_time": "2022-02-11 10:31:13.361000+00:00",
                "creator_schedule": null,
                "creator_type": "SnapCreatorTypeEnum.REP_V2",
                "creator_user": null,
                "description": "",
                "existed": true,
                "expiration_time": null,
                "hash": 8752676112571,
                "host_access": null,
                "id": "85899356922",
                "io_limit_policy": null,
                "is_auto_delete": false,
                "is_modifiable": false,
                "is_modified": false,
                "is_read_only": true,
                "is_system_snap": true,
                "last_writable_time": null,
                "lun": null,
                "name": "81604379270_APM00213404194_0000.ckpt000_24405017373912342.2_400",
                "parent_snap": null,
                "size": null,
                "snap_group": null,
                "state": "SnapStateEnum.READY",
                "storage_resource": {
                    "UnityStorageResource": {
                        "hash": 8752676112394,
                        "id": "res_1408"
                    }
                }
            },
            {
                "access_type": null,
                "attached_wwn": null,
                "creation_time": "2022-02-11 10:31:12.992000+00:00",
                "creator_schedule": null,
                "creator_type": "SnapCreatorTypeEnum.REP_V2",
                "creator_user": null,
                "description": "",
                "existed": true,
                "expiration_time": null,
                "hash": 8752676112415,
                "host_access": null,
                "id": "85899356923",
                "io_limit_policy": null,
                "is_auto_delete": false,
                "is_modifiable": true,
                "is_modified": false,
                "is_read_only": true,
                "is_system_snap": true,
                "last_writable_time": null,
                "lun": null,
                "name": "81604379270_APM00213404194_0000.ckpt000_24405017373905678.1_400",
                "parent_snap": null,
                "size": null,
                "snap_group": null,
                "state": "SnapStateEnum.READY",
                "storage_resource": {
                    "UnityStorageResource": {
                        "hash": 8752676112526,
                        "id": "res_1408"
                    }
                }
            }
        ]

To workaround the issue we tried to delete this snapshots and then try to unmap the LUN's but this also resulted in a failure with the message "The specified operation cannot be performed for system snapshot. (Error Code:0x6000c3e)"

Can you please help us to overcome this challenge?

yong-huang commented 2 years ago

Did you tried sleep for a while (3s, 5s for example) between the replication disable and lun unmap operations? No sure if Unity updated the replication disable info timely.

kuttattz commented 2 years ago

@yong-huang We have tried to reproduce the scenario to understand the waiting time period but what we noticed is that the snapshot is not getting created consistently. Could you please let us know the reason why snapshot creation is inconsistent?

yong-huang commented 2 years ago

@yong-huang We have tried to reproduce the scenario to understand the waiting time period but what we noticed is that the snapshot is not getting created consistently. Could you please let us know the reason why snapshot creation is inconsistent?

This is Unity behavior, you may need to confirm with Unity support.

I tried to reproduce the issue via Unishpere:

So, as I mentioned, sleeping for a while may fix it, or maybe you could try checking CG snap status/count first?

yong-huang commented 2 years ago

No response for three months, close this ticket.