Service atomic-openshift-node reports warning event "hostPath type check failed: /var/log/openvswitch is not a directory" after restart

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (OCP) 3.11

Issue

  • After restarting atomic-openshift-node service, a warning node event is reported in openshift-sdn project:

    MountVolume.SetUp failed for volume "log-openvswitch" : hostPath type check failed: /var/log/openvswitch is not a directory
    

Resolution

  • Log into the node affected and delete the directory /var/log/openvswitch , admin privilege is required.

    # rmdir /var/log/openvswitch
    

Root Cause

  • The event is not affecting the operational function of the OCP cluster but is permanently reporting the warning event for the ovs pod of the affected node in the openshift-sdn project.
  • The root cause for this flaw was not determined but, after analysis, it was resolved that the node directory /var/log/openvswitch doesn't need to be mounted as a volume on the ovs daemonset pod because, for OpenShift 3.11, the persistent storage is not longer required as per sdn container change.

Diagnostic Steps

  • Verify events in openshift-sdn project

    $ oc get events -n openshift-sdn
    LAST SEEN   FIRST SEEN   COUNT     NAME                         KIND      SUBOBJECT   TYPE      REASON        SOURCE                                                        MESSAGE
    59s         2m           8         ovs-69tqn.1633691522997a24   Pod                   Warning   FailedMount   kubelet, node-0.testcluster.lab.com   MountVolume.SetUp failed for volume "log-openvswitch" : hostPath type check failed: /var/log/openvswitch is not a directory
    1s        1s        1         ovs-69tqn.16336931ba838ca0   Pod                 Warning   FailedMount   kubelet, node-0.testcluster.lab.com   Unable to mount volumes for pod "ovs-69tqn_openshift-sdn(1845e9bc-f093-11ea-806f-fa163e9473f1)": timeout expired waiting for volumes to attach or mount for pod "openshift-sdn"/"ovs-69tqn". list of unmounted volumes=[log-openvswitch]. list of unattached volumes=[host-modules host-run-ovs host-sys host-config-openvswitch log-openvswitch sdn-token-8lqn2]
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments