diff --git a/csi/deployment.go b/csi/deployment.go index 073b7e60ec..faeb45d9f6 100644 --- a/csi/deployment.go +++ b/csi/deployment.go @@ -414,7 +414,7 @@ func NewPluginDeployment(namespace, serviceAccount, nodeDriverRegistrarImage, li }, { Name: "host", - MountPath: "/rootfs", // path is required for namespaced mounter + MountPath: "/host", MountPropagation: &MountPropagationBidirectional, }, { diff --git a/csi/node_server.go b/csi/node_server.go index b6c84dc74f..21bcf5c47a 100644 --- a/csi/node_server.go +++ b/csi/node_server.go @@ -23,6 +23,8 @@ import ( "github.com/longhorn/longhorn-manager/csi/crypto" + lhns "github.com/longhorn/go-common-libs/ns" + longhornclient "github.com/longhorn/longhorn-manager/client" longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2" ) @@ -269,6 +271,16 @@ func (ns *NodeServer) nodeStageSharedVolume(volumeID, shareEndpoint, targetPath if err == nil { return nil } + // Still failed. Log with mounting node and kernel version for possible troubleshooting. Don't step on actual mount error. + kernelRelease, err1 := lhns.GetKernelRelease() + if err1 != nil { + kernelRelease = err1.Error() + } + osDistro, err2 := lhns.GetOSDistro() + if err2 != nil { + osDistro = err2.Error() + } + log.WithError(err).Warnf("Failed to mount volume %v on node %s with kernel release %s, os distro %s", volumeID, ns.nodeID, kernelRelease, osDistro) } return status.Error(codes.Internal, err.Error()) }