NetApp / netappdvp

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

SolidFire qos=VALUE option needs error checking #56

Closed dutchiechris closed 6 years ago

dutchiechris commented 7 years ago

Trying to set a qos limit I guessed passing a -o qos=Gold would give me the gold QoS level. This was incorrect syntax (should be -o type=Gold) but my mistake led to a volume defined in Docker but not created on the SolidFire array.

# docker volume create -d netapp -o qos=Gold --name vol3
Error response from daemon: create typovol3: Post http://[::]:27609/VolumeDriver.Create: http: ContentLength=42 with Body length 0
# docker volume ls
DRIVER              VOLUME NAME
netapp              vol3
# docker run -it -v vol3:/mnt alpine ash
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
0a8490d0dfd3: Pull complete
Digest: sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
Status: Downloaded newer image for alpine:latest
docker: Error response from daemon: VolumeDriver.Mount: Problem attaching docker volume: netappdvp-vol3 mountpoint: /var/lib/docker-volumes/netapp/netappdvp-vol3 error: Failed to retrieve volume by name in mount operation;  name: netappdvp-vol3 error: Failed to find any Volumes with Name: netappdvp-vol3 for Account: 5.
See 'docker run --help'.

Running the nDVP v1.3.2 (but also existed in v1.3) in the foreground threw this error:

2017/01/12 21:20:24 http: panic serving [::1]:54462: runtime error: index out of range
goroutine 550 [running]:
net/http.(*conn).serve.func1(0xc82013db00)
        /usr/local/go/src/net/http/server.go:1389 +0xc1
panic(0x8be380, 0xc82000c0b0)
        /usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/netapp/netappdvp/storage_drivers.(*SolidfireSANStorageDriver).Create(0xc8200fa000, 0xc8204805e0, 0x11, 0xc82000a690, 0x0, 0x0)
        /go/src/github.com/netapp/netappdvp/storage_drivers/solidfire_san.go:273 +0x12aa
main.ndvpDriver.Create(0xc82000ca18, 0xc820012840, 0x1e, 0x1, 0xc820061020, 0xd, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/netapp/netappdvp/docker_driver.go:138 +0x8b6
main.(*ndvpDriver).Create(0xc82013c180, 0xc82047c4a0, 0x7, 0xc82000a690, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        <autogenerated>:1 +0xed
github.com/docker/go-plugins-helpers/volume.(*Handler).initMux.func1(0xc82047c4a0, 0x7, 0xc82000a690, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/docker/go-plugins-helpers/volume/api.go:94 +0x7f
github.com/docker/go-plugins-helpers/volume.(*Handler).handle.func1(0x7f61f9e772b0, 0xc82028a9c0, 0xc8200fa2a0)
        /go/src/github.com/docker/go-plugins-helpers/volume/api.go:132 +0xde
net/http.HandlerFunc.ServeHTTP(0xc82000ca50, 0x7f61f9e772b0, 0xc82028a9c0, 0xc8200fa2a0)
        /usr/local/go/src/net/http/server.go:1618 +0x3a
net/http.(*ServeMux).ServeHTTP(0xc82000a7e0, 0x7f61f9e772b0, 0xc82028a9c0, 0xc8200fa2a0)
        /usr/local/go/src/net/http/server.go:1910 +0x17d
net/http.serverHandler.ServeHTTP(0xc82013c200, 0x7f61f9e772b0, 0xc82028a9c0, 0xc8200fa2a0)
        /usr/local/go/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc82013db00)
        /usr/local/go/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2137 +0x44e

Validation checking on the -o qos option should be implemented to avoid volume creation on Docker while it is not created on the SolidFire.

adkerr commented 7 years ago

Internally tracked by [DE317]

adkerr commented 6 years ago

Please follow #105