IBM Support

Automounting of ClearCase VOBs

How To


Summary

ClearCase provides an optional feature on Linux, Solaris. and AIX to support the automounting of VOBs.

Objective

This document provides instructions and other useful background information for enabling and using the VOB automount feature of ClearCase.

Environment

This feature is available for ClearCase on all supported versions of Linux, all supported versions of Solaris, and on AIX 7.2 or 7.3.

Steps

Introduction

ClearCase now supports automounting of VOBs. This feature is relevant to users of ClearCase dynamic views only. (Snapshot and web views can access any VOB that has a tag, regardless of whether it is mounted.) The automounting of VOBs can be configured on Linux, Solaris, and AIX systems only.

The automounting of VOBs is an optional feature that changes the fundamental assumption that all public VOBs are always mounted. (The default behavior for the mounting of VOBs has not changed. It changes when you enable the automounting of VOBs.)

Read this document fully to ensure that you understand how automounting of ClearCase VOBs might impact your ClearCase usage.

When automounting is configured as described, all public VOBs will no longer be mounted when ClearCase is started on a host. VOBs will be mounted on demand, when any user or application references a VOB pathname. This is a per-host configuration, each ClearCase client and server host can be configured as appropriate for its use case.

For a ClearCase installation with many VOBs, the default behavior of mounting all public VOBs at ClearCase start-up can take a noticeable amount of time to complete and will generate a burst of requests to the ClearCase registry server. Automounting VOBs eliminates these costs, allowing VOBs to be mounted only when they are needed.

Overview

Automounting filesystems is a familiar concept for most Linux and Unix users. Typically, access to NFS filesystems is configured though the automounter. Examples include /net and automounted home directories. Automounting of VOBs provides similar behavior, based on an automount map being defined and associated with one or more specific VOB tag prefixes. For example, if VOBs are defined with the naming convention of

/vobs/product
/vobs/tests

an automount map for /vobs would be defined. Given that, referencing any valid VOB pathname beginning with /vobs will trigger the specified VOB to be mounted. Note that use of a ClearCase view context is still necessary for objects within the VOB to be visible and accessible.

View-extended names such as /view/<viewtag>/vobs/<vob tag> will also invoke the automounter, when resolving the /vobs component of the pathname.

A VOB pathname reference might be from a variety of sources, including explicit shell command line or cleartool/rcleartool command line references, makefile references, or browsing in the ClearTeam Explorer (CTE).

Automounted VOBs will also be automatically unmounted. The typical default timeout value is ten minutes. That value is configurable, with details dependent on the host operating system and its automount daemon implementation.

The following sections provide more detail and supporting examples for both ClearCase users and administrators.

User visible behavior

Users will notice little or no difference when the automounting of VOBs is enabled. Whenever a VOB is referenced, it will be automatically mounted if it is not already mounted. Any VOB mounts that have not been accessed for the default timeout period will be unmounted automatically. Note that automounting will affect what VOBs can be assumed to be mounted at any given time. There are a small number of cleartool commands that might act on multiple VOBs and their scope might be different when not all VOBs are mounted. This is discussed in more detail in “Some specific command considerations.”

When automounting is enabled, the operating system’s autofs filesystem manages the specified mount point. The only operations that are supported by autofs beneath a mount point are mount and unmount. Users or programs cannot perform other operations directly in that directory and might notice some different behaviors because of that restriction.

Actions that will trigger a VOB to be automounted

Just as with an explicit cleartool mount, the user is not required to be set to a view context to automount the VOB. However, a view context is still required to access the files and directories in the VOB.

Some specific command considerations

The following table lists some specific command considerations.

Command Considerations
cleartool mount The cleartool mount command will still mount an unmounted VOB. VOBs mounted using cleartool mount and listed in the automount map will still be automatically unmounted by autofs.
VOB paths on input and output The cleartool commands that take a pathname argument might trigger automounting, but commands such as cleartool lsvob or lsactivity that provide VOB paths in their output will not cause those VOBs to be mounted.
commands with -invob option Many commands act on the current VOB (based on working directory), and the actions of setting to a view and navigating to that directory would have already triggered that VOB to mount. Some commands accept the -invob option, rather than inferring the VOB from the working environment. The VOB named with the -invob option will be automounted.
commands with -avobs option

A small subset of cleartool commands accept the -avobs option. This indicates that rather than only acting within the current VOB, the command should consider all versions in the VOBs currently mounted on the local host.  In the absence of automounting, this would typically include all the public VOBs that had been mounted when ClearCase was started on that host. An optional environment variable CLEARCASE_AVOBS might be defined to designate a specific smaller list of VOBs that should be considered as the scope of -avobs.

Because automounted VOBs might not yet have been mounted, or could have been automatically unmounted, it is possible that a command execution using -avobs might not find as many VOBs mounted as it did previously. To ensure that the wanted scope of the command can be achieved, the cleartool commands that accept -avobs have been updated such that when automounting is enabled, the CLEARCASE_AVOBS list will be interpreted to mean that mounting of those VOBs should be triggered, if necessary. Specify CLEARCASE_AVOBS as a list of VOB tags separated by commas, white space, or colons.

The cleartool commands to which this applies are lscheckout, lshistory, find, findmerge, and rmview.

cleartool lsprivate

The cleartool lsprivate command lists filesystem objects that belong to a dynamic view, and even though these have their storage in the view’s private storage area, they will be listed with pathnames in one or more VOBs. This command already handles the case of a VOB that is not currently mounted, it can list the view-private files but flags them with a “#” in the command output. This might be a more common occurrence with automounting enabled. The following is an example of that output:

cleartool: Warning: VOB not mounted: "/vobs/testvob"
  VOB identifier is hhhhhhhh.hhhhhhhh.hhhh.nn:nn:nn:nn:nn:nn
#/vobs/testvob/file1.txt
#/vobs/testvob/file2.txt
#/vobs/testvob/dir1/file3.out

Public and private VOBs

The automounter can mount both public and private VOBs. Cleartool mount enforces that mounting a private VOB requires ownership of the VOB storage directory. Autofs will not enforce this at mount time, any action referencing the VOB tag pathname will mount a private VOB.

For private VOBs, the cleartool mount command also requires ownership of the VOB tag mount-over directory or allows a root user to mount the private VOB. When a private VOB is automounted, that directory is owned by the root user, and a subsequent attempt by the private VOB owner to mount the VOB using cleartool mount will fail with a permission error. Automounting will continue to work.

Administrator actions

The steps to configure VOB automounting are listed here, and the following sections describe each of these steps in more detail. This configuration process must be completed on each client system on which VOBs will be automounted. It is not necessary to configure automounting on every client system in your environment, the choice can be made independently for each system and if no specific action is taken, the default behavior will continue to be that all public VOBs will be mounted at start-up by the ClearCase start script.

To configure and enable VOB automounting:

  1. Update the system’s master automount configuration file to associate an MVFS automount map with each VOB root that you want to automount.
  2. Set up one or more automount maps for VOBs. One option is to use the provided template auto.mvfs file by copying it to /etc and setting VOB_ROOT_PATH as appropriate for your environment.
  3. Create a configuration file to direct the ClearCase start script to skip the step of mounting all public VOBs.
  4. Restart the automounter and ClearCase.

If a ClearCase system is configured without dynamic views (server-only configuration), no VOBs will be mounted. Therefore, it does not make sense to configure automounting.

Update the master automount configuration file for the system

These instructions assume that autofs and the automount services of the host operating system are already configured and enabled. If this is not the case, consult the documentation for the host operating system for details of enabling these.

To enable automounting of VOBs, one or more entries corresponding to the root component of VOB tag pathnames must be added to the automount master configuration file, /etc/auto.master. This entry will direct the automount service to use the designated map to manage mount points starting with a specific prefix.

These examples show an entry to manage /vobs/<…> format VOB tags. If you use a different naming convention, such as /source/<…>, substitute that prefix where these examples show “/vobs”.

The name of the master file and the specific syntax for the MVFS map entry to be added are different on each operating system. The following examples are for Linux, Solaris, and AIX.

Linux: In the file /etc/auto.master, add this line:

/vobs program:/etc/auto.mvfs nobrowse

For further details: man auto.master

Solaris and AIX: In the file auto_master, add this line:

/vobs  /etc/auto.mvfs nobrowse

For further details: man automount

If you have VOB tags with multiple name components, such as /vobs/source/project1, you only need to specify the first component in this file (/vobs in this case).

If you need to configure automounting for VOBs with differing VOB tags, you must use a separate MVFS map file for each VOB tag root.

/source       program:/etc/auto.mvfs.source

/test_vobs    program:/etc/auto.mvfs.tests

Auto.mvfs

The entry added to the auto.master file associates the specific mount point pathname with a map file that contains the supporting details for autofs to mount the VOBs. The automounter supports several different types of maps, and for VOB mounts we have provided an executable program map that can be used as a template. This is a script coded to the interface specified by the automounter. The script accesses details about the VOBs from the ClearCase registry to provide the information that autofs will use to mount the VOB. In accordance with the general automounter implementation, it is also possible to use a direct or indirect map for VOBs. This would need to be created manually and must include specific entries for all VOBs using the automount-configured VOB root pathname. Because this map would need to be updated for any newly created VOBs, we recommend the executable map that will find your VOB tags automatically by accessing the ClearCase registry.

The auto.mvfs template is found in <clearcase-install-dir>/etc/auto.mvfs. The administrator must copy this file into the /etc directory and ensure that it has execute permission for the root user. This file might need to be modified to suit the use of the specific site. There are differences in the autofs API on each OS platform, so you cannot copy an auto.mvfs script from one system to another of a different OS.

The template file includes a definition for a VOB_ROOT_PATH variable and this must match the mount point key added to the auto.master file. If your site uses more than one pathname root for naming VOBs, multiple entries must be added to auto.master, each naming a separate and distinctly named copy of the auto.mvfs executable program map.

