IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20155


Ignore:
Timestamp:
Oct 14, 2008, 3:56:00 PM (18 years ago)
Author:
jhoblitt
Message:

add neb-voladm util

Location:
trunk/Nebulous-Server
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Build.PL

    r19796 r20155  
    3838    },
    3939    script_files        => [qw(
    40         bin/neb-voladd
    4140        bin/neb-admin
    4241        bin/neb-fsck
    4342        bin/neb-initdb
     43        bin/neb-voladd
     44        bin/neb-voladm
    4445        bin/nebdiskd
    4546    )],
  • trunk/Nebulous-Server/Changes

    r20134 r20155  
    3232    - change nebdiskd to not do things that might imply a table level lock on
    3333      the mount table
     34    - add neb-voladm util
    3435
    35360.15 Thu Sep 11 13:00:59 HST 2008
  • trunk/Nebulous-Server/bin/neb-voladm

    r20147 r20155  
    33# Copyright (C) 2008  Joshua Hoblitt
    44#
    5 # $Id: neb-voladm,v 1.3 2008-10-14 21:56:04 jhoblitt Exp $
     5# $Id: neb-voladm,v 1.4 2008-10-15 01:56:00 jhoblitt Exp $
    66
    77use strict;
     
    118118=head1 NAME
    119119
    120 neb-voladm - manage Nebulous server storage volumes
     120neb-voladm - manage Nebulous storage volumes
    121121
    122122=head1 SYNOPSIS
    123123
    124     neb-addvol --volume <volume name> --uri <volume uri>
    125         [--db <database>] [--user <username>] [--pass <password>]
     124    neb-addvol [--vname <volume name>] [--vhost <volume host>]
     125    [--allocate <0|1>] [--available <0|1>] [--xattr <0|1>]
     126    [--host <db host> ] [--db <db name>] [--user <username>] [--pass <password>]
    126127
    127128=head1 DESCRIPTION
    128129
    129 This program initialize a database for use by L<Nebulous::Server> by creating
    130 the appropriate set of tables.  Any pre-existing tables with conflicting names
    131 are first removed.
     130This program manages a Nebulous server's list of known storage volumes.  the
     131appropriate set of tables.  Any pre-existing tables with conflicting names are
     132first removed.
    132133
    133134=head1 OPTIONS
     
    135136=over 4
    136137
    137 =item * --volume <volume name>
    138 
    139 Symbolic name of volume being added.
    140 
    141 =item * --uri|-u <volume uri>
    142 
    143 URI to the volume being added.
    144 
    145 =item * --db|-d <database>
     138=item * --vname <volume name>
     139
     140Symbolic name of the storage volume.
     141
     142Optional.
     143
     144=item * --vhost <volume host>
     145
     146Name of the host on which the storage volume(s) reside.
     147
     148Optional.
     149
     150=item * --allocate <0|1>
     151
     152=item * --available <0|1>
     153
     154=item * --xattr <0|1>
     155
     156Enables/Disables these flags on the storage volume.
     157
     158Requires either the C<--vname> or c<--vhost> options.
     159
     160=item * --db|-d <db name>
    146161
    147162Name of database (C<namespace>) to create tables in.
     
    149164Optional if the appropriate environment variable is set.
    150165
     166=item * --host <db host>
     167
     168Host name where the database resides.
     169
     170Defaults to C<localhost>.
     171
    151172=item * --user|-u <username>
    152173
     
    162183
    163184=back
     185
     186=head1 EXAMPLE USAGE
     187
     188=head2 Listing all volumes
     189
     190    $ neb-voladm
     191    host            name            mounted    allocate   available  xattr     
     192    ipp004          ipp004.0        1          0          1          0         
     193    ipp005          ipp005.0        1          0          1          0         
     194    ipp006          ipp006.0        1          1          1          0
     195    ...
     196
     197=head2 Listing just the volumes on host C<ipp025>
     198
     199    $ neb-voladm --vhost ipp025
     200    host            name            mounted    allocate   available  xattr     
     201    ipp025          ipp025.0        1          1          0          0     
     202
     203=head2 Listing just the volume symbolicly named C<ipp006.0>
     204
     205    $ neb-voladm -vname ipp006.0
     206    host            name            mounted    allocate   available  xattr     
     207    ipp006          ipp006.0        1          1          1          0   
     208
     209=head2 Turning the C<available> flag off for all volumes on the host named C<ipp012>
     210
     211    $ neb-voladm --vhost ipp012 --available 0
     212    host            name            mounted    allocate   available  xattr     
     213    ipp012          ipp012.0        0          1          0         
    164214
    165215=head1 ENVIRONMENT
     
    203253=head1 COPYRIGHT
    204254
    205 Copyright (C) 2005-2008  Joshua Hoblitt.  All rights reserved.
     255Copyright (C) 2008  Joshua Hoblitt.  All rights reserved.
    206256
    207257This program is free software; you can redistribute it and/or modify it under
     
    223273=head1 SEE ALSO
    224274
    225 L<Nebulous::Server>, L<neb-initdb>, L<neb-df>, L<nebdiskd>
     275L<Nebulous::Server>, L<neb-initdb>, L<neb-voladd>, L<nebdiskd>
    226276
    227277=cut
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r20145 r20155  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.73 2008-10-14 20:35:07 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.74 2008-10-15 01:56:00 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    277277    },
    278278    get_volumes => qq{
    279         SELECT v.vol_id, v.name, v.host, v.path, v.allocate, v.available, v.xattr, mountedvol.vol_id > 0 as mounted
    280         FROM volume as v
     279        SELECT
     280            v.vol_id,
     281            v.name,
     282            v.host,
     283            v.path,
     284            v.allocate,
     285            v.available,
     286            v.xattr,
     287            mountedvol.vol_id IS NOT NULL as mounted
     288        FROM volume AS v
    281289        LEFT JOIN mountedvol
    282290            USING(vol_id)
Note: See TracChangeset for help on using the changeset viewer.