code: func (detacher *vsphereVMDKDetacher) Detach(volumeName string, nodeName types.NodeName) error {
  
  	volPath := getVolPathfromVolumeName(volumeName)
  	attached, err := detacher.vsphereVolumes.DiskIsAttached(volPath, nodeName)
  	if err != nil {
  		// Log error and continue with detach
  		klog.Errorf(
  			"Error checking if volume (%q) is already attached to current node (%q). Will continue and try detach anyway. err=%v",
  			volPath, nodeName, err)
  	}
  
  	if err == nil && !attached {
  		// Volume is already detached from node.
  		klog.Infof("detach operation was successful. volume %q is already detached from node %q.", volPath, nodeName)
  		return nil
  	}
  
  	attachdetachMutex.LockKey(string(nodeName))
  	defer attachdetachMutex.UnlockKey(string(nodeName))
  	if err := detacher.vsphereVolumes.DetachDisk(volPath, nodeName); err != nil {
  		klog.Errorf("Error detaching volume %q: %v", volPath, err)
  		return err
  	}
  	return nil
  }
docs: // Detach the given device from the given node.