As documented in “Public and private VOBs,” the default will be that both public and private VOBs are automounted. We recommend this as the default due to the potential access pitfalls of users managing private VOB tag mount-over directories. If you want to override this default, this can be done by uncommenting a specific line in the auto.mvfs file. In this case, we recommend that private VOBs use a different VOB tag prefix so that they are not managed by the automounter.

Example excerpts of auto.mvfs showing possible modifications:

#!/bin/sh
#
# Licensed Materials - Property of HCL
# (C) Copyright HCL Technologies Ltd. 2018.  All Rights Reserved.
#
# Note to U.S. Government Users Restricted Rights:
# Use, duplication or disclosure restricted by GSA ADP Schedule
# Contract with IBM Corp.
# key="$1"

opts="-fstype=mvfs"
#
# This string must match the corresponding string
# for the indirect map in auto.master.
#
VOB_ROOT_PATH=/vobs

mvfs_get_mount_info() {
    vobtag=$1
    dir="${vobtag#"${VOB_PATTERN}"}"

    ${CLEARTOOL} lsvob -long $vobtag |  ${NAWK} -v mopts=${opts} -v mdir="${dir}" -- '
    BEGIN   { ORS=""; private=0 }
        {
          #
          # To prevent the script from allowing private vobs to be automounted,
          # uncomment out the following line.
          # if (/Access: private/)  private=1
          #
          if (/Global path:/) vobdir=$3 }
    END { if (!private) print mdir " " mopts " :" vobdir} '
}

Start time configuration file

To prevent all public VOBs from being mounted during ClearCase start, create the file /var/adm/rational/clearcase/no_vob_mount_on_startup. The start script will check for the existence of this file and will skip the VOB mounting step if it exists. It should be an empty file.

Restart autofs and ClearCase

After modifying the system’s auto.master file or making any changes to the auto.mvfs file, you must restart autofs for those changes to go into effect.

  1. Stop ClearCase.
  2. Restart the automounter.
  3. Start ClearCase.

The specific syntax for restarting the automounter depends on the operating system platform.

Linux: systemctl restart autofs

Solaris: svcadm restart system/filesystem/autofs

AIX:  /usr/sbin/automount -f auto_master

VOB mount options

When a VOB tag is created, options such as ro or exportid might be defined. In the default configuration in which the cleartool mount -all command mounts all public VOBs when ClearCase is started, those options are read from the ClearCase registry and applied to the VOB mount. If a user calls cleartool mount and specifies mount options on the command line, cleartool will use the command line options and ignore the options from the VOB tag registry. This same precedence is implemented for VOB automounting, and a mount request that receives no explicit options from the automounter will use the VOB registry options. However, due to differences in each implementation of an OS of the automounter on some Linux systems, the automounter might insert global options that could cause the VOB tag registry options to be ignored.

We recommend that if you have defined VOB tag registry options, you should check the options on an automounted VOB. If tag options have not been passed through as expected, take the following steps:

  1. Modify the /etc/autofs.conf file in your system to set the option append_options to no (and uncomment that line in the file, if necessary).
  2. Modify the /etc/auto.mvfs file to uncomment the line that reads the mount options from the VOB registry entry:

    #
    # For RedHat platforms, if you would like to have the automounted
    # vob replace any automounter provided options
    # with the vob tag mount options, set APPEND_OPTIONS in autofs
    # config file to NO and uncomment out the following line.
    # if (/Mount options:/) mopts=(mopts "," $3 )

Known issues

The following table lists known issues.

Platform Issue
Linux only
  • When a private VOB has been automounted, subsequent use of the cleartool mount command to remount that same VOB might fail with a permission error.
  • On Ubuntu 16.04 and 18.04, when automounting is enabled and VOBs are exported for non-ClearCase access, a client system mounting the exported VOB using NFSv4 might receive the ESTALE error. NFSv3 mounting can be used as a workaround.
Solaris only
  • When automounting is enabled, the cleartool mount command will fail to mount a VOB that has a multilevel VOB tag. Automounting does work for these VOBs, but explicit cleartool mount will fail.
  • Any attempt to use cleartool mount to for a private VOB will fail with a permission error.
Linux and Solaris The following configuration file will not be preserved during a ClearCase version update:
/var/adm/rational/clearcase/no_vob_mount_on_startup
AIX only When automounting is enabled, if the cleartool mount -all command is issued, any unmounted public vobs are mounted, but an error message is displayed:

> cleartool mount -all
Mounting MVFS filesystem /vobs/test_vob.
vmount: A system call received a parameter that is not valid.

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSSH27","label":"Rational ClearCase"},"ARM Category":[{"code":"a8m50000000L0i5AAC","label":"ClearCase"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"10.0.0;10.0.1;9.0.2;9.1.0"}]

Document Information

Modified date:
03 October 2023

UID

ibm10738879