[OpenAFS] Modifying the output of vos commands to include server UUIDs

Jason Edgecombe jason@rampaginggeek.com
Tue, 13 Apr 2010 21:10:58 -0400


Jeffrey Altman wrote:
> In 2002, the OpenAFS version of the "vos listaddrs" command was updated
> to include the Arla -printuuid and -noresolve options which permits the
> UUID and IP address of registered file servers to be displayed.  For
> example:
>
>   UUID: 006cab10-0e3e-1b20-a3-aa-2601a8c0aa77
>   24.193.47.88
>   192.168.122.1
>   192.168.1.38
>
> In 2008, the -noresolve option was made generic so that it could apply
> to all vos commands so that instead of seeing DNS names the actual IP
> addresses of server could be viewed.  This change was made because DNS
> name resolution often makes it appear that a file server is properly
> registered when instead it is in fact not.
>
> However, IP addresses are not the canonical method of identifying a file
> server.  For that the UUID is required and at the present time there is
> no mechanism when using vos listvldb or vos examine to identify the UUID
> of the server on which a volume is located.  This lack has come up
> several times in the #openafs IRC channel when attempting to help users
> setup new cells or add new file servers.  The most recent time on March
> 30th.
>
> Gerrit http://gerrit.openafs.org/#change,1742 is an attempt to add
> -printuuid as a standard option to all vos commands.  The only issue at
> the moment is what the format of the output should look like.  UUIDs and
> DNS names are long.  Extending the existing format to include the UUID
> inline with each server produces output that will not fit in an 80
> column terminal. 
>
> An example of "vos examine -printuuid" output:
>
> root.cell                         537870331 RW         42 K  On-line
>     ASCLEPIUS.MIT.EDU [0037555a-be36-19a6-a2-4d-5e3c0912aa77] /vicepr
>     RWrite  537870331 ROnly  537870333 Backup  537870332
>     MaxQuota        500 K
>     Creation    Fri Jun 06 12:24:21 2008
>     Copy        Thu Feb 26 11:43:23 2009
>     Backup      Tue Apr 13 02:00:17 2010
>     Last Update Thu Oct 18 12:44:23 2007
>     7647 accesses in the past day (i.e., vnode references)
>
>     RWrite: 537870331     ROnly: 537870333     Backup: 537870332
>     number of sites -> 4
>        server ASCLEPIUS.MIT.EDU [0037555a-be36-19a6-a2-4d-5e3c0912aa77]
> partition /vicepr RW Site
>        server ASCLEPIUS.MIT.EDU [0037555a-be36-19a6-a2-4d-5e3c0912aa77]
> partition /vicepr RO Site
>        server MNEMOSYNE.MIT.EDU [005d91e8-f824-19a6-aa-5c-613c0912aa77]
> partition /vicepr RO Site
>        server IXION.MIT.EDU [00086236-fa87-19a6-b4-de-ab015b12aa77]
> partition /vicepr RO Site
>
> An example of "vos listvldb -printuuid" output:
>
> root.cell
>     RWrite: 536870915     ROnly: 536870916
>     number of sites -> 4
>        server bethlehem.your-file-system.com
> [0008fa02-d48c-19b9-81-fc-419a1dccaa77] partition /vicepa RW Site
>        server bethlehem.your-file-system.com
> [0008fa02-d48c-19b9-81-fc-419a1dccaa77] partition /vicepa RO Site
>        server faultline.your-file-system.com
> [0007580a-7001-1aae-85-8e-2f9a1dccaa77] partition /vicepa RO Site
>        server cpe-24-193-47-88.nyc.res.rr.com
> [006cab10-0e3e-1b20-a3-aa-2601a8c0aa77] partition /vicepa RO Site
>
> One alternative output format that could be used when the -printuuid
> option is specified is found below.
>
> vos examine -printuuid:
>
> root.cell                         537870331 RW         42 K  On-line
>     UUID: 0037555a-be36-19a6-a2-4d-5e3c0912aa77
>     Server ASCLEPIUS.MIT.EDU
>     Partition /vicepr
>     RWrite  537870331 ROnly  537870333 Backup  537870332
>     MaxQuota        500 K
>     Creation    Fri Jun 06 12:24:21 2008
>     Copy        Thu Feb 26 11:43:23 2009
>     Backup      Tue Apr 13 02:00:17 2010
>     Last Update Thu Oct 18 12:44:23 2007
>     7647 accesses in the past day (i.e., vnode references)
>
>     RWrite: 537870331     ROnly: 537870333     Backup: 537870332
>     number of sites -> 4
>        RW Site
>               server ASCLEPIUS.MIT.EDU
>               uuid 0037555a-be36-19a6-a2-4d-5e3c0912aa77
>               partition /vicepr
>        RO Site
>               server ASCLEPIUS.MIT.EDU
>               uuid 0037555a-be36-19a6-a2-4d-5e3c0912aa77
>               partition /vicepr
>        RO Site
>               server MNEMOSYNE.MIT.EDU
>               uuid 005d91e8-f824-19a6-aa-5c-613c0912aa77
>               partition /vicepr
>        RO Site
>               server IXION.MIT.EDU
>               uuid 00086236-fa87-19a6-b4-de-ab015b12aa77
>               partition /vicepr
>
> vos listvldb -printuuid:
>
> root.cell
>     RWrite: 536870915     ROnly: 536870916
>     number of sites -> 4
>        RW Site
>               server bethlehem.your-file-system.com
>               uuid 0008fa02-d48c-19b9-81-fc-419a1dccaa77
>               partition /vicepa
>        RO Site
>               server bethlehem.your-file-system.com
>               uuid 0008fa02-d48c-19b9-81-fc-419a1dccaa77
>               partition /vicepa
>        RO Site
>               server faultline.your-file-system.com
>               uuid 0007580a-7001-1aae-85-8e-2f9a1dccaa77
>               partition /vicepa
>        RO Site
>               server cpe-24-193-47-88.nyc.res.rr.com
>               uuid 006cab10-0e3e-1b20-a3-aa-2601a8c0aa77
>               partition /vicepa
>
> Please offer your opinions.  As people have a variety of scripts that
> parse the output of vos commands to automate behaviors, we would not be
> changing the default output.  Any format change would only be used when
> the -printuuid option is specified.
>   
I like this output style best:
       RO Site
              server cpe-24-193-47-88.nyc.res.rr.com
              uuid 006cab10-0e3e-1b20-a3-aa-2601a8c0aa77
              partition /vicepa


If everything is put on one line, I would prefer the uuid column first. 
That way, the columns line up better.

Would it be possible to use a shortened form of the uuid like git uses 
short commit hash strings?

Jason