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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jun 21 14:17:00 CEST 2017


On Tue, Jun 20, 2017 at 10:39:53PM +0200, mir at datanom.net wrote:
> 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;

those two are not used anymore in v7, and are forbidden ;)

> +use LWP::UserAgent;
> +use HTTP::Status;
> +use JSON;
> +use Data::Dumper;

last one is not used either

> +
> +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.
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list