Changeset 20155
- Timestamp:
- Oct 14, 2008, 3:56:00 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 4 edited
-
Build.PL (modified) (1 diff)
-
Changes (modified) (1 diff)
-
bin/neb-voladm (modified) (7 diffs)
-
lib/Nebulous/Server/SQL.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Build.PL
r19796 r20155 38 38 }, 39 39 script_files => [qw( 40 bin/neb-voladd41 40 bin/neb-admin 42 41 bin/neb-fsck 43 42 bin/neb-initdb 43 bin/neb-voladd 44 bin/neb-voladm 44 45 bin/nebdiskd 45 46 )], -
trunk/Nebulous-Server/Changes
r20134 r20155 32 32 - change nebdiskd to not do things that might imply a table level lock on 33 33 the mount table 34 - add neb-voladm util 34 35 35 36 0.15 Thu Sep 11 13:00:59 HST 2008 -
trunk/Nebulous-Server/bin/neb-voladm
r20147 r20155 3 3 # Copyright (C) 2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-voladm,v 1. 3 2008-10-14 21:56:04jhoblitt Exp $5 # $Id: neb-voladm,v 1.4 2008-10-15 01:56:00 jhoblitt Exp $ 6 6 7 7 use strict; … … 118 118 =head1 NAME 119 119 120 neb-voladm - manage Nebulous s erver storage volumes120 neb-voladm - manage Nebulous storage volumes 121 121 122 122 =head1 SYNOPSIS 123 123 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>] 126 127 127 128 =head1 DESCRIPTION 128 129 129 This program initialize a database for use by L<Nebulous::Server> by creating130 the appropriate set of tables. Any pre-existing tables with conflicting names 131 arefirst removed.130 This program manages a Nebulous server's list of known storage volumes. the 131 appropriate set of tables. Any pre-existing tables with conflicting names are 132 first removed. 132 133 133 134 =head1 OPTIONS … … 135 136 =over 4 136 137 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 140 Symbolic name of the storage volume. 141 142 Optional. 143 144 =item * --vhost <volume host> 145 146 Name of the host on which the storage volume(s) reside. 147 148 Optional. 149 150 =item * --allocate <0|1> 151 152 =item * --available <0|1> 153 154 =item * --xattr <0|1> 155 156 Enables/Disables these flags on the storage volume. 157 158 Requires either the C<--vname> or c<--vhost> options. 159 160 =item * --db|-d <db name> 146 161 147 162 Name of database (C<namespace>) to create tables in. … … 149 164 Optional if the appropriate environment variable is set. 150 165 166 =item * --host <db host> 167 168 Host name where the database resides. 169 170 Defaults to C<localhost>. 171 151 172 =item * --user|-u <username> 152 173 … … 162 183 163 184 =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 164 214 165 215 =head1 ENVIRONMENT … … 203 253 =head1 COPYRIGHT 204 254 205 Copyright (C) 200 5-2008 Joshua Hoblitt. All rights reserved.255 Copyright (C) 2008 Joshua Hoblitt. All rights reserved. 206 256 207 257 This program is free software; you can redistribute it and/or modify it under … … 223 273 =head1 SEE ALSO 224 274 225 L<Nebulous::Server>, L<neb-initdb>, L<neb- df>, L<nebdiskd>275 L<Nebulous::Server>, L<neb-initdb>, L<neb-voladd>, L<nebdiskd> 226 276 227 277 =cut -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r20145 r20155 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1.7 3 2008-10-14 20:35:07jhoblitt Exp $3 # $Id: SQL.pm,v 1.74 2008-10-15 01:56:00 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 277 277 }, 278 278 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 281 289 LEFT JOIN mountedvol 282 290 USING(vol_id)
Note:
See TracChangeset
for help on using the changeset viewer.
