[pve-devel] [PATCH v7 pve-storage 01/10] FreeNAS storage plugin. Skeleton code.

mir at datanom.net mir at datanom.net
Tue Jun 20 22:39:53 CEST 2017


From: Michael Rasmussen <mir at datanom.net>

Signed-off-by: Michael Rasmussen <mir at datanom.net>
---
 PVE/Storage/FreeNASPlugin.pm | 66 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 PVE/Storage/FreeNASPlugin.pm

diff --git a/PVE/Storage/FreeNASPlugin.pm b/PVE/Storage/FreeNASPlugin.pm
new file mode 100644
index 0000000..cf33e68
--- /dev/null
+++ b/PVE/Storage/FreeNASPlugin.pm
@@ -0,0 +1,66 @@
+package PVE::Storage::FreeNASPlugin;
+
+use strict;
+use warnings;
+use POSIX;
+use PVE::Tools qw(run_command);
+use PVE::Storage::Plugin;
+use PVE::RPCEnvironment;
+use PVE::QemuServer;
+use PVE::LXC;
+use LWP::UserAgent;
+use HTTP::Status;
+use JSON;
+use Data::Dumper;
+
+use base qw(PVE::Storage::Plugin);
+
+# Configuration
+
+sub type {
+    return 'freenas';
+}
+
+sub plugindata {
+    return {
+        content => [ {images => 1, rootdir => 1}, {images => 1 , rootdir => 1} ],
+        format => [ { raw => 1 } , 'raw' ],
+    };
+}
+
+sub properties {
+    return {
+        password => {
+            description => "password",
+            type => "string",
+        },
+        portal_group => {
+            description => "Portal Group ID",
+            type => "integer",
+        },
+        initiator_group => {
+            description => "Initiator Group ID",
+            type => "integer",
+        },
+    };
+}
+
+sub options {
+    return {
+        portal => { fixed => 1 },
+        pool => { fixed => 1 },
+        portal_group => { fixed => 1 },
+        initiator_group => { fixed => 1 },
+#       blocksize => { optional => 1 }, not available in 9.2.x. Appear in 11.x
+        username => { optional => 1 },
+        password => { optional => 1 },
+#       sparse => { optional => 1 }, not available in 9.2.x. Appear in 11.x
+#                                    in 9.2.x all zvols are created sparse!
+        nodes => { optional => 1 },
+        disable => { optional => 1 },
+        content => { optional => 1 },
+    };
+}
+
+1;
+
-- 
2.11.0


----

This mail was virus scanned and spam checked before delivery.
This mail is also DKIM signed. See header dkim-signature.




More information about the pve-devel mailing list