NetApp / netappdvp

A Docker volume plugin for NetApp storage
96 stars 33 forks source link

SolidFire v1.3.2 volume cloning is broken #57

Closed dutchiechris closed 7 years ago

dutchiechris commented 7 years ago

Related to the change https://github.com/NetApp/netappdvp/pull/34 cloning broke.

Create a vol and a clone of it:

3-docker15 hackathon-vol2 # docker volume create -d netapp --name base
base
3-docker15 hackathon-vol2 # docker volume create -d netapp --name base-clone -o from=base
base-clone
3-docker15 hackathon-vol2 #

Docker says everything is ok. Try to mount the clone:

3-docker15 hackathon-vol2 # docker run -ti -v base-clone:/mnt  alpine ash
docker: Error response from daemon: VolumeDriver.Mount: Problem attaching docker volume: netappdvp-base-clone mountpoint: /var/lib/docker-volumes/netapp/netappdvp-base-clone
error: Failed to retrieve volume by name in mount operation;  name: netappdvp-base-clone
error: Failed to find any Volumes with DockerName: netappdvp-base-clone for Account: 5.
See 'docker run --help'.

Checking the attributes metadata of the clone it is empty:

{
  "id": 1,
  "result": {
    "volumes": [
      {
        "access": "readWrite",
        "accountID": 5,
        "attributes": {},
        "blockSize": 4096,
        "createTime": "2017-01-13T00:21:14Z",
        "deleteTime": "",
        "enable512e": false,
        "iqn": "iqn.2010-01.com.solidfire:pnay.netappdvp-base-clone.65",
        "name": "netappdvp-base-clone",
        "purgeTime": "",
        "qos": {
          "burstIOPS": 15000,
          "burstTime": 60,
          "curve": {
            "4096": 100,
            "8192": 160,
            "16384": 270,
            "32768": 500,
            "65536": 1000,
            "131072": 1950,
            "262144": 3900,
            "524288": 7600,
            "1048576": 15000
          },
          "maxIOPS": 15000,
          "minIOPS": 50
        },
        "scsiEUIDeviceID": "706e617900000041f47acc0100000000",
        "scsiNAADeviceID": "6f47acc100000000706e617900000041",
        "sliceCount": 1,
        "status": "active",
        "totalSize": 1073741824,
        "volumeAccessGroups": [],
        "volumeID": 65,
        "volumePairs": []
      }
    ]
  }
}

Looks like the create clone logic was not updated to populate the attributes metadata which then causes the subsequent mount to fail.

Also, if you create a new clone with underscores in the name (example: docker volume create -d netapp --name base__clone -o from=base) it succeeds to make a Docker vol but no SolidFire vol is actually created. Please fix/verify underscore support for src and clone vol as well.

j-griffith commented 7 years ago

yeah, there's a few things missing in that implementation, I've got a fix started, should have it posted here early next week.

j-griffith commented 7 years ago

I've got this started in a branch here: https://github.com/j-griffith/netappdvp/tree/update_attributes_on_sf_clone

Few details to finish up and some testing then I'll get a PR up for it.

dutchiechris commented 7 years ago

@j-griffith,

Great to hear you are working on it!

I noticed while using the docker create -o from=source-vol syntax to create a clone in v1.3 that QoS settings are also inherited on the clone (good) but if you pass -o type=dev or -o qos=100,200,300 it does not override them (bad).

While working on this bit of code can you also modify to update QoS on the clone if provided by the user? Thanks!

adkerr commented 7 years ago

Fixed in e7e2db5