diff --git a/pkg/rbd/rbd_attach.go b/pkg/rbd/rbd_attach.go index 91befe1a6..4be1dcd1a 100644 --- a/pkg/rbd/rbd_attach.go +++ b/pkg/rbd/rbd_attach.go @@ -284,6 +284,11 @@ func createPath(volOpt *rbdVolume, cr *util.Credentials) (string, error) { } devicePath, found := waitForPath(volOpt.Pool, image, 10, useNBD) if !found { + output, err := execCommand(cmdName, []string{ + "unmap", imagePath, "--id", cr.ID, "-m", volOpt.Monitors, "--keyfile=" + cr.KeyFile}) + if err != nil { + klog.Warningf("rbd: unmap error %v, rbd output: %s", err, string(output)) + } return "", fmt.Errorf("could not map image %s, Timeout after 10s", imagePath) } return devicePath, nil