Skip to content

Show better error message when pool doesn't exist for volume/image #50

@flaviostutz

Description

@flaviostutz

I run the following command "docker run -it --rm --volume-driver=rbd --name first --volume mypool/myimage:/mnt/foo ubuntu /bin/bash -c "echo -n 'Hello ' >> /mnt/foo/hello"

"mypool" didn't exist, so I had the following message: "docker: Error response from daemon: create mypool/myimage: VolumeDriver.Create: Unable to create Ceph RBD Image(myimage): exit status 2.
See 'docker run --help'."

Logs:

ceph-driver_1  | 2018/07/28 06:35:01 driver.go:687: INFO: Attempting to create new RBD Image: (mypool/myimage, %!s(int=20480), xfs)
ceph-driver_1  | 2018/07/28 06:35:01 utils.go:73: DEBUG: shWithTimeout: 2m0s, rbd, [--pool mypool --conf /etc/ceph/ceph.conf --id admin create --image-format 2 --size 20480 myimage]
ceph-driver_1  | 2018/07/28 06:35:01 utils.go:38: DEBUG: sh CMD: &{"/usr/bin/rbd" ["rbd" "--pool" "mypool" "--conf" "/etc/ceph/ceph.conf" "--id" "admin" "create" "--image-format" "2" "--size" "20480" "myimage"] [] "" <nil> <nil> <nil> [] %!q(*syscall.SysProcAttr=<nil>) %!q(*os.Process=<nil>) "<nil>" <nil> <nil> %!q(bool=false) [] [] [] [] %!q(chan error=<nil>) %!q(chan struct {}=<nil>)}
ceph-driver_1  | 2018/07/28 06:35:01 driver.go:203: ERROR: Unable to create Ceph RBD Image(myimage): exit status 2

I discovered the reason by running manually the command the driver was issuing:
"/usr/bin/rbd --pool mypool --conf /etc/ceph/ceph.conf --id admin create --image-format 2 --size 20480 myimage"
Now the log told me the pool didn't exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions