]> git.proxmox.com Git - pve-storage.git/blobdiff - pvesm
parse_volname: document return values
[pve-storage.git] / pvesm
diff --git a/pvesm b/pvesm
index 47113ca7a79f708e7880ae87e6eaa5456b1d2640..60e71dc957454ed41261fe49c1072eb61cee35d7 100755 (executable)
--- a/pvesm
+++ b/pvesm
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use Getopt::Long;
 use Fcntl ':flock';
 use File::Path;
@@ -116,7 +117,7 @@ my $print_status = sub {
 my $nodename = PVE::INotify::nodename();
 
 my $cmddef = {
-    add => [ "PVE::API2::Storage::Config", 'create', ['storage'] ],
+    add => [ "PVE::API2::Storage::Config", 'create', ['type', 'storage'] ],
     set => [ "PVE::API2::Storage::Config", 'update', ['storage'] ],
     remove => [ "PVE::API2::Storage::Config", 'delete', ['storage'] ],
     status => [ "PVE::API2::Storage::Status", 'index', [],
@@ -143,6 +144,14 @@ my $cmddef = {
                         printf "%-${maxlen}s %s\n", $rec->{path}, $rec->{options};
                     }
                 }],
+    glusterfsscan => [ "PVE::API2::Storage::Scan", 'glusterfsscan', ['server'],
+                { node => $nodename }, sub  {
+                    my $res = shift;
+
+                    foreach my $rec (@$res) {
+                        printf "%s\n", $rec->{volname};
+                    }
+                }],
     iscsiscan => [ "PVE::API2::Storage::Scan", 'iscsiscan', ['server'],
                   { node => $nodename }, sub  {
                       my $res = shift;
@@ -163,6 +172,14 @@ my $cmddef = {
                         printf "$rec->{vg}\n";
                     }
                 }],
+    zfsscan => [ "PVE::API2::Storage::Scan", 'zfsscan', [],
+                { node => $nodename }, sub  {
+                    my $res = shift;
+
+                    foreach my $rec (@$res) {
+                        printf "$rec->{pool}\n";
+                    }
+                }],
     path => [ __PACKAGE__, 'path', ['volume']],
 };
 
@@ -221,11 +238,11 @@ To get the filesystem path for a <VOLUME_ID> use:
  pvesm scan nfs <HOST>
 
  # add storage pools
- pvesm add <STORAGE_ID> <TYPE> <OPTIONS>
- pvesm add <STORAGE_ID> dir --path <PATH>
- pvesm add <STORAGE_ID> nfs --path <PATH> --server <SERVER> --export <EXPORT>
- pvesm add <STORAGE_ID> lvm --vgname <VGNAME>
- pvesm add <STORAGE_ID> iscsi --portal <HOST[:PORT]> --target <TARGET>
+ pvesm add <TYPE> <STORAGE_ID> <OPTIONS>
+ pvesm add dir <STORAGE_ID> --path <PATH>
+ pvesm add nfs <STORAGE_ID> --path <PATH> --server <SERVER> --export <EXPORT>
+ pvesm add lvm <STORAGE_ID> --vgname <VGNAME>
+ pvesm add iscsi <STORAGE_ID> --portal <HOST[:PORT]> --target <TARGET>
 
  # disable storage pools
  pvesm set <STORAGE_ID> --disable 1