NetApp / netappdvp

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

SolidFire volumes created prior to 1.3.2 cannot be managed after upgrade to 1.3.2 #55

Closed dutchiechris closed 7 years ago

dutchiechris commented 7 years ago

https://github.com/NetApp/netappdvp/pull/34, a change to support more flexible volume naming, does not appear to be backward compatible; a volume created prior to 1.3.2 cannot be connected to with 1.3.2. This is a breaking change.

An example error message:

docker: Error response from daemon: VolumeDriver.Mount: Problem attaching docker volume: netappdvp-docker15 mountpoint: /var/lib/docker-volumes/netapp/netappdvp-docker15 error: 
Failed to retrieve volume by name in mount operation;  name: netappdvp-docker15
 error: Failed to find any Volumes with DockerName: netappdvp-docker15 for Account: 5.

The root cause appears to be that prior to this change the nDVP used the SolidFire volume name to identify the correct volume, and after it uses a new volume attributes value from key docker-name.

I was able to regain management by manually setting the volume attributes:

First, find the volumeID of the volume that you need to 'upgrade' to support 1.3.2 by creating a json file (or checking in the GUI); in my example netappdvp-docker15 (docker vol docker15 with the default nDVP added prefix):

cat getvol.json
{
        "method": "ListVolumes",
    "params": {
        "volumeName": "netappdvp-docker15"
    },
    "id": 1
}

Then run that API against the cluster:

3-docker15 netappdvp # curl -k -H "Content-Type: application/json" --data @getvol.json https://admin:notarealpassword@10.64.35.240/json-rpc/8.2
{"id":1,"result":{"volumes":[{"access":"readWrite","accountID":5,"attributes":{"platform":"Docker-NDVP"},"blockSize":4096,"createTime":"2017-01-12T14:58:56Z","deleteTime":"","enable512e":false,"iqn":"iqn.2010-01.com.solidfire:pnay.netappdvp-docker15.46","name":"netappdvp-docker15","purgeTime":"","qos":{"burstIOPS":15000,"burstTime":60,"curve":{"1048576":15000,"131072":1950,"16384":270,"262144":3900,"32768":500,"4096":100,"524288":7600,"65536":1000,"8192":160},"maxIOPS":15000,"minIOPS":50},"scsiEUIDeviceID":"706e61790000002ef47acc0100000000","scsiNAADeviceID":"6f47acc100000000706e61790000002e","sliceCount":1,"status":"active","totalSize":1073741824,"volumeAccessGroups":[],"volumeID":46,"volumePairs":[]}]}}

We see it is 46, so this is the one we need to modify:

Create a modify JSON file with the following attributes:

3-docker15 netappdvp # cat updatevol.json
{
        "method": "ModifyVolume",
        "params": {
                "volumeID": 46,
                "attributes": {
                        "docker-name": "netappdvp-docker15",
                        "ndvp-version": "1.3.2 [native]",
                        "platform": "Docker-NDVP"
                }

        },
        "id": 1
}
3-docker15 netappdvp # curl -k -H "Content-Type: application/json" --data @updatevol.json https://admin:notarealpassword@10.64.35.240/json-rpc/8.2
{"id":1,"result":{"curve":{"1048576":15000,"131072":1950,"16384":270,"262144":3900,"32768":500,"4096":100,"524288":7600,"65536":1000,"8192":160}}}

Thereafter you can manage the volume again. Repeat for all vols you want to update to be compatible with 1.3.2

j-griffith commented 7 years ago

Hi dutchiechris ,

Yes, that's a problem with the change in accessor; it actually came up when we were making the change but figured it would be safe because the original version wasn't out long and was early.

Regardless, it's not too bad to just add a fall back in case of failures and check for the old-style. Here's a quick gist of what I think would be a descent solution, I'll add another step in cases where it has to do the fallback where it also updates the volume with the attribute setting. Have to wait til tomorrow before I can get some testing on it though.

https://gist.github.com/j-griffith/db1408303c233aebe870e85a0826ae2e

Thanks, John

j-griffith commented 7 years ago

I've submitted PR #58 to address the naming issues: https://github.com/NetApp/netappdvp/pull/58

adkerr commented 7 years ago

Fixed in e7e2db5