hpe-storage / python-hpedockerplugin

HPE Native Docker Plugin
Apache License 2.0
36 stars 64 forks source link

Docker plugin fails to remove vvset after successful removal of flashcache enabled volume. #706

Open sonawane-shashikant opened 5 years ago

sonawane-shashikant commented 5 years ago

Summary: Docker plugin fails to remove vvset after successful removal of flashcache enabled volume.

OS: Centos 7.6

3PAR IP: 10.50.3.9

pre-requisite: Docker should be installed and etcd should be up and running

Steps to reproduce:

  1. create flashcache enabled volume using docker plugin
  2. verify respective volume/vvset on 3par and docker
  3. delete volume using docker plugin
  4. verify respective volume/vvset on 3par and docker

Expected: Volume and vvset should be deleted from the docker and 3PAR.

Actual result: Volume has been deleted from 3par and docker but vvset present on the 3par with falsh-cache enabled.

Output:

[root@master-node ~]# docker volume create -d hpe --name Flashcachevolume -o flash-cache=true -o provisioning=dedup -o compression=true Flashcachevolume

[root@master-node ~]# docker volume inspect Flashcachevolume [ { "Driver": "hpe", "Labels": {}, "Mountpoint": "/", "Name": "Flashcachevolume", "Options": { "compression": "true", "flash-cache": "true", "provisioning": "dedup" }, "Scope": "global", "Status": { "volume_detail": { "3par_vol_name": "dcv-DLqgOra.QAm9i8W0r27e9w", "backend": "DEFAULT", "compression": "true", "cpg": "SSD_r1", "domain": "TEST_DOMAIN", "flash_cache": "true", "fsMode": null, "fsOwner": null, "mountConflictDelay": 30, "provisioning": "dedup", "size": 100, "snap_cpg": "SSD_r1" } } } ]

CSIM-8K02_MXN6072AC7 cli% showvv -cpg SSD_r1 -Rsvd(MiB)- -(MiB)-- Id Name Prov Compr Dedup Type CopyOf BsId Rd -Detailed_State- Snp Usr VSize 107862 .shared.SSD_r1_0 dds NA No base --- 107862 RW normal 0 5120 67108864 107866 VOL2 tdvv No Yes base --- 107866 RW normal 1024 1024 20480 107879 snpvol2 snp NA NA vcopy VOL2 107866 RW normal -- -- 20480 107875 dcv-Bq4jQEJOSoitQdjTavzC0A tdvv Yes Yes base --- 107875 RW normal 1024 1024 20480 107877 dcs-T8IAGLFLRHCuv.Jnvo9N8w snp Yes NA vcopy dcv-Bq4jQEJOSoitQdjTavzC0A 107875 RW normal -- -- 20480 107880 dcv-DLqgOra.QAm9i8W0r27e9w tdvv Yes Yes base --- 107880 RW normal 1024 1024 102400 107851 j1 tpvv Yes No base --- 107851 RW normal 0 1024 16384

 7 total                                                                                                      3072  9216 67309568

CSIM-8K02_MXN6072AC7 cli% CSIM-8K02_MXN6072AC7 cli% CSIM-8K02_MXN6072AC7 cli% showvvset -vv dcv-DLqgOra.QAm9i8W0r27e9w Id Name Members 9185 vvs-DLqgOra.QAm9i8W0r27e9w dcv-DLqgOra.QAm9i8W0r27e9w

1 total 1

CSIM-8K02_MXN6072AC7 cli% showflashcache -vvset vvs-DLqgOra.QAm9i8W0r27e9w Id VVSetName AFCPolicy 9185 vvs-DLqgOra.QAm9i8W0r27e9w enabled

1 total

[root@master-node ~]# docker volume rm Flashcachevolume Flashcachevolume

After deletion of volume from docker:

CSIM-8K02_MXN6072AC7 cli% showvvset Id Name Members

9185 vvs-DLqgOra.QAm9i8W0r27e9w --

343 total 5

CSIM-8K02_MXN6072AC7 cli% showflashcache -vvset vvs-DLqgOra.QAm9i8W0r27e9w Id VVSetName AFCPolicy 9185 vvs-DLqgOra.QAm9i8W0r27e9w enabled

1 total

bhagyashree-sarawate commented 5 years ago

Assign to me

bhagyashree-sarawate commented 5 years ago

After analyzing the code and the logs found the below comment for vvset removal hpe_3par_common.py at L948-L949

                # This is a special case which means the
                # volume is part of a volume set.
                vvset_name = self.client.findVolumeSet(volume_name)
                LOG.debug("Returned vvset_name = %s", vvset_name)
                if vvset_name is not None:
                    **# We have a pre-defined volume set just remove the
                    # volume and leave the volume set.**
                    self.client.removeVolumeFromVolumeSet(vvset_name,
                                                          volume_name)