hpe-storage / python-hpedockerplugin

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

File persona: Share from different host get's created in same fpg, despite having different etcd and cpg #637

Closed virendra-sharma closed 5 years ago

virendra-sharma commented 5 years ago

Share creation from different host having separate etcd and cpg are done in same fpg but reflects separate cpg details in volume inspect .

Observation: 1) Share creation at same time from different host having different etcd and cpg get's created in same fpg. 2) FPG was based on host1 cpg, who started process first. 3) Host2 can see fpg details in docker inspect with it's own cpg details. 4) If we delete last share from host1, fpg get's deleted without looking for share from host2.

Steps: 1) Configure host1 and host2 with different etcd and cpg details. 2) Create share with default fpg from host1 & host2 at same time. 3) Inspect share on both host.

Expectation: Separate share get's created for both the host with their own cpg.

imran-ansari commented 5 years ago

This has been fixed... to be made available in next build.

imran-ansari commented 5 years ago

Fixed as part of PR https://github.com/hpe-storage/python-hpedockerplugin/pull/639 which has been submitted for review

virendra-sharma commented 5 years ago

Getting error from host2, if trying to create same fpg at same time with different host and etcd. FPG creation failed on second host, which was exepetced result hence closing this issue.

Host-1:

[root@cssosbe03-b12 ~]# docker volume create -d hpe --name share01 -o filePersona -o fpg=Docker_test
share01
[root@cssosbe03-b12 ~]# docker volume inspect share01
[
    {
        "Driver": "hpe:latest",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/plugins/91299c3c6ae196c40d58afd3e1a9b1a30a4f7671f5a2c80659a037a686d56bad/rootfs/opt/hpe/data/hpedocker-share01",
        "Name": "share01",
        "Options": {
            "filePersona": "",
            "fpg": "Docker_test"
        },
        "Scope": "global",
        "Status": {
            "backend": "DEFAULT_FILE",
            "clientIPs": [],
            "cpg": "swap_fs_cpg",
            "fpg": "Docker_test",
            "fsMode": null,
            "fsOwner": null,
            "name": "share01",
            "protocol": "nfs",
            "sharePath": "192.168.98.41:/Docker_test/Docker_test_vfs/share01",
            "size": "1024 GiB",
            "status": "AVAILABLE",
            "vfs": "Docker_test_vfs",
            "vfsIPs": [
                [
                    "192.168.98.41",
                    "255.255.192.0"
                ]
            ]
        }
    }
]

Host-2:

[root@CSSOSBE03-B03 ~]# docker volume create -d hpe --name share01 -o filePersona -o fpg=Docker_test
share01
[root@CSSOSBE03-B03 ~]# docker volume inspect share01
[
    {
        "Driver": "hpe",
        "Labels": {},
        "Mountpoint": "/opt/hpe/data/hpedocker-share01",
        "Name": "share01",
        "Options": {
            "filePersona": "",
            "fpg": "Docker_test"
        },
        "Scope": "global",
        "Status": {
            "backend": "DEFAULT_FILE",
            "clientIPs": [],
            "cpg": "Sandesh",
            "detailedStatus": "Share creation failed: Unknown exception caught. Reason: FPG already exists: A createfpg task is already running for FPG \"Docker_test\".",
            "fpg": "Docker_test",
            "fsMode": null,
            "fsOwner": null,
            "name": "share01",
            "protocol": "nfs",
            "sharePath": null,
            "size": "1024 GiB",
            "status": "FAILED",
            "vfs": null
        }
    }
]