mirror of
https://github.com/TheGrandWazoo/freenas-proxmox.git
synced 2026-10-22 06:28:20 +02:00
chore: strip v2.x patch infrastructure — v3.0 clean slate
Remove everything that existed solely to wedge into PVE system files: - stable-5 through stable-8 versioned patch archives - pve-manager/js patch files (no more pvemanagerlib.js patching) - pve-docs/api-viewer patch files (no more apidoc.js patching) - perl5/PVE/Storage/LunCmd/ (replaced by PVE::Storage::Custom plugin) - perl5/PVE/Storage/ZFSPlugin-*.patch (no more ZFSPlugin.pm patching) Add perl5/PVE/Storage/Custom/FreeNAS.pm as the v3.0 starting point. v3.0 ships one .pm file; PVE discovers it automatically — zero patches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6ec31f76a7
commit
fbfb3f26e1
@@ -1,4 +0,0 @@
|
||||
/ZFSPlugin.pm
|
||||
/ZFSPoolPlugin.pm
|
||||
/ZFSPlugin-new.pm
|
||||
/ZFSPlugin-newver.patch
|
||||
@@ -0,0 +1,255 @@
|
||||
package PVE::Storage::Custom::TrueNASPlugin;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
use IO::File;
|
||||
use PVE::Tools qw(run_command trim file_read_firstline dir_glob_foreach);
|
||||
use PVE::Storage::Plugin;
|
||||
use PVE::JSONSchema qw(get_standard_option);
|
||||
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file);
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Request;
|
||||
use XML::Simple;
|
||||
|
||||
use base qw(PVE::Storage::Plugin);
|
||||
|
||||
# Configuration
|
||||
|
||||
# API version
|
||||
sub api {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub type {
|
||||
return 'truenas';
|
||||
}
|
||||
|
||||
sub plugindata {
|
||||
return {
|
||||
content => [ {images => 1}, { images => 1 }],
|
||||
};
|
||||
}
|
||||
|
||||
sub properties {
|
||||
return {
|
||||
freenas_user => {
|
||||
description => "FreeNAS API Username",
|
||||
type => 'string',
|
||||
},
|
||||
freenas_password => {
|
||||
description => "FreeNAS API Password",
|
||||
type => 'string',
|
||||
},
|
||||
freenas_use_ssl => {
|
||||
description => "FreeNAS API access via SSL",
|
||||
type => 'boolean',
|
||||
},
|
||||
freenas_apiv4_host => {
|
||||
description => "FreeNAS API Host",
|
||||
type => 'string',
|
||||
},
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
nowritecache => {
|
||||
description => "disable write caching on the target",
|
||||
type => 'boolean',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
sub options {
|
||||
return {
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
target => { fixed => 0 },
|
||||
pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
freenas_user => { optional => 1 },
|
||||
freenas_password => { optional => 1 },
|
||||
freenas_use_ssl => { optional => 1 },
|
||||
freenas_apiv4_host => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
sub properties {
|
||||
return {
|
||||
adminserver => {
|
||||
description => "Management IP or DNS name of storage.",
|
||||
type => 'string', format => 'pve-storage-server',
|
||||
},
|
||||
login => {
|
||||
description => "login",
|
||||
type => 'string',
|
||||
},
|
||||
password => {
|
||||
description => "password",
|
||||
type => 'string',
|
||||
},
|
||||
igroup => {
|
||||
description => "Initiator group name",
|
||||
type => 'string',
|
||||
},
|
||||
api => {
|
||||
description => "API version (7 or 8)",
|
||||
type => 'string',
|
||||
},
|
||||
media => {
|
||||
description => "iscsi/multipath",
|
||||
type => 'string',
|
||||
default => 'multipath',
|
||||
enum => ['iscsi', 'multipath'],
|
||||
},
|
||||
efficiency => {
|
||||
description => "Enable Storage Efficiency",
|
||||
type => 'boolean',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
sub options {
|
||||
return {
|
||||
adminserver => { fixed => 1 },
|
||||
login => { fixed => 1 },
|
||||
password => { optional => 1 },
|
||||
vserver => { optional => 1 },
|
||||
aggregate => { fixed => 1 },
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
igroup => { optional => 1 },
|
||||
api => { optional => 1 },
|
||||
media => { optional => 1 },
|
||||
target => { optional => 1 },
|
||||
shared => { optional => 1 },
|
||||
efficiency => { optional => 1 },
|
||||
}
|
||||
}
|
||||
|
||||
sub truenas_connect {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
my $scheme = $scfg->{freenas_use_ssl} ? "https" : "http";
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
if (! defined $freenas_server_list->{$apihost}) {
|
||||
$freenas_server_list->{$apihost} = REST::Client->new();
|
||||
}
|
||||
$freenas_server_list->{$apihost}->setHost($scheme . '://' . $apihost);
|
||||
$freenas_server_list->{$apihost}->addHeader('Content-Type', 'application/json');
|
||||
$freenas_server_list->{$apihost}->addHeader('Authorization', 'Basic ' . encode_base64($scfg->{freenas_user} . ':' . $scfg->{freenas_password}));
|
||||
# If using SSL, don't verify SSL certs
|
||||
if ($scfg->{freenas_use_ssl}) {
|
||||
$freenas_server_list->{$apihost}->getUseragent()->ssl_opts(verify_hostname => 0);
|
||||
$freenas_server_list->{$apihost}->getUseragent()->ssl_opts(SSL_verify_mode => SSL_VERIFY_NONE);
|
||||
}
|
||||
# Check if the APIs are accessable via the selected host and scheme
|
||||
my $code = $freenas_server_list->{$apihost}->request('GET', $apiping)->responseCode();
|
||||
if ($code == 200) { # Successful connection
|
||||
syslog("info", (caller(0))[3] . " : REST connection successful to '" . $apihost . "' using the '" . $scheme . "' protocol");
|
||||
$runawayprevent = 0;
|
||||
} elsif ($runawayprevent > 1) { # Make sure we are not recursion calling.
|
||||
truenas_log_error($freenas_server_list->{$apihost}, "truenas_connect");
|
||||
die "Loop recursion prevention";
|
||||
} elsif ($code == 302) { # A 302 from FreeNAS means it doesn't like v1.0 APIs.
|
||||
syslog("info", (caller(0))[3] . " : Changing to v2.0 API's");
|
||||
$runawayprevent++;
|
||||
$apiping =~ s/v1\.0/v2\.0/;
|
||||
truenas_connect($scfg);
|
||||
} elsif ($code == 307) { # A 307 from FreeNAS means rediect http to https.
|
||||
syslog("info", (caller(0))[3] . " : Redirecting to HTTPS protocol");
|
||||
$runawayprevent++;
|
||||
$scfg->{freenas_use_ssl} = 1;
|
||||
truenas_connect($scfg);
|
||||
} else { # For now, any other code we fail.
|
||||
truenas_log_error($freenas_server_list->{$apihost}, "truenas_connect");
|
||||
die "Unable to connect to the FreeNAS API service at '" . $apihost . "' using the '" . $scheme . "' protocol";
|
||||
}
|
||||
$freenas_rest_connection = $freenas_server_list->{$apihost};
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# Check to see what FreeNAS version we are running and set
|
||||
# the FreeNAS.pm to use the correct API version of FreeNAS
|
||||
#
|
||||
sub truenas_check {
|
||||
my ($scfg, $timeout) = @_;
|
||||
my $result = {};
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
if (! defined $freenas_rest_connection->{$apihost}) {
|
||||
truenas_connect($scfg);
|
||||
eval {
|
||||
$result = decode_json($freenas_rest_connection->responseContent());
|
||||
};
|
||||
if ($@) {
|
||||
$result->{'fullversion'} = $freenas_rest_connection->responseContent();
|
||||
$result->{'fullversion'} =~ s/^"//g;
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result->{'fullversion'});
|
||||
$result->{'fullversion'} =~ s/^(\w+)\-(\d+)\.(\d+)\-(?:U|BETA)(\d?)\.?(\d?)//;
|
||||
my $freenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $4 || 0, $5 || 0);
|
||||
$product_name = $1;
|
||||
syslog("info", (caller(0))[3] . " : ". $product_name . " Unformatted Version: " . $freenas_version);
|
||||
if ($freenas_version >= 11030100) {
|
||||
$freenas_api_version = "v2.0";
|
||||
$dev_prefix = "/dev/";
|
||||
}
|
||||
} else {
|
||||
syslog("info", (caller(0))[3] . " : REST Client already initialized");
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : Using " . $product_name ." API version " . $freenas_api_version);
|
||||
$freenas_api_methods = $freenas_api_version_matrix->{$freenas_api_version}->{'methods'};
|
||||
$freenas_api_variables = $freenas_api_version_matrix->{$freenas_api_version}->{'variables'};
|
||||
$freenas_global_config = $freenas_global_config_list->{$apihost} = (!defined($freenas_global_config_list->{$apihost})) ? freenas_iscsi_get_globalconfiguration($scfg) : $freenas_global_config_list->{$apihost};
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
### FREENAS API CALLING ROUTINE ###
|
||||
#
|
||||
sub truenas_request {
|
||||
my ($scfg, $method, $path, $data) = @_;
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called for host '" . $apihost . "'");
|
||||
|
||||
$method = uc($method);
|
||||
if (! $method =~ /^(?>GET|DELETE|POST)$/) {
|
||||
syslog("info", (caller(0))[3] . " : Invalid HTTP RESTful service method '$method'");
|
||||
die "Invalid HTTP RESTful service method '$method' used.";
|
||||
}
|
||||
|
||||
if (! defined $freenas_server_list->{$apihost}) {
|
||||
freenas_api_check($scfg);
|
||||
}
|
||||
$freenas_rest_connection = $freenas_server_list->{$apihost};
|
||||
$freenas_global_config = $freenas_global_config_list->{$apihost};
|
||||
my $json_data = (defined $data) ? encode_json($data) : undef;
|
||||
$freenas_rest_connection->$method($path, $json_data);
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# Writes the Response and Content to SysLog
|
||||
#
|
||||
sub freenas_api_log_error {
|
||||
my ($method) = @_;
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response code: " . $freenas_rest_connection->responseCode());
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response content: " . $freenas_rest_connection->responseContent());
|
||||
return 1;
|
||||
}
|
||||
@@ -1,905 +0,0 @@
|
||||
package PVE::Storage::LunCmd::FreeNAS;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION = '2.4.0';
|
||||
use Data::Dumper;
|
||||
use PVE::SafeSyslog;
|
||||
use IO::Socket::SSL;
|
||||
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Request;
|
||||
use REST::Client;
|
||||
use MIME::Base64;
|
||||
use JSON;
|
||||
|
||||
# Global variable definitions
|
||||
my $MAX_LUNS = 255; # Max LUNS per target on the iSCSI server
|
||||
my $freenas_server_list = {}; # Per-host state: {client, product_name, api_version, dev_prefix, runaway_count}
|
||||
my $freenas_rest_connection = undef; # REST::Client for the current active host
|
||||
my $freenas_global_config_list = {}; # Per-host iSCSI global config cache
|
||||
my $freenas_global_config = undef; # Pointer to entry in $freenas_global_config_list
|
||||
my $dev_prefix = "";
|
||||
my $product_name = undef;
|
||||
|
||||
# FreeNAS API definitions
|
||||
my $freenas_api_version = "v1.0"; # Default to v1.0 of the API's
|
||||
my $freenas_api_methods = undef; # API Methods Nested HASH Ref
|
||||
my $freenas_api_variables = undef; # API Variable Nested HASH Ref
|
||||
my $truenas_version = undef;
|
||||
my $truenas_release_type = "Production";
|
||||
|
||||
# FreeNAS/TrueNAS (CORE) API Versioning HashRef Matrix
|
||||
my $freenas_api_version_matrix = {
|
||||
"v1.0" => {
|
||||
"methods" => {
|
||||
"config" => {
|
||||
"resource" => "/api/v1.0/services/iscsi/globalconfiguration/",
|
||||
},
|
||||
"target" => {
|
||||
"resource" => "/api/v1.0/services/iscsi/target/",
|
||||
},
|
||||
"extent" => {
|
||||
"resource" => "/api/v1.0/services/iscsi/extent/",
|
||||
"post_body" => {
|
||||
"iscsi_target_extent_type" => "Disk",
|
||||
"iscsi_target_extent_name" => "\$name",
|
||||
"iscsi_target_extent_disk" => "\$device",
|
||||
},
|
||||
},
|
||||
"targetextent" => {
|
||||
"resource" => "/api/v1.0/services/iscsi/targettoextent/",
|
||||
"post_body" => {
|
||||
"iscsi_target" => "\$target_id",
|
||||
"iscsi_extent" => "\$extent_id",
|
||||
"iscsi_lunid" => "\$lun_id",
|
||||
},
|
||||
},
|
||||
},
|
||||
"variables" => {
|
||||
"basename" => "iscsi_basename",
|
||||
"lunid" => "iscsi_lunid",
|
||||
"extentid" => "iscsi_extent",
|
||||
"targetid" => "iscsi_target",
|
||||
"extentpath" => "iscsi_target_extent_path",
|
||||
"extentnaa" => "iscsi_target_extent_naa",
|
||||
"targetname" => "iscsi_target_name",
|
||||
}
|
||||
},
|
||||
"v2.0" => {
|
||||
"methods" => {
|
||||
"config" => {
|
||||
"resource" => "/api/v2.0/iscsi/global",
|
||||
},
|
||||
"target" => {
|
||||
"resource" => "/api/v2.0/iscsi/target/",
|
||||
},
|
||||
"extent" => {
|
||||
"resource" => "/api/v2.0/iscsi/extent/",
|
||||
"delete_body" => {
|
||||
"remove" => \1,
|
||||
"force" => \1,
|
||||
},
|
||||
"post_body" => {
|
||||
"type" => "DISK",
|
||||
"name" => "\$name",
|
||||
"disk" => "\$device",
|
||||
},
|
||||
},
|
||||
"targetextent" => {
|
||||
"resource" => "/api/v2.0/iscsi/targetextent/",
|
||||
"delete_body" => {
|
||||
"force" => \1,
|
||||
},
|
||||
"post_body" => {
|
||||
"target" => "\$target_id",
|
||||
"extent" => "\$extent_id",
|
||||
"lunid" => "\$lun_id",
|
||||
},
|
||||
},
|
||||
},
|
||||
"variables" => {
|
||||
"basename" => "basename",
|
||||
"lunid" => "lunid",
|
||||
"extentid" => "extent",
|
||||
"targetid" => "target",
|
||||
"extentpath" => "path",
|
||||
"extentnaa" => "naa",
|
||||
"targetname" => "name",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub get_base {
|
||||
return '/dev/zvol';
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Subroutine called from ZFSPlugin.pm
|
||||
#
|
||||
sub run_lun_command {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
syslog("info",(caller(0))[3] . " : $method(@params)");
|
||||
|
||||
if (defined($scfg->{'truenas_token_auth'}) && $scfg->{'truenas_token_auth'}) {
|
||||
if (!defined($scfg->{'truenas_secret'})) {
|
||||
die "Undefined `truenas_secret` variable.";
|
||||
}
|
||||
} elsif (!defined($scfg->{'freenas_user'}) || !defined($scfg->{'freenas_password'})) {
|
||||
die "Undefined `freenas_user` and/or `freenas_password` variables.";
|
||||
}
|
||||
if (!defined $freenas_server_list->{defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal}}) {
|
||||
freenas_api_check($scfg);
|
||||
}
|
||||
|
||||
if($method eq "create_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "delete_lu") {
|
||||
return run_delete_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "import_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "modify_lu") {
|
||||
return run_modify_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "add_view") {
|
||||
return run_add_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_view") {
|
||||
return run_list_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_extent") {
|
||||
return run_list_extent($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_lu") {
|
||||
return run_list_lu($scfg, $timeout, $method, "name", @params);
|
||||
}
|
||||
|
||||
syslog("error",(caller(0))[3] . " : unknown method $method");
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_add_view {
|
||||
return '';
|
||||
}
|
||||
|
||||
#
|
||||
# a modify_lu occur by example on a zvol resize. we just need to destroy and recreate the lun with the same zvol.
|
||||
# Be careful, the first param is the new size of the zvol, we must shift params
|
||||
#
|
||||
sub run_modify_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
shift(@params);
|
||||
run_delete_lu($scfg, $timeout, $method, @params);
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_view {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
return run_list_lu($scfg, $timeout, $method, "lun-id", @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
# Optimized
|
||||
sub run_list_lu {
|
||||
my ($scfg, $timeout, $method, $result_value_type, @params) = @_;
|
||||
my $object = $params[0];
|
||||
my $result = undef;
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
syslog("info", (caller(0))[3] . " : called with (method: '$method'; result_value_type: '$result_value_type'; param[0]: '$object')");
|
||||
|
||||
$object =~ s/^\Q$dev_prefix//;
|
||||
syslog("info", (caller(0))[3] . " : TrueNAS object to find: '$object'");
|
||||
if (defined($luns->{$object})) {
|
||||
my $lu_object = $luns->{$object};
|
||||
$result = $result_value_type eq "lun-id" ? $lu_object->{$freenas_api_variables->{'lunid'}} : $dev_prefix . $lu_object->{$freenas_api_variables->{'extentpath'}};
|
||||
syslog("info",(caller(0))[3] . " '$object' with key '$result_value_type' found with value: '$result'");
|
||||
} else {
|
||||
syslog("info", (caller(0))[3] . " '$object' with key '$result_value_type' was not found");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
# Optimzed
|
||||
sub run_list_extent {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
my $object = $params[0];
|
||||
syslog("info", (caller(0))[3] . " : called with (method: '$method'; params[0]: '$object')");
|
||||
my $result = undef;
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
|
||||
$object =~ s/^\Q$dev_prefix//;
|
||||
syslog("info", (caller(0))[3] . " TrueNAS object to find: '$object'");
|
||||
if (defined($luns->{$object})) {
|
||||
my $lu_object = $luns->{$object};
|
||||
$result = $lu_object->{$freenas_api_variables->{'extentnaa'}};
|
||||
syslog("info",(caller(0))[3] . " '$object' with key '$freenas_api_variables->{'extentnaa'}' found with value: '$result'");
|
||||
} else {
|
||||
syslog("info",(caller(0))[3] . " '$object' with key '$freenas_api_variables->{'extentnaa'}' was not found");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_create_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
my $lun_path = $params[0];
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (method=$method; param[0]=$lun_path)");
|
||||
|
||||
my $lun_id = freenas_get_first_available_lunid($scfg);
|
||||
|
||||
die "Maximum number of LUNs per target is $MAX_LUNS" if scalar $lun_id >= $MAX_LUNS;
|
||||
die "$params[0]: LUN $lun_path exists" if defined(run_list_lu($scfg, $timeout, $method, "name", @params));
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
my ($extent_id, $link_id);
|
||||
eval {
|
||||
my $extent = freenas_iscsi_create_extent($scfg, $lun_path);
|
||||
die "Unable to create extent for $lun_path" if !defined($extent);
|
||||
$extent_id = $extent->{'id'};
|
||||
|
||||
my $link = freenas_iscsi_create_target_to_extent($scfg, $target_id, $extent_id, $lun_id);
|
||||
die "Unable to link extent to target for $lun_path" if !defined($link);
|
||||
$link_id = $link->{'id'};
|
||||
|
||||
# Set FREENAS_TEST_ROLLBACK=1 in pvedaemon environment to exercise
|
||||
# rollback without a real failure (#239)
|
||||
die "TEST: forced rollback for #239 verification" if $ENV{FREENAS_TEST_ROLLBACK};
|
||||
};
|
||||
if (my $err = $@) {
|
||||
syslog("err", (caller(0))[3] . " : rolling back after error for $lun_path: $err");
|
||||
freenas_iscsi_remove_target_to_extent($scfg, $link_id) if defined $link_id;
|
||||
freenas_iscsi_remove_extent($scfg, $extent_id) if defined $extent_id;
|
||||
freenas_delete_zvol($scfg, $lun_path) if defined $extent_id;
|
||||
die "Unable to create lun $lun_path (rolled back): $err";
|
||||
}
|
||||
|
||||
syslog("info", (caller(0))[3] . "(lun_path=$lun_path, lun_id=$lun_id) : successful");
|
||||
return "";
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
# Optimzied
|
||||
sub run_delete_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
my $lun_path = $params[0];
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (method: '$method'; param[0]: '$lun_path')");
|
||||
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
my $lun = undef;
|
||||
my $link = undef;
|
||||
$lun_path =~ s/^\Q$dev_prefix//;
|
||||
|
||||
if (defined($luns->{$lun_path})) {
|
||||
$lun = $luns->{$lun_path};
|
||||
syslog("info",(caller(0))[3] . " lun: '$lun_path' found");
|
||||
} else {
|
||||
die "Unable to find the lun $lun_path for $scfg->{target}";
|
||||
}
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
# find the target to extent
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
|
||||
syslog("info", (caller(0))[3] . " : searching for 'targetextent' with (target_id=$target_id; lun_id=$lun->{$freenas_api_variables->{'lunid'}}; extent_id=$lun->{id})");
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{$freenas_api_variables->{'targetid'}} == $target_id &&
|
||||
$item->{$freenas_api_variables->{'lunid'}} == $lun->{$freenas_api_variables->{'lunid'}} &&
|
||||
$item->{$freenas_api_variables->{'extentid'}} == $lun->{'id'}) {
|
||||
$link = $item;
|
||||
syslog("info", (caller(0))[3] . " : found 'targetextent'(target_id=$item->{$freenas_api_variables->{'targetid'}}; lun_id=$item->{$freenas_api_variables->{'lunid'}}; extent_id=$item->{$freenas_api_variables->{'extentid'}})");
|
||||
last;
|
||||
}
|
||||
}
|
||||
die "Unable to find the link for the lun $lun_path for $scfg->{target}" if !defined($link);
|
||||
|
||||
# Remove the extent
|
||||
my $remove_extent = freenas_iscsi_remove_extent($scfg, $lun->{'id'});
|
||||
|
||||
# Remove the link
|
||||
my $remove_link = freenas_iscsi_remove_target_to_extent($scfg, $link->{'id'});
|
||||
|
||||
# NOTE: zvol deletion is intentionally left to ZFSPlugin's SSH path (zfs_delete_zvol).
|
||||
# Deleting it here caused a double-delete: SSH would fail, ZFSPlugin's error recovery
|
||||
# would call run_create_lu on a missing zvol, producing a false "Unable to create lun"
|
||||
# error in the task log (#240). freenas_delete_zvol belongs only in run_create_lu's
|
||||
# rollback path (#239).
|
||||
|
||||
if($remove_link == 1 && $remove_extent == 1) {
|
||||
syslog("info", (caller(0))[3] . "(lun_path=$lun_path) : successful");
|
||||
} else {
|
||||
die "Unable to delete lun $lun_path";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
sub freenas_api_connect {
|
||||
my ($scfg, $ping) = @_;
|
||||
$ping //= '/api/v1.0/system/version/';
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
my $scheme = $scfg->{freenas_use_ssl} ? "https" : "http";
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
if (!defined $freenas_server_list->{$apihost} || !defined $freenas_server_list->{$apihost}{client}) {
|
||||
$freenas_server_list->{$apihost} = {
|
||||
client => REST::Client->new(),
|
||||
product_name => undef,
|
||||
api_version => 'v1.0',
|
||||
dev_prefix => '',
|
||||
runaway_count => 0,
|
||||
};
|
||||
}
|
||||
my $host = $freenas_server_list->{$apihost};
|
||||
$host->{client}->setHost($scheme . '://' . $apihost);
|
||||
$host->{client}->addHeader('Content-Type', 'application/json');
|
||||
if (defined($scfg->{'truenas_token_auth'}) && $scfg->{'truenas_token_auth'}) {
|
||||
syslog("info", (caller(0))[3] . " : Authentication using Bearer Token Auth");
|
||||
if (!$scfg->{freenas_use_ssl}) {
|
||||
syslog("warn", (caller(0))[3] . " : Bearer Token used without SSL — TrueNAS 25.04+ revokes API keys sent over plain HTTP; enable 'Use SSL' in storage config");
|
||||
}
|
||||
$host->{client}->addHeader('Authorization', 'Bearer ' . $scfg->{truenas_secret});
|
||||
} else {
|
||||
syslog("warn", (caller(0))[3] . " : Authentication using Basic Auth (username/password) -- DEPRECATED. Generate an API key in TrueNAS and switch to token auth. Basic auth will be removed in v3.0.0.");
|
||||
$host->{client}->addHeader('Authorization', 'Basic ' . encode_base64($scfg->{freenas_user} . ':' . $scfg->{freenas_password}));
|
||||
}
|
||||
# If using SSL, don't verify SSL certs
|
||||
if ($scfg->{freenas_use_ssl}) {
|
||||
$host->{client}->getUseragent()->ssl_opts(verify_hostname => 0);
|
||||
$host->{client}->getUseragent()->ssl_opts(SSL_verify_mode => SSL_VERIFY_NONE);
|
||||
}
|
||||
# Check if the APIs are accessible via the selected host and scheme
|
||||
my $api_response = $host->{client}->request('GET', $ping);
|
||||
my $code = $api_response->responseCode();
|
||||
my $type = $api_response->responseHeader('Content-Type');
|
||||
syslog("info", (caller(0))[3] . " : REST connection header Content-Type:'" . $type . "'");
|
||||
|
||||
# Make sure we are not recursion calling.
|
||||
if ($host->{runaway_count} > 2) {
|
||||
freenas_api_log_error($host->{client});
|
||||
die "Loop recursion prevention";
|
||||
# Successful connection
|
||||
} elsif ($code == 200 && ($type =~ /^text\/plain/ || $type =~ /^application\/json/)) {
|
||||
syslog("info", (caller(0))[3] . " : REST connection successful to '" . $apihost . "' using the '" . $scheme . "' protocol");
|
||||
$host->{runaway_count} = 0;
|
||||
# A 302 or 200 (wrong content-type) means v1.0 is redirecting — upgrade to v2.0.
|
||||
# TrueNAS 25.04+ removed v1.0 entirely and returns 404 instead of 302; treat
|
||||
# that the same way so long as we are still probing the v1.0 endpoint.
|
||||
} elsif ($code == 302 || $code == 200 || ($code == 404 && $ping =~ /v1\.0/)) {
|
||||
syslog("info", (caller(0))[3] . " : v1.0 API unavailable (HTTP $code) — upgrading to v2.0");
|
||||
$host->{runaway_count}++;
|
||||
$ping =~ s/v1\.0/v2\.0/;
|
||||
freenas_api_connect($scfg, $ping);
|
||||
# A 307 from FreeNAS means redirect http to https.
|
||||
} elsif ($code == 307) {
|
||||
syslog("info", (caller(0))[3] . " : Redirecting to HTTPS protocol");
|
||||
$host->{runaway_count}++;
|
||||
$scfg->{freenas_use_ssl} = 1;
|
||||
freenas_api_connect($scfg, $ping);
|
||||
# For now, any other code we fail.
|
||||
} else {
|
||||
freenas_api_log_error($host->{client});
|
||||
die "Unable to connect to the FreeNAS API service at '" . $apihost . "' using the '" . $scheme . "' protocol";
|
||||
}
|
||||
$freenas_rest_connection = $host->{client};
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# Check to see what FreeNAS version we are running and set
|
||||
# the FreeNAS.pm to use the correct API version of FreeNAS
|
||||
#
|
||||
sub freenas_api_check {
|
||||
my ($scfg, $timeout) = @_;
|
||||
my $result = {};
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
if (!defined $freenas_server_list->{$apihost}{client}) {
|
||||
freenas_api_connect($scfg);
|
||||
$result = $freenas_rest_connection->responseContent();
|
||||
$result =~ s/"//g;
|
||||
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result);
|
||||
if ($result =~ /^(TrueNAS|FreeNAS)-(\d+)\.(\d+)\-U(\d+)(?(?=\.)\.(\d+))$/) {
|
||||
$product_name = $1;
|
||||
$truenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $4 || 0, $5 || 0);
|
||||
} elsif ($result =~ /^(TrueNAS)-(\d+)\.(\d+)(?(?=\-U\d+)-U(\d+)|-\w+)(?(?=\.).(\d+))$/) {
|
||||
$product_name = $1;
|
||||
$truenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $4 || 0, $6 || 0);
|
||||
$truenas_release_type = $5 || "Production";
|
||||
} elsif ($result =~ /^(TrueNAS-SCALE)-(\d+)\.(\d+)(?(?=\-)-(\w+))\.(\d+)(?(?=\.)\.(\d+))(?(?=\-)-(\d+))$/) {
|
||||
$product_name = $1;
|
||||
$truenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $5 || 0, $7 || 0);
|
||||
$truenas_release_type = $4 || "Production";
|
||||
} else {
|
||||
$product_name = "Unknown";
|
||||
$truenas_release_type = "Unknown";
|
||||
syslog("error", (caller(0))[3] . " : Could not parse the version of TrueNAS.");
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : ". $product_name . " Unformatted Version: " . $truenas_version);
|
||||
if ($truenas_version >= 11030100) {
|
||||
$freenas_api_version = "v2.0";
|
||||
$dev_prefix = "/dev/";
|
||||
}
|
||||
if ($truenas_release_type ne "Production") {
|
||||
syslog("warn", (caller(0))[3] . " : The '" . $product_name . "' release type of '" . $truenas_release_type . "' may not worked due to unsupported changes.");
|
||||
}
|
||||
# Save per-host metadata so subsequent calls restore state correctly
|
||||
$freenas_server_list->{$apihost}{product_name} = $product_name;
|
||||
$freenas_server_list->{$apihost}{api_version} = $freenas_api_version;
|
||||
$freenas_server_list->{$apihost}{dev_prefix} = $dev_prefix;
|
||||
} else {
|
||||
syslog("info", (caller(0))[3] . " : REST Client already initialized");
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : Using " . $product_name . " API version " . $freenas_api_version);
|
||||
$freenas_api_methods = $freenas_api_version_matrix->{$freenas_api_version}->{'methods'};
|
||||
$freenas_api_variables = $freenas_api_version_matrix->{$freenas_api_version}->{'variables'};
|
||||
$freenas_global_config = $freenas_global_config_list->{$apihost} = (!defined($freenas_global_config_list->{$apihost})) ? freenas_iscsi_get_globalconfiguration($scfg) : $freenas_global_config_list->{$apihost};
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
### FREENAS API CALLING ROUTINE ###
|
||||
#
|
||||
sub freenas_api_call {
|
||||
my ($scfg, $method, $path, $data) = @_;
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called for host '" . $apihost . "'");
|
||||
|
||||
$method = uc($method);
|
||||
if ($method !~ /^(?:GET|DELETE|POST)$/) {
|
||||
syslog("info", (caller(0))[3] . " : Invalid HTTP RESTful service method '$method'");
|
||||
die "Invalid HTTP RESTful service method '$method' used.";
|
||||
}
|
||||
|
||||
if (!defined $freenas_server_list->{$apihost}{client}) {
|
||||
freenas_api_check($scfg);
|
||||
}
|
||||
my $host = $freenas_server_list->{$apihost};
|
||||
$freenas_rest_connection = $host->{client};
|
||||
$freenas_global_config = $freenas_global_config_list->{$apihost};
|
||||
$product_name = $host->{product_name};
|
||||
$dev_prefix = $host->{dev_prefix};
|
||||
$freenas_api_methods = $freenas_api_version_matrix->{$host->{api_version}}{methods};
|
||||
$freenas_api_variables = $freenas_api_version_matrix->{$host->{api_version}}{variables};
|
||||
my $json_data = (defined $data) ? encode_json($data) : undef;
|
||||
$freenas_rest_connection->request($method, $path, $json_data);
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# Writes the Response and Content to SysLog
|
||||
#
|
||||
sub freenas_api_log_error {
|
||||
my ($rest_connection) = @_;
|
||||
my $connection = ((defined $rest_connection) ? $rest_connection : $freenas_rest_connection);
|
||||
syslog("info","[ERROR]FreeNAS::API::" . (caller(1))[3] . " : Response code: " . $connection->responseCode());
|
||||
syslog("info","[ERROR]FreeNAS::API::" . (caller(1))[3] . " : Response content: " . $connection->responseContent());
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub freenas_iscsi_get_globalconfiguration {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
freenas_api_call($scfg, 'GET', $freenas_api_methods->{'config'}->{'resource'}, $freenas_api_methods->{'config'}->{'get'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", (caller(0))[3] . " : target_basename=" . $result->{$freenas_api_variables->{'basename'}});
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all extents.
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-extent-
|
||||
#
|
||||
sub freenas_iscsi_get_extent {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
freenas_api_call($scfg, 'GET', $freenas_api_methods->{'extent'}->{'resource'} . "?limit=0", $freenas_api_methods->{'extent'}->{'get'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Create an extent on FreeNas
|
||||
# http://api.freenas.org/resources/iscsi/index.html#create-resource
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - lun_path
|
||||
#
|
||||
sub freenas_iscsi_create_extent {
|
||||
my ($scfg, $lun_path) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (lun_path=$lun_path)");
|
||||
|
||||
my $name = $lun_path;
|
||||
$name =~ s/^.*\///; # all from last /
|
||||
|
||||
my $pool = $scfg->{'pool'};
|
||||
# If TrueNAS-SCALE the slashes (/) need to be converted to dashes (-)
|
||||
if ($product_name eq "TrueNAS-SCALE") {
|
||||
$pool =~ s/\//-/g;
|
||||
syslog("info", (caller(0))[3] . " : TrueNAS-SCALE slash to dash conversion '" . $pool ."'");
|
||||
}
|
||||
$name = $pool . ($product_name eq "TrueNAS-SCALE" ? '-' : '/') . $name;
|
||||
syslog("info", (caller(0))[3] . " : " . $product_name . " extent '". $name . "'");
|
||||
|
||||
my $device = $lun_path;
|
||||
$device =~ s/^\/dev\///; # strip /dev/
|
||||
|
||||
my %extent_vars = ('$name' => $name, '$device' => $device);
|
||||
my $post_body = {};
|
||||
while ((my $key, my $value) = each %{$freenas_api_methods->{'extent'}->{'post_body'}}) {
|
||||
$post_body->{$key} = exists $extent_vars{$value} ? $extent_vars{$value} : $value;
|
||||
}
|
||||
|
||||
freenas_api_call($scfg, 'POST', $freenas_api_methods->{'extent'}->{'resource'}, $post_body);
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200 || $code == 201) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", "FreeNAS::API::create_extent(lun_path=" . $result->{$freenas_api_variables->{'extentpath'}} . ") : successful");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Explicitly delete the underlying ZFS zvol via the pool/dataset API.
|
||||
# The extent DELETE with remove:true is unreliable on TrueNAS SCALE 24.10+
|
||||
# (extent config is removed but the zvol is left behind). This function
|
||||
# is a belt-and-suspenders call after every extent removal.
|
||||
# Only runs on v2.0; v1.0 hosts are expected to handle it via remove:true.
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - lun_path (either /dev/zvol/tank/... or zvol/tank/... form)
|
||||
#
|
||||
sub freenas_delete_zvol {
|
||||
my ($scfg, $lun_path) = @_;
|
||||
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
my $api_version = ($freenas_server_list->{$apihost}{api_version} // $freenas_api_version) // '';
|
||||
return 1 unless $api_version eq 'v2.0';
|
||||
|
||||
my $dataset = $lun_path;
|
||||
$dataset =~ s{^/dev/zvol/}{}; # strip /dev/zvol/ prefix (run_create_lu form)
|
||||
$dataset =~ s{^zvol/}{}; # strip zvol/ prefix (run_delete_lu form after $dev_prefix strip)
|
||||
$dataset =~ s{/}{%2F}g; # URL-encode path separators for REST endpoint
|
||||
|
||||
syslog("info", (caller(0))[3] . " : explicitly deleting zvol dataset '$dataset'");
|
||||
freenas_api_call($scfg, 'DELETE', "/api/v2.0/pool/dataset/id/$dataset/", {"recursive" => \0});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200 || $code == 204) {
|
||||
syslog("info", (caller(0))[3] . " : zvol '$dataset' deleted successfully");
|
||||
return 1;
|
||||
} else {
|
||||
syslog("err", (caller(0))[3] . " : WARNING: could not delete zvol '$dataset' (HTTP $code) — manual cleanup may be needed");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
# Parse a blocksize string (e.g. "8k", "16k", "8192") to bytes.
|
||||
sub freenas_parse_blocksize {
|
||||
my ($val) = @_;
|
||||
return 0 unless defined $val && $val ne '';
|
||||
return $1 * 1024 if $val =~ /^(\d+)\s*[kK]$/;
|
||||
return $1 * 1024 * 1024 if $val =~ /^(\d+)\s*[mM]$/;
|
||||
return $val + 0;
|
||||
}
|
||||
|
||||
# Returns the recommended ZFS volblocksize for this TrueNAS host based on its
|
||||
# product type. TrueNAS SCALE ships a newer ZFS that requires >= 16k; CORE is
|
||||
# fine with 8k. Returns undef if the API is unreachable so callers can fall
|
||||
# back to the user-configured value or the ZFS default.
|
||||
sub freenas_get_recommended_blocksize {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
|
||||
# freenas_api_check (not freenas_api_connect) must be used here because
|
||||
# product_name is only parsed and cached by freenas_api_check.
|
||||
# freenas_api_connect only sets up the HTTP client.
|
||||
eval { freenas_api_check($scfg) };
|
||||
if ($@) {
|
||||
syslog("warn", (caller(0))[3] . " : unable to connect to TrueNAS API for blocksize detection: $@");
|
||||
return;
|
||||
}
|
||||
|
||||
my $product = $freenas_server_list->{$apihost}{product_name} // '';
|
||||
if ($product =~ /SCALE/i) {
|
||||
syslog("info", (caller(0))[3] . " : detected TrueNAS SCALE — recommending blocksize 16384");
|
||||
return 16384;
|
||||
}
|
||||
|
||||
syslog("info", (caller(0))[3] . " : detected '$product' — recommending blocksize 8192");
|
||||
return 8192;
|
||||
}
|
||||
|
||||
#
|
||||
# Remove an extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete-resource
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - extent_id
|
||||
#
|
||||
sub freenas_iscsi_remove_extent {
|
||||
my ($scfg, $extent_id) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (extent_id=$extent_id)");
|
||||
freenas_api_call($scfg, 'DELETE', $freenas_api_methods->{'extent'}->{'resource'} . (($freenas_api_version eq "v2.0") ? "id/" : "") . "$extent_id/", $freenas_api_methods->{'extent'}->{'delete_body'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200 || $code == 204) {
|
||||
syslog("info", (caller(0))[3] . "(extent_id=$extent_id) : successful");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-target-
|
||||
#
|
||||
sub freenas_iscsi_get_target {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
freenas_api_call($scfg, 'GET', $freenas_api_methods->{'target'}->{'resource'} . "?limit=0", $freenas_api_methods->{'target'}->{'get'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of associated extents to targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-targettoextent-
|
||||
#
|
||||
sub freenas_iscsi_get_target_to_extent {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
freenas_api_call($scfg, 'GET', $freenas_api_methods->{'targetextent'}->{'resource'} . "?limit=0", $freenas_api_methods->{'targetextent'}->{'get'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
# If 'iscsi_lunid' is undef then it is set to 'Auto' in FreeNAS
|
||||
# which should be '0' in our eyes.
|
||||
# This gave Proxmox 5.x and FreeNAS 11.1 a few issues.
|
||||
foreach my $item (@$result) {
|
||||
if (!defined($item->{$freenas_api_variables->{'lunid'}})) {
|
||||
$item->{$freenas_api_variables->{'lunid'}} = 0;
|
||||
syslog("info", (caller(0))[3] . " : change undef iscsi_lunid to 0");
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Associate a FreeNas extent to a FreeNas Target
|
||||
# http://api.freenas.org/resources/iscsi/index.html#post--api-v1.0-services-iscsi-targettoextent-
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - FreeNas Target ID
|
||||
# - FreeNas Extent ID
|
||||
# - Lun ID
|
||||
#
|
||||
sub freenas_iscsi_create_target_to_extent {
|
||||
my ($scfg, $target_id, $extent_id, $lun_id) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (target_id=$target_id, extent_id=$extent_id, lun_id=$lun_id)");
|
||||
|
||||
my %tte_vars = ('$target_id' => $target_id, '$extent_id' => $extent_id, '$lun_id' => $lun_id);
|
||||
my $post_body = {};
|
||||
while ((my $key, my $value) = each %{$freenas_api_methods->{'targetextent'}->{'post_body'}}) {
|
||||
$post_body->{$key} = exists $tte_vars{$value} ? $tte_vars{$value} : $value;
|
||||
}
|
||||
|
||||
freenas_api_call($scfg, 'POST', $freenas_api_methods->{'targetextent'}->{'resource'}, $post_body);
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200 || $code == 201) {
|
||||
my $result = decode_json($freenas_rest_connection->responseContent());
|
||||
syslog("info", (caller(0))[3] . "(target_id=$target_id, extent_id=$extent_id, lun_id=$lun_id) : successful");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove a Target to extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete--api-v1.0-services-iscsi-targettoextent-(int-id)-
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - link_id
|
||||
#
|
||||
sub freenas_iscsi_remove_target_to_extent {
|
||||
my ($scfg, $link_id) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called with (link_id=$link_id)");
|
||||
|
||||
if ($freenas_api_version eq "v2.0") {
|
||||
syslog("info", (caller(0))[3] . "(link_id=$link_id) : V2.0 API's so NOT Needed...successful");
|
||||
return 1;
|
||||
}
|
||||
|
||||
freenas_api_call($scfg, 'DELETE', $freenas_api_methods->{'targetextent'}->{'resource'} . (($freenas_api_version eq "v2.0") ? "id/" : "") . "$link_id/", $freenas_api_methods->{'targetextent'}->{'delete_body'});
|
||||
my $code = $freenas_rest_connection->responseCode();
|
||||
if ($code == 200 || $code == 204) {
|
||||
syslog("info", (caller(0))[3] . "(link_id=$link_id) : successful");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns all luns associated to the current target defined by $scfg->{target}
|
||||
# This method returns an array reference like "freenas_iscsi_get_extent" do
|
||||
# but with an additionnal hash entry "iscsi_lunid" retrieved from "freenas_iscsi_get_target_to_extent"
|
||||
#
|
||||
sub freenas_list_lu {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
|
||||
my %lun_hash;
|
||||
my $iscsi_lunid = undef;
|
||||
|
||||
if(defined($target_id)) {
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my $extents = freenas_iscsi_get_extent($scfg);
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{$freenas_api_variables->{'targetid'}} == $target_id) {
|
||||
foreach my $node (@$extents) {
|
||||
if($node->{'id'} == $item->{$freenas_api_variables->{'extentid'}}) {
|
||||
if ($item->{$freenas_api_variables->{'lunid'}} =~ /(\d+)/) {
|
||||
if (defined($node)) {
|
||||
$node->{$freenas_api_variables->{'lunid'}} .= "$1";
|
||||
$lun_hash{$node->{$freenas_api_variables->{'extentpath'}}} = $node;
|
||||
}
|
||||
last;
|
||||
} else {
|
||||
syslog("warn", (caller(0))[3] . " : iscsi_lunid did not pass tainted testing");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : successful");
|
||||
return \%lun_hash;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the first available "lunid" (in all targets namespaces)
|
||||
#
|
||||
sub freenas_get_first_available_lunid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my @luns = ();
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
push(@luns, $item->{$freenas_api_variables->{'lunid'}}) if ($item->{$freenas_api_variables->{'targetid'}} == $target_id);
|
||||
}
|
||||
|
||||
my @sorted_luns = sort {$a <=> $b} @luns;
|
||||
my $lun_id = 0;
|
||||
|
||||
# find the first hole, if not, give the +1 of the last lun
|
||||
foreach my $lun (@sorted_luns) {
|
||||
last if $lun != $lun_id;
|
||||
$lun_id = $lun_id + 1;
|
||||
}
|
||||
|
||||
syslog("info", (caller(0))[3] . " : $lun_id");
|
||||
return $lun_id;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the target id on FreeNas of the currently configured target of this PVE storage
|
||||
#
|
||||
sub freenas_get_targetid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
syslog("info", (caller(0))[3] . " : called");
|
||||
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = undef;
|
||||
|
||||
foreach my $target (@$targets) {
|
||||
my $iqn = $freenas_global_config->{$freenas_api_variables->{'basename'}} . ':' . $target->{$freenas_api_variables->{'targetname'}};
|
||||
if($iqn eq $scfg->{target}) {
|
||||
$target_id = $target->{'id'};
|
||||
last;
|
||||
}
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : successful : $target_id");
|
||||
return $target_id;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
@@ -1,140 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2018-10-03 11:02:46.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2018-10-28 21:27:44.794732848 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -32,7 +33,7 @@
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +41,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +65,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +165,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +192,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +237,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +273,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ZFSPlugin-5.0-33.pm 2018-12-15 09:29:56.586101170 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-15 09:24:08.393984276 -0500
|
||||
@@ -27,6 +27,7 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2018-11-27 07:23:15.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-15 09:24:08.393984276 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin-5.0-34.pm 2018-12-21 12:52:21.764194866 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-21 12:53:08.663665081 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-02-07 09:14:12.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2019-02-26 20:53:29.096598801 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-04-30 09:54:55.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-05-11 10:32:36.326734352 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-06-25 06:54:50.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-07-16 13:36:48.817831174 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-07-25 07:34:52.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-08-07 13:28:29.268383007 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-09-03 04:24:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-09-22 13:54:51.570048336 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-09-23 12:17:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-10-13 09:31:58.780554103 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -162,6 +168,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -180,6 +195,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -207,14 +240,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -239,6 +276,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2022-02-04 12:08:01.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2022-03-26 13:51:40.660068908 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +244,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +280,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2023-12-31 09:56:18.895228853 -0500
|
||||
+++ ZFSPlugin.pm 2023-12-31 09:57:08.830488875 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,32 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password (Deprecated)",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_secret => {
|
||||
+ description => "TrueNAS API Secret",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_token_auth => {
|
||||
+ description => "TrueNAS API Authentication with Token",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +252,20 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ truenas_secret => { optional => 1 },
|
||||
+ truenas_token_auth => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +290,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2023-12-31 09:56:18.895228853 -0500
|
||||
+++ ZFSPlugin.pm 2023-12-31 09:57:08.830488875 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,32 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password (Deprecated)",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_secret => {
|
||||
+ description => "TrueNAS API Secret",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_token_auth => {
|
||||
+ description => "TrueNAS API Authentication with Token",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +252,20 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ truenas_secret => { optional => 1 },
|
||||
+ truenas_token_auth => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +290,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/apidoc.js
|
||||
@@ -1,66 +0,0 @@
|
||||
--- apidoc.js.orig 2018-08-19 10:18:11.715767285 -0400
|
||||
+++ apidoc.js.new 2018-08-19 10:17:09.364282178 -0400
|
||||
@@ -27584,6 +27584,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"content" : {
|
||||
"description" : "Allowed content types.\n\nNOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs.\n",
|
||||
"format" : "pve-storage-content-list",
|
||||
@@ -27948,6 +27973,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"content" : {
|
||||
"description" : "Allowed content types.\n\nNOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs.\n",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc-5.2-9.js 2018-11-10 14:28:44.022355849 -0500
|
||||
+++ apidoc.js 2018-11-10 15:49:38.873720011 -0500
|
||||
@@ -32448,6 +32448,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -32604,6 +32629,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -32810,6 +32841,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc-5.3-1.js 2018-12-21 12:46:55.459865478 -0500
|
||||
+++ apidoc.js 2018-12-06 15:50:21.487987807 -0500
|
||||
@@ -33477,6 +33477,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -33633,6 +33658,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -33840,6 +33871,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-02-20 06:20:05.000000000 -0500
|
||||
+++ apidoc.js 2019-02-26 20:51:26.857204965 -0500
|
||||
@@ -33709,6 +33709,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -33865,6 +33890,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -34071,6 +34102,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-04-08 02:02:09.000000000 -0400
|
||||
+++ apidoc.js 2019-05-11 10:34:28.305764709 -0400
|
||||
@@ -34385,6 +34385,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -34541,6 +34566,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -34748,6 +34779,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-07-15 15:45:00.000000000 -0400
|
||||
+++ apidoc.js 2019-08-07 13:28:29.292382229 -0400
|
||||
@@ -35001,6 +35001,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -35157,6 +35182,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -35362,6 +35393,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2021-11-15 10:07:34.000000000 -0500
|
||||
+++ apidoc.js 2021-12-06 08:04:01.648822707 -0500
|
||||
@@ -44064,6 +44064,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -44275,6 +44300,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -44547,6 +44578,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,91 +0,0 @@
|
||||
--- apidoc.js.orig 2024-01-06 13:02:06.730512378 -0500
|
||||
+++ apidoc.js 2024-01-06 13:02:55.349787105 -0500
|
||||
@@ -50336,6 +50336,37 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS Secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -50555,6 +50586,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -50854,6 +50891,37 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,91 +0,0 @@
|
||||
--- apidoc.js.orig 2023-08-16 06:03:55.000000000 -0400
|
||||
+++ apidoc.js 2023-12-26 14:45:47.202566775 -0500
|
||||
@@ -47579,6 +47579,37 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS Secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -47798,6 +47829,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -48097,6 +48134,37 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1 +0,0 @@
|
||||
/pvemanagerlib.js
|
||||
@@ -1,167 +0,0 @@
|
||||
--- pvemanagerlib-5.2-10.js 2018-10-23 07:18:18.058603386 -0400
|
||||
+++ pvemanagerlib.js 2018-10-23 15:29:52.573563883 -0400
|
||||
@@ -5597,6 +5597,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -28583,6 +28584,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28595,10 +28597,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28616,6 +28627,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -28632,7 +28644,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -28646,7 +28658,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -28657,8 +28669,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28689,7 +28721,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28697,9 +28729,60 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2018-07-30 23:13:28.045035059 -0400
|
||||
+++ pvemanagerlib.js.new 2018-08-19 10:42:58.494724196 -0400
|
||||
@@ -5379,6 +5379,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET']
|
||||
]
|
||||
@@ -27361,7 +27362,23 @@
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
allowBlank: true
|
||||
- }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ checked: false,
|
||||
+ uncheckedValue: 0,
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_user',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS User'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -27370,7 +27387,26 @@
|
||||
name: 'iscsiprovider',
|
||||
value: 'comstar',
|
||||
fieldLabel: gettext('iSCSI Provider'),
|
||||
- allowBlank: false
|
||||
+ allowBlank: false,
|
||||
+ listeners: {
|
||||
+ change: function(f, value) {
|
||||
+ if (value === "freenas") {
|
||||
+ me.down('field[name=freenas_use_ssl]').setHidden(false);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setHidden(false);
|
||||
+ me.down('field[name=freenas_user]').setHidden(false);
|
||||
+ me.down('field[name=freenas_password]').setHidden(false);
|
||||
+ } else {
|
||||
+ me.down('field[name=freenas_use_ssl]').setHidden(true);
|
||||
+ me.down('field[name=freenas_use_ssl]').setValue(false);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setHidden(true);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setValue(false);
|
||||
+ me.down('field[name=freenas_user]').setHidden(true);
|
||||
+ me.down('field[name=freenas_user]').setValue('');
|
||||
+ me.down('field[name=freenas_password]').setHidden(true);
|
||||
+ me.down('field[name=freenas_password]').setValue('');
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
},
|
||||
{
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@@ -27392,6 +27428,22 @@
|
||||
value: '',
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_password',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS Password'),
|
||||
+ allowBlank: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
--- pvemanagerlib.js.5.2-8.js 2018-08-30 20:10:52.957313992 -0400
|
||||
+++ pvemanagerlib.js.new 2018-09-01 16:20:05.131908768 -0400
|
||||
@@ -28578,6 +28578,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28590,11 +28591,18 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
vm.set('isFreeNAS', newVal === 'freenas');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28653,16 +28661,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: me.isCreate ? { hidden: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
},
|
||||
{
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
value: '',
|
||||
- fieldLabel: gettext('FreeNAS User'),
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
- allowBlank: true
|
||||
+ allowBlank: me.isFreeNAS ? false : true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28693,7 +28713,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: me.isCreate ? { hidden: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28701,9 +28721,27 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: me.isCreate ? { hidden: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ value: '',
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ allowBlank: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
--- pvemanagerlib-5.2-9.js 2018-10-16 07:17:21.915593478 -0400
|
||||
+++ pvemanagerlib.js 2018-10-21 21:52:20.781740237 -0400
|
||||
@@ -5597,6 +5597,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -28574,6 +28575,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28586,10 +28588,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28607,6 +28618,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -28623,7 +28635,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -28637,7 +28649,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -28648,8 +28660,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28680,7 +28712,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28688,9 +28720,61 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-02-20 13:40:43.000000000 -0500
|
||||
+++ pvemanagerlib.js 2019-02-26 20:49:41.032327478 -0500
|
||||
@@ -5920,6 +5920,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30182,6 +30183,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30194,10 +30196,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30215,6 +30233,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30231,7 +30250,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30241,11 +30260,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30256,8 +30275,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30288,7 +30332,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30296,9 +30342,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
--- pvemanagerlib-5.3-5.js 2018-12-21 12:34:35.727962756 -0500
|
||||
+++ pvemanagerlib.js 2018-12-21 12:43:02.370462786 -0500
|
||||
@@ -5854,6 +5854,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -29983,6 +29984,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -29995,10 +29997,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30016,6 +30027,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30032,7 +30044,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30042,11 +30054,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30057,8 +30069,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30089,7 +30121,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30097,9 +30129,60 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
--- pvemanagerlib-5.3-6.js 2018-12-21 12:54:58.650421078 -0500
|
||||
+++ pvemanagerlib.js 2019-02-01 13:52:17.906074280 -0500
|
||||
@@ -5894,6 +5894,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30085,6 +30086,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30097,10 +30099,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30118,6 +30136,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30134,7 +30153,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30144,11 +30163,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30159,8 +30178,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30191,7 +30235,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30199,9 +30245,64 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ deleteEmpty: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-01-11 04:23:42.000000000 -0500
|
||||
+++ pvemanagerlib.js 2019-02-05 07:30:18.168655803 -0500
|
||||
@@ -5894,6 +5894,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30085,6 +30086,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30097,10 +30099,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30118,6 +30136,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30134,7 +30153,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30144,11 +30163,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30159,8 +30178,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30191,7 +30235,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30199,9 +30245,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-09 03:52:19.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-07-16 13:59:37.658409977 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31700,6 +31701,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31712,10 +31714,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31733,6 +31751,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31749,7 +31768,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31759,11 +31778,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31774,8 +31793,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31806,7 +31850,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31814,9 +31860,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-26 04:14:56.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-08-05 16:02:38.484913553 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31722,6 +31723,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31734,10 +31736,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31755,6 +31773,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31771,7 +31790,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31781,11 +31800,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31796,8 +31815,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31828,7 +31872,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31836,9 +31882,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-04-24 07:28:11.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-05-11 10:33:38.130198999 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31483,6 +31484,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31495,10 +31497,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31516,6 +31534,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31532,7 +31551,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31542,11 +31561,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31557,8 +31576,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31589,7 +31633,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31597,9 +31643,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-23 13:21:08.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-08-07 13:28:29.304381840 -0400
|
||||
@@ -6182,6 +6182,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -32977,6 +32978,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -32989,10 +32991,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33010,6 +33028,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -33026,7 +33045,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -33036,11 +33055,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -33051,8 +33070,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -33083,7 +33127,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -33091,9 +33137,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-09-03 04:31:21.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-09-22 13:54:51.602048049 -0400
|
||||
@@ -6183,6 +6183,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -32992,6 +32993,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -33004,10 +33006,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33025,6 +33043,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -33041,7 +33060,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -33051,11 +33070,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -33066,8 +33085,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -33098,7 +33142,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -33106,9 +33152,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2021-03-09 02:22:47.000000000 -0500
|
||||
+++ pvemanagerlib.js 2021-03-20 11:52:39.694828636 -0400
|
||||
@@ -7849,6 +7849,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -46874,6 +46875,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
},
|
||||
@@ -46886,10 +46888,26 @@
|
||||
},
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -46907,6 +46925,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -46923,7 +46942,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -46933,11 +46952,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -46948,9 +46967,34 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -46980,7 +47024,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -46988,9 +47034,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2021-05-27 08:28:35.000000000 -0400
|
||||
+++ pvemanagerlib.js 2021-06-10 11:03:15.380175988 -0400
|
||||
@@ -7900,6 +7900,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -47367,6 +47368,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
},
|
||||
@@ -47379,10 +47381,26 @@
|
||||
},
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -47400,6 +47418,7 @@
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -47416,7 +47435,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -47426,11 +47445,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -47441,9 +47460,34 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -47473,7 +47517,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -47481,9 +47527,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2022-03-17 09:08:40.000000000 -0400
|
||||
+++ pvemanagerlib.js 2022-04-03 08:54:10.229689187 -0400
|
||||
@@ -8068,6 +8068,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -49636,6 +49637,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
},
|
||||
@@ -49648,10 +49650,26 @@
|
||||
},
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -49669,6 +49687,7 @@
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -49685,7 +49704,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -49695,11 +49714,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -49710,9 +49729,34 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -49742,7 +49786,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -49750,9 +49796,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2024-01-06 14:50:39.890252726 -0500
|
||||
+++ pvemanagerlib.js 2024-01-06 15:51:53.708260622 -0500
|
||||
@@ -9228,6 +9228,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS/TrueNAS API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -58017,16 +58018,23 @@
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSInputPanel', {
|
||||
extend: 'PVE.panel.StorageBase',
|
||||
-
|
||||
viewModel: {
|
||||
- parent: null,
|
||||
- data: {
|
||||
- isLIO: false,
|
||||
- isComstar: true,
|
||||
- hasWriteCacheOption: true,
|
||||
- },
|
||||
+ parent: null,
|
||||
+ data: {
|
||||
+ isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
+ isLIO: false,
|
||||
+ isToken: false,
|
||||
+ hasWriteCacheOption: true,
|
||||
+ },
|
||||
+ formulas: {
|
||||
+ hideUsername: function(get) {
|
||||
+ return (!get('isFreeNAS') || !(get('isFreeNAS') && !get('isToken')));
|
||||
+ },
|
||||
+ },
|
||||
},
|
||||
|
||||
controller: {
|
||||
@@ -58035,12 +58043,41 @@
|
||||
'field[name=iscsiprovider]': {
|
||||
change: 'changeISCSIProvider',
|
||||
},
|
||||
+ 'field[name=truenas_token_auth]': {
|
||||
+ change: 'changeUsername',
|
||||
+ },
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('truenas_token_auth_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ changeUsername: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
+ var vm = me.getViewModel();
|
||||
+ vm.set('isToken', newVal);
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = newVal;
|
||||
+ if (newVal) {
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -58053,18 +58090,68 @@
|
||||
|
||||
values.nowritecache = values.writecache ? 0 : 1;
|
||||
delete values.writecache;
|
||||
+ console.warn(values.freenas_password);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ console.warn(values.truenas_secret);
|
||||
|
||||
return me.callParent([values]);
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
- values.writecache = values.nowritecache ? 0 : 1;
|
||||
- this.callParent([values]);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ values.truenas_confirm_secret = values.truenas_secret;
|
||||
+ values.writecache = values.nowritecache ? 0 : 1;
|
||||
+ this.callParent([values]);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
+ var tnsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_secret',
|
||||
+ reference: 'truenas_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=truenas_confirm_secret]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ var tnconfirmsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_confirm_secret',
|
||||
+ reference: 'truenas_confirm_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm API Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = me.up().down('field[name=truenas_secret]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Secrets do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
me.column1 = [
|
||||
{
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
@@ -58074,7 +58161,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -58084,11 +58171,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -58099,9 +58186,60 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'truenas_token_auth',
|
||||
+ reference: 'truenas_token_auth_field',
|
||||
+ inputId: 'truenas_use_token_auth_field',
|
||||
+ checked: false,
|
||||
+ listeners: {
|
||||
+ change: function(field, newValue) {
|
||||
+ if (newValue === true) {
|
||||
+ tnsecret.labelEl.update('API Token');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Token');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ tnsecret.labelEl.update('API Password');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Password');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API Token Auth'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{hideUsername}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -58131,7 +58269,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -58139,15 +58279,32 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
},
|
||||
+ tnsecret,
|
||||
+ tnconfirmsecret,
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSPoolSelector', {
|
||||
extend: 'PVE.form.ComboBoxSetStoreNode',
|
||||
alias: 'widget.pveZFSPoolSelector',
|
||||
@@ -1,241 +0,0 @@
|
||||
--- /tmp/pvemanagerlib-8.4.14-stock.js 2026-05-19 17:46:16.553917259 -0400
|
||||
+++ /tmp/pvemanagerlib-8.4.14-patched-v2.js 2026-05-19 21:35:03.162563535 -0400
|
||||
@@ -9745,6 +9745,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS/TrueNAS API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -62673,10 +62674,17 @@
|
||||
viewModel: {
|
||||
parent: null,
|
||||
data: {
|
||||
- isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
+ isLIO: false,
|
||||
+ isToken: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
+ formulas: {
|
||||
+ hideUsername: function(get) {
|
||||
+ return (!get('isFreeNAS') || !(get('isFreeNAS') && !get('isToken')));
|
||||
+ },
|
||||
+ },
|
||||
},
|
||||
|
||||
controller: {
|
||||
@@ -62685,12 +62693,41 @@
|
||||
'field[name=iscsiprovider]': {
|
||||
change: 'changeISCSIProvider',
|
||||
},
|
||||
+ 'field[name=truenas_token_auth]': {
|
||||
+ change: 'changeUsername',
|
||||
+ },
|
||||
},
|
||||
changeISCSIProvider: function (f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('truenas_token_auth_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ changeUsername: function (f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
+ var vm = me.getViewModel();
|
||||
+ vm.set('isToken', newVal);
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = newVal;
|
||||
+ if (newVal) {
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -62703,11 +62740,18 @@
|
||||
|
||||
values.nowritecache = values.writecache ? 0 : 1;
|
||||
delete values.writecache;
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
|
||||
return me.callParent([values]);
|
||||
},
|
||||
|
||||
setValues: function (values) {
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ values.truenas_confirm_secret = values.truenas_secret;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -62715,6 +62759,47 @@
|
||||
initComponent: function () {
|
||||
var me = this;
|
||||
|
||||
+ var tnsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_secret',
|
||||
+ reference: 'truenas_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function (f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=truenas_confirm_secret]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ var tnconfirmsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_confirm_secret',
|
||||
+ reference: 'truenas_confirm_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm API Password'),
|
||||
+ validator: function (value) {
|
||||
+ var pw = me.up().down('field[name=truenas_secret]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return 'Secrets do not match!';
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
me.column1 = [
|
||||
{
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
@@ -62749,9 +62834,60 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}',
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'truenas_token_auth',
|
||||
+ reference: 'truenas_token_auth_field',
|
||||
+ inputId: 'truenas_use_token_auth_field',
|
||||
+ checked: false,
|
||||
+ listeners: {
|
||||
+ change: function (field, newValue) {
|
||||
+ if (newValue === true) {
|
||||
+ tnsecret.labelEl.update('API Token');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Token');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ tnsecret.labelEl.update('API Password');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Password');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API Token Auth'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{hideUsername}',
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -62783,7 +62919,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}',
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -62791,10 +62929,26 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}',
|
||||
+ },
|
||||
+ allowBlank: true,
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ tnsecret,
|
||||
+ tnconfirmsecret,
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
@@ -1,286 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2024-01-06 14:50:39.890252726 -0500
|
||||
+++ pvemanagerlib.js 2024-01-06 15:51:53.708260622 -0500
|
||||
@@ -9228,6 +9228,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS/TrueNAS API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -58017,16 +58018,23 @@
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSInputPanel', {
|
||||
extend: 'PVE.panel.StorageBase',
|
||||
-
|
||||
viewModel: {
|
||||
- parent: null,
|
||||
- data: {
|
||||
- isLIO: false,
|
||||
- isComstar: true,
|
||||
- hasWriteCacheOption: true,
|
||||
- },
|
||||
+ parent: null,
|
||||
+ data: {
|
||||
+ isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
+ isLIO: false,
|
||||
+ isToken: false,
|
||||
+ hasWriteCacheOption: true,
|
||||
+ },
|
||||
+ formulas: {
|
||||
+ hideUsername: function(get) {
|
||||
+ return (!get('isFreeNAS') || !(get('isFreeNAS') && !get('isToken')));
|
||||
+ },
|
||||
+ },
|
||||
},
|
||||
|
||||
controller: {
|
||||
@@ -58035,12 +58043,41 @@
|
||||
'field[name=iscsiprovider]': {
|
||||
change: 'changeISCSIProvider',
|
||||
},
|
||||
+ 'field[name=truenas_token_auth]': {
|
||||
+ change: 'changeUsername',
|
||||
+ },
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('truenas_token_auth_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ changeUsername: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
+ var vm = me.getViewModel();
|
||||
+ vm.set('isToken', newVal);
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = newVal;
|
||||
+ if (newVal) {
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -58053,18 +58090,68 @@
|
||||
|
||||
values.nowritecache = values.writecache ? 0 : 1;
|
||||
delete values.writecache;
|
||||
+ console.warn(values.freenas_password);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ console.warn(values.truenas_secret);
|
||||
|
||||
return me.callParent([values]);
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
- values.writecache = values.nowritecache ? 0 : 1;
|
||||
- this.callParent([values]);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ values.truenas_confirm_secret = values.truenas_secret;
|
||||
+ values.writecache = values.nowritecache ? 0 : 1;
|
||||
+ this.callParent([values]);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
+ var tnsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_secret',
|
||||
+ reference: 'truenas_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=truenas_confirm_secret]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ var tnconfirmsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_confirm_secret',
|
||||
+ reference: 'truenas_confirm_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm API Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = me.up().down('field[name=truenas_secret]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Secrets do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
me.column1 = [
|
||||
{
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
@@ -58074,7 +58161,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -58084,11 +58171,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -58099,9 +58186,60 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'truenas_token_auth',
|
||||
+ reference: 'truenas_token_auth_field',
|
||||
+ inputId: 'truenas_use_token_auth_field',
|
||||
+ checked: false,
|
||||
+ listeners: {
|
||||
+ change: function(field, newValue) {
|
||||
+ if (newValue === true) {
|
||||
+ tnsecret.labelEl.update('API Token');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Token');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ tnsecret.labelEl.update('API Password');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Password');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API Token Auth'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{hideUsername}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -58131,7 +58269,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -58139,15 +58279,32 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
},
|
||||
+ tnsecret,
|
||||
+ tnconfirmsecret,
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSPoolSelector', {
|
||||
extend: 'PVE.form.ComboBoxSetStoreNode',
|
||||
alias: 'widget.pveZFSPoolSelector',
|
||||
@@ -1,4 +0,0 @@
|
||||
/ZFSPlugin.pm
|
||||
/ZFSPoolPlugin.pm
|
||||
/ZFSPlugin-new.pm
|
||||
/ZFSPlugin-newver.patch
|
||||
@@ -1,546 +0,0 @@
|
||||
package PVE::Storage::LunCmd::FreeNAS;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
use PVE::SafeSyslog;
|
||||
use IO::Socket::SSL;
|
||||
|
||||
use REST::Client;
|
||||
use MIME::Base64;
|
||||
use JSON;
|
||||
|
||||
# Max LUNS per target on the iSCSI server
|
||||
my $MAX_LUNS = 255;
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub get_base {
|
||||
return '/dev/zvol';
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_lun_command {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
if(!defined($scfg->{'freenas_user'}) || !defined($scfg->{'freenas_password'})) {
|
||||
die "Undefined freenas_user and/or freenas_password.";
|
||||
}
|
||||
|
||||
syslog("info","FreeNAS::lun_command : $method(@params)");
|
||||
|
||||
if($method eq "create_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "delete_lu") {
|
||||
return run_delete_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "import_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "modify_lu") {
|
||||
return run_modify_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "add_view") {
|
||||
return run_add_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_view") {
|
||||
return run_list_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_extent") {
|
||||
return run_list_extent($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_lu") {
|
||||
return run_list_lu($scfg, $timeout, $method, "name", @params);
|
||||
}
|
||||
|
||||
syslog("error","FreeNAS::lun_command : unknown method $method");
|
||||
return undef;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_add_view {
|
||||
return '';
|
||||
}
|
||||
|
||||
#
|
||||
# a modify_lu occur by example on a zvol resize. we just need to destroy and recreate the lun with the same zvol.
|
||||
# Be careful, the first param is the new size of the zvol, we must shift params
|
||||
#
|
||||
sub run_modify_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
shift(@params);
|
||||
run_delete_lu($scfg, $timeout, $method, @params);
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_view {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
return run_list_lu($scfg, $timeout, $method, "lun-id", @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_lu {
|
||||
my ($scfg, $timeout, $method, $result_value_type, @params) = @_;
|
||||
my $object = $params[0];
|
||||
my $result = undef;
|
||||
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
foreach my $lun (@$luns) {
|
||||
if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) {
|
||||
$result = $result_value_type eq "lun-id" ? $lun->{'iscsi_lunid'} : $lun->{'iscsi_target_extent_path'};
|
||||
syslog("info","FreeNAS::list_lu($object):$result_value_type : lun found $result");
|
||||
last;
|
||||
}
|
||||
}
|
||||
if(!defined($result)) {
|
||||
syslog("info","FreeNAS::list_lu($object):$result_value_type : lun not found");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_extent {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
my $object = $params[0];
|
||||
my $result = undef;
|
||||
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
foreach my $lun (@$luns) {
|
||||
if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) {
|
||||
$result = $lun->{'iscsi_target_extent_naa'};
|
||||
syslog("info","FreeNAS::list_extent($object): naa found $result");
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (!defined($result)) {
|
||||
syslog("info","FreeNAS::list_extent($object): naa not found");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_create_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
my $lun_path = $params[0];
|
||||
my $lun_id = freenas_get_first_available_lunid($scfg);
|
||||
|
||||
die "Maximum number of LUNs per target is $MAX_LUNS" if scalar $lun_id >= $MAX_LUNS;
|
||||
die "$params[0]: LUN $lun_path exists" if defined(run_list_lu($scfg, $timeout, $method, "name", @params));
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
# Create the extent
|
||||
my $extent = freenas_iscsi_create_extent($scfg, $lun_path);
|
||||
|
||||
# Associate the new extent to the target
|
||||
my $link = freenas_iscsi_create_target_to_extent($scfg, $target_id, $extent->{'id'}, $lun_id);
|
||||
|
||||
if (defined($link)) {
|
||||
syslog("info","FreeNAS::create_lu(lun_path=$lun_path, lun_id=$lun_id) : sucessfull");
|
||||
} else {
|
||||
die "Unable to create lun $lun_path";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_delete_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
my $lun_path = $params[0];
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
my $lun = undef;
|
||||
my $link = undef;
|
||||
|
||||
foreach my $item (@$luns) {
|
||||
if($item->{'iscsi_target_extent_path'} =~ /^$lun_path$/) {
|
||||
$lun = $item;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
die "Unable to find the lun $lun_path for $scfg->{target}" if !defined($lun);
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
# find the target to extent
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{'iscsi_target'} == $target_id &&
|
||||
$item->{'iscsi_lunid'} == $lun->{'iscsi_lunid'} &&
|
||||
$item->{'iscsi_extent'} == $lun->{'id'}) {
|
||||
|
||||
$link = $item;
|
||||
last;
|
||||
}
|
||||
}
|
||||
die "Unable to find the link for the lun $lun_path for $scfg->{target}" if !defined($link);
|
||||
|
||||
# Remove the link
|
||||
my $remove_link = freenas_iscsi_remove_target_to_extent($scfg, $link->{'id'});
|
||||
|
||||
# Remove the extent
|
||||
my $remove_extent = freenas_iscsi_remove_extent($scfg, $lun->{'id'});
|
||||
|
||||
if($remove_link == 1 && $remove_extent == 1) {
|
||||
syslog("info","FreeNAS::delete_lu(lun_path=$lun_path) : sucessfull");
|
||||
} else {
|
||||
die "Unable to delete lun $lun_path";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#
|
||||
### FREENAS API CALLING ###
|
||||
#
|
||||
sub freenas_api_call {
|
||||
my ($scfg, $method, $path, $data) = @_;
|
||||
my $client = undef;
|
||||
my $scheme = $scfg->{freenas_use_ssl} ? "https" : "http";
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
my $apiping = '/api/v1.0/system/version/';
|
||||
|
||||
$client = REST::Client->new();
|
||||
$client->setHost($scheme . '://' . $apihost);
|
||||
$client->addHeader('Content-Type' , 'application/json');
|
||||
$client->addHeader('Authorization' , 'Basic ' . encode_base64($scfg->{freenas_user} . ':' . $scfg->{freenas_password}));
|
||||
# If using SSL, don't verify SSL certs
|
||||
if ($scfg->{freenas_use_ssl}) {
|
||||
$client->getUseragent()->ssl_opts(verify_hostname => 0);
|
||||
$client->getUseragent()->ssl_opts(SSL_verify_mode => SSL_VERIFY_NONE);
|
||||
}
|
||||
# Check if the APIs are accessable via the selected host and scheme
|
||||
my $code = $client->request('GET', $apiping)->responseCode();
|
||||
if ($code != 200) {
|
||||
freenas_api_log_error($client, "freenas_api_call");
|
||||
die "Unable to connect to the FreeNAS API service at '" . $apihost . "' using the '" . $scheme . "' protocol";
|
||||
}
|
||||
syslog("info","FreeNAS::api_call : setup : sucessfull");
|
||||
if ($method eq 'GET') {
|
||||
$client->GET($path);
|
||||
}
|
||||
if ($method eq 'DELETE') {
|
||||
$client->DELETE($path);
|
||||
}
|
||||
if ($method eq 'POST') {
|
||||
$client->POST($path, encode_json($data));
|
||||
}
|
||||
|
||||
return $client
|
||||
}
|
||||
|
||||
#
|
||||
# Writes the Response and Content to SysLog
|
||||
#
|
||||
sub freenas_api_log_error {
|
||||
my ($client, $method) = @_;
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response code: " . $client->responseCode());
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response content: " . $client->responseContent());
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub freenas_iscsi_get_globalconfiguration {
|
||||
my ($scfg) = @_;
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/globalconfiguration/", undef);
|
||||
my $code = $client->responseCode();
|
||||
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_globalconfig : target_basename=" . $result->{'iscsi_basename'});
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_globalconfig");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all extents.
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-extent-
|
||||
#
|
||||
sub freenas_iscsi_get_extent {
|
||||
my ($scfg) = @_;
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/extent/?limit=0", undef);
|
||||
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_extent : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Create an extent on FreeNas
|
||||
# http://api.freenas.org/resources/iscsi/index.html#create-resource
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - lun_path
|
||||
#
|
||||
sub freenas_iscsi_create_extent {
|
||||
my ($scfg, $lun_path) = @_;
|
||||
|
||||
my $name = $lun_path;
|
||||
$name =~ s/^.*\///; # all from last /
|
||||
$name = $scfg->{'pool'} . '/' . $name;
|
||||
|
||||
my $device = $lun_path;
|
||||
$device =~ s/^\/dev\///; # strip /dev/
|
||||
|
||||
my $request = {
|
||||
"iscsi_target_extent_type" => "Disk",
|
||||
"iscsi_target_extent_name" => $name,
|
||||
"iscsi_target_extent_disk" => $device,
|
||||
};
|
||||
|
||||
my $client = freenas_api_call($scfg, 'POST', "/api/v1.0/services/iscsi/extent/", $request);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 201) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info", "FreeNAS::API::create_extent(lun_path=" . $result->{'iscsi_target_extent_path'} . ") : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "create_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove an extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete-resource
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - extent_id
|
||||
#
|
||||
sub freenas_iscsi_remove_extent {
|
||||
my ($scfg, $extent_id) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'DELETE', "/api/v1.0/services/iscsi/extent/$extent_id/", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 204) {
|
||||
syslog("info","FreeNAS::API::remove_extent(extent_id=$extent_id) : sucessfull");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error($client, "remove_extent");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-target-
|
||||
#
|
||||
sub freenas_iscsi_get_target {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/target/?limit=0", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_target() : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_target");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of associated extents to targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-targettoextent-
|
||||
#
|
||||
sub freenas_iscsi_get_target_to_extent {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/targettoextent/?limit=0", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_target_to_extent() : sucessfull");
|
||||
# If 'iscsi_lunid' is undef then it is set to 'Auto' in FreeNAS
|
||||
# which should be '0' in our eyes.
|
||||
# This gave Proxmox 5.x and FreeNAS 11.1 a few issues.
|
||||
foreach my $item (@$result) {
|
||||
if (!defined($item->{'iscsi_lunid'})) {
|
||||
$item->{'iscsi_lunid'} = 0;
|
||||
syslog("info", "FreeNAS::API::get_target_to_extent() : change undef iscsi_lunid to 0");
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_target_to_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Associate a FreeNas extent to a FreeNas Target
|
||||
# http://api.freenas.org/resources/iscsi/index.html#post--api-v1.0-services-iscsi-targettoextent-
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - FreeNas Target ID
|
||||
# - FreeNas Extent ID
|
||||
# - Lun ID
|
||||
#
|
||||
sub freenas_iscsi_create_target_to_extent {
|
||||
my ($scfg, $target_id, $extent_id, $lun_id) = @_;
|
||||
|
||||
my $request = {
|
||||
"iscsi_target" => $target_id,
|
||||
"iscsi_extent" => $extent_id,
|
||||
"iscsi_lunid" => $lun_id
|
||||
};
|
||||
|
||||
my $client = freenas_api_call($scfg, 'POST', "/api/v1.0/services/iscsi/targettoextent/", $request);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 201) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::create_target_to_extent(target_id=$target_id, extent_id=$extent_id, lun_id=$lun_id) : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "create_target_to_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove a Target to extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete--api-v1.0-services-iscsi-targettoextent-(int-id)-
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - link_id
|
||||
#
|
||||
sub freenas_iscsi_remove_target_to_extent {
|
||||
my ($scfg, $link_id) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'DELETE', "/api/v1.0/services/iscsi/targettoextent/$link_id/", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 204) {
|
||||
syslog("info","FreeNAS::API::remove_target_to_extent(link_id=$link_id) : sucessfull");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error($client, "remove_target_to_extent");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns all luns associated to the current target defined by $scfg->{target}
|
||||
# This method returns an array reference like "freenas_iscsi_get_extent" do
|
||||
# but with an additionnal hash entry "iscsi_lunid" retrieved from "freenas_iscsi_get_target_to_extent"
|
||||
#
|
||||
sub freenas_list_lu {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
|
||||
my @luns = ();
|
||||
my $iscsi_lunid = undef;
|
||||
|
||||
if(defined($target_id)) {
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my $extents = freenas_iscsi_get_extent($scfg);
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{'iscsi_target'} == $target_id) {
|
||||
foreach my $node (@$extents) {
|
||||
if($node->{'id'} == $item->{'iscsi_extent'}) {
|
||||
if ($item->{'iscsi_lunid'} =~ /(\d+)/) {
|
||||
$iscsi_lunid = "$1";
|
||||
} else {
|
||||
syslog("info", "FreeNAS::API::freenas_list_lu : iscsi_lunid did not pass tainted testing");
|
||||
next;
|
||||
}
|
||||
$node->{'iscsi_lunid'} .= $iscsi_lunid;
|
||||
push(@luns , $node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
syslog("info", "FreeNAS::API::freenas_list_lu : sucessfull");
|
||||
return \@luns;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the first available "lunid" (in all targets namespaces)
|
||||
#
|
||||
sub freenas_get_first_available_lunid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my @luns = ();
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
push(@luns, $item->{'iscsi_lunid'}) if ($item->{'iscsi_target'} == $target_id);
|
||||
}
|
||||
|
||||
my @sorted_luns = sort {$a <=> $b} @luns;
|
||||
my $lun_id = 0;
|
||||
|
||||
# find the first hole, if not, give the +1 of the last lun
|
||||
foreach my $lun (@sorted_luns) {
|
||||
last if $lun != $lun_id;
|
||||
$lun_id = $lun_id + 1;
|
||||
}
|
||||
|
||||
syslog("info", "FreeNAS::API::freenas_get_first_available_lunid : return $lun_id");
|
||||
return $lun_id;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the target id on FreeNas of the currently configured target of this PVE storage
|
||||
#
|
||||
sub freenas_get_targetid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $global = freenas_iscsi_get_globalconfiguration($scfg);
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = undef;
|
||||
|
||||
foreach my $target (@$targets) {
|
||||
my $iqn = $global->{'iscsi_basename'} . ':' . $target->{'iscsi_target_name'};
|
||||
if($iqn eq $scfg->{target}) {
|
||||
$target_id = $target->{'id'};
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return $target_id;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
@@ -1,140 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2018-10-03 11:02:46.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2018-10-28 21:27:44.794732848 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -32,7 +33,7 @@
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +41,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +65,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +165,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +192,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +237,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +273,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ZFSPlugin-5.0-33.pm 2018-12-15 09:29:56.586101170 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-15 09:24:08.393984276 -0500
|
||||
@@ -27,6 +27,7 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2018-11-27 07:23:15.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-15 09:24:08.393984276 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin-5.0-34.pm 2018-12-21 12:52:21.764194866 -0500
|
||||
+++ ZFSPlugin.pm 2018-12-21 12:53:08.663665081 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-02-07 09:14:12.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2019-02-26 20:53:29.096598801 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-04-30 09:54:55.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-05-11 10:32:36.326734352 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-06-25 06:54:50.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-07-16 13:36:48.817831174 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-06-25 06:54:50.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-07-16 13:36:48.817831174 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/apidoc.js
|
||||
@@ -1,66 +0,0 @@
|
||||
--- apidoc.js.orig 2018-08-19 10:18:11.715767285 -0400
|
||||
+++ apidoc.js.new 2018-08-19 10:17:09.364282178 -0400
|
||||
@@ -27584,6 +27584,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"content" : {
|
||||
"description" : "Allowed content types.\n\nNOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs.\n",
|
||||
"format" : "pve-storage-content-list",
|
||||
@@ -27948,6 +27973,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"content" : {
|
||||
"description" : "Allowed content types.\n\nNOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs.\n",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc-5.2-9.js 2018-11-10 14:28:44.022355849 -0500
|
||||
+++ apidoc.js 2018-11-10 15:49:38.873720011 -0500
|
||||
@@ -32448,6 +32448,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -32604,6 +32629,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -32810,6 +32841,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc-5.3-1.js 2018-12-21 12:46:55.459865478 -0500
|
||||
+++ apidoc.js 2018-12-06 15:50:21.487987807 -0500
|
||||
@@ -33477,6 +33477,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -33633,6 +33658,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -33840,6 +33871,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-02-20 06:20:05.000000000 -0500
|
||||
+++ apidoc.js 2019-02-26 20:51:26.857204965 -0500
|
||||
@@ -33709,6 +33709,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -33865,6 +33890,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -34071,6 +34102,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-04-08 02:02:09.000000000 -0400
|
||||
+++ apidoc.js 2019-05-11 10:34:28.305764709 -0400
|
||||
@@ -34385,6 +34385,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -34541,6 +34566,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -34748,6 +34779,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-04-08 02:02:09.000000000 -0400
|
||||
+++ apidoc.js 2019-05-11 10:34:28.305764709 -0400
|
||||
@@ -34385,6 +34385,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -34541,6 +34566,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -34748,6 +34779,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1 +0,0 @@
|
||||
/pvemanagerlib.js
|
||||
@@ -1,167 +0,0 @@
|
||||
--- pvemanagerlib-5.2-10.js 2018-10-23 07:18:18.058603386 -0400
|
||||
+++ pvemanagerlib.js 2018-10-23 15:29:52.573563883 -0400
|
||||
@@ -5597,6 +5597,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -28583,6 +28584,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28595,10 +28597,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28616,6 +28627,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -28632,7 +28644,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -28646,7 +28658,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -28657,8 +28669,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28689,7 +28721,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28697,9 +28729,60 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2018-07-30 23:13:28.045035059 -0400
|
||||
+++ pvemanagerlib.js.new 2018-08-19 10:42:58.494724196 -0400
|
||||
@@ -5379,6 +5379,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET']
|
||||
]
|
||||
@@ -27361,7 +27362,23 @@
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
allowBlank: true
|
||||
- }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ checked: false,
|
||||
+ uncheckedValue: 0,
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_user',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS User'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -27370,7 +27387,26 @@
|
||||
name: 'iscsiprovider',
|
||||
value: 'comstar',
|
||||
fieldLabel: gettext('iSCSI Provider'),
|
||||
- allowBlank: false
|
||||
+ allowBlank: false,
|
||||
+ listeners: {
|
||||
+ change: function(f, value) {
|
||||
+ if (value === "freenas") {
|
||||
+ me.down('field[name=freenas_use_ssl]').setHidden(false);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setHidden(false);
|
||||
+ me.down('field[name=freenas_user]').setHidden(false);
|
||||
+ me.down('field[name=freenas_password]').setHidden(false);
|
||||
+ } else {
|
||||
+ me.down('field[name=freenas_use_ssl]').setHidden(true);
|
||||
+ me.down('field[name=freenas_use_ssl]').setValue(false);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setHidden(true);
|
||||
+ me.down('field[name=freenas_apiv4_host]').setValue(false);
|
||||
+ me.down('field[name=freenas_user]').setHidden(true);
|
||||
+ me.down('field[name=freenas_user]').setValue('');
|
||||
+ me.down('field[name=freenas_password]').setHidden(true);
|
||||
+ me.down('field[name=freenas_password]').setValue('');
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
},
|
||||
{
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@@ -27392,6 +27428,22 @@
|
||||
value: '',
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_password',
|
||||
+ value: '',
|
||||
+ hidden: me.iscsiprovider !== "freenas",
|
||||
+ fieldLabel: gettext('FreeNAS Password'),
|
||||
+ allowBlank: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
--- pvemanagerlib.js.5.2-8.js 2018-08-30 20:10:52.957313992 -0400
|
||||
+++ pvemanagerlib.js.new 2018-09-01 16:20:05.131908768 -0400
|
||||
@@ -28578,6 +28578,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28590,11 +28591,18 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
vm.set('isFreeNAS', newVal === 'freenas');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28653,16 +28661,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: me.isCreate ? { hidden: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
},
|
||||
{
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
value: '',
|
||||
- fieldLabel: gettext('FreeNAS User'),
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
- allowBlank: true
|
||||
+ allowBlank: me.isFreeNAS ? false : true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28693,7 +28713,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: me.isCreate ? { hidden: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28701,9 +28721,27 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: me.isCreate ? { hidden: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ value: '',
|
||||
+ bind: me.isCreate ? { hidden: '{!isFreeNAS}' } : { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ allowBlank: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
--- pvemanagerlib-5.2-9.js 2018-10-16 07:17:21.915593478 -0400
|
||||
+++ pvemanagerlib.js 2018-10-21 21:52:20.781740237 -0400
|
||||
@@ -5597,6 +5597,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -28574,6 +28575,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -28586,10 +28588,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28607,6 +28618,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -28623,7 +28635,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -28637,7 +28649,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -28648,8 +28660,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -28680,7 +28712,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -28688,9 +28720,61 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-02-20 13:40:43.000000000 -0500
|
||||
+++ pvemanagerlib.js 2019-02-26 20:49:41.032327478 -0500
|
||||
@@ -5920,6 +5920,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30182,6 +30183,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30194,10 +30196,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30215,6 +30233,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30231,7 +30250,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30241,11 +30260,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30256,8 +30275,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30288,7 +30332,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30296,9 +30342,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
--- pvemanagerlib-5.3-5.js 2018-12-21 12:34:35.727962756 -0500
|
||||
+++ pvemanagerlib.js 2018-12-21 12:43:02.370462786 -0500
|
||||
@@ -5854,6 +5854,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -29983,6 +29984,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -29995,10 +29997,19 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30016,6 +30027,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30032,7 +30044,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30042,11 +30054,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30057,8 +30069,28 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ allowBlank: false,
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30089,7 +30121,7 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: { hidden: '{!isComstar}' },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30097,9 +30129,60 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
+ bind: { hidden: '{!isLIO}' },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ allowBlank: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ allowBlank: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: { hidden: '{!isFreeNAS}' },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
--- pvemanagerlib-5.3-6.js 2018-12-21 12:54:58.650421078 -0500
|
||||
+++ pvemanagerlib.js 2019-02-01 13:52:17.906074280 -0500
|
||||
@@ -5894,6 +5894,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30085,6 +30086,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30097,10 +30099,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30118,6 +30136,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30134,7 +30153,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30144,11 +30163,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30159,8 +30178,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30191,7 +30235,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30199,9 +30245,64 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ deleteEmpty: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ deleteEmpty: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-01-11 04:23:42.000000000 -0500
|
||||
+++ pvemanagerlib.js 2019-02-05 07:30:18.168655803 -0500
|
||||
@@ -5894,6 +5894,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -30085,6 +30086,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -30097,10 +30099,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30118,6 +30136,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -30134,7 +30153,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -30144,11 +30163,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -30159,8 +30178,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -30191,7 +30235,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -30199,9 +30245,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-09 03:52:19.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-07-16 13:59:37.658409977 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31700,6 +31701,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31712,10 +31714,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31733,6 +31751,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31749,7 +31768,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31759,11 +31778,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31774,8 +31793,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31806,7 +31850,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31814,9 +31860,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-26 04:14:56.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-08-05 16:02:38.484913553 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31722,6 +31723,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31734,10 +31736,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31755,6 +31773,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31771,7 +31790,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31781,11 +31800,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31796,8 +31815,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31828,7 +31872,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31836,9 +31882,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-04-24 07:28:11.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-05-11 10:33:38.130198999 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31483,6 +31484,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31495,10 +31497,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31516,6 +31534,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31532,7 +31551,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31542,11 +31561,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31557,8 +31576,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31589,7 +31633,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31597,9 +31643,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-26 04:14:56.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-08-05 16:02:38.484913553 -0400
|
||||
@@ -6094,6 +6094,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -31722,6 +31723,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -31734,10 +31736,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31755,6 +31773,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -31771,7 +31790,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -31781,11 +31800,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -31796,8 +31815,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -31828,7 +31872,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -31836,9 +31882,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,546 +0,0 @@
|
||||
package PVE::Storage::LunCmd::FreeNAS;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
use PVE::SafeSyslog;
|
||||
use IO::Socket::SSL;
|
||||
|
||||
use REST::Client;
|
||||
use MIME::Base64;
|
||||
use JSON;
|
||||
|
||||
# Max LUNS per target on the iSCSI server
|
||||
my $MAX_LUNS = 255;
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub get_base {
|
||||
return '/dev/zvol';
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_lun_command {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
if(!defined($scfg->{'freenas_user'}) || !defined($scfg->{'freenas_password'})) {
|
||||
die "Undefined freenas_user and/or freenas_password.";
|
||||
}
|
||||
|
||||
syslog("info","FreeNAS::lun_command : $method(@params)");
|
||||
|
||||
if($method eq "create_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "delete_lu") {
|
||||
return run_delete_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "import_lu") {
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "modify_lu") {
|
||||
return run_modify_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "add_view") {
|
||||
return run_add_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_view") {
|
||||
return run_list_view($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_extent") {
|
||||
return run_list_extent($scfg, $timeout, $method, @params);
|
||||
}
|
||||
if($method eq "list_lu") {
|
||||
return run_list_lu($scfg, $timeout, $method, "name", @params);
|
||||
}
|
||||
|
||||
syslog("error","FreeNAS::lun_command : unknown method $method");
|
||||
return undef;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_add_view {
|
||||
return '';
|
||||
}
|
||||
|
||||
#
|
||||
# a modify_lu occur by example on a zvol resize. we just need to destroy and recreate the lun with the same zvol.
|
||||
# Be careful, the first param is the new size of the zvol, we must shift params
|
||||
#
|
||||
sub run_modify_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
shift(@params);
|
||||
run_delete_lu($scfg, $timeout, $method, @params);
|
||||
return run_create_lu($scfg, $timeout, $method, @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_view {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
return run_list_lu($scfg, $timeout, $method, "lun-id", @params);
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_lu {
|
||||
my ($scfg, $timeout, $method, $result_value_type, @params) = @_;
|
||||
my $object = $params[0];
|
||||
my $result = undef;
|
||||
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
foreach my $lun (@$luns) {
|
||||
if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) {
|
||||
$result = $result_value_type eq "lun-id" ? $lun->{'iscsi_lunid'} : $lun->{'iscsi_target_extent_path'};
|
||||
syslog("info","FreeNAS::list_lu($object):$result_value_type : lun found $result");
|
||||
last;
|
||||
}
|
||||
}
|
||||
if(!defined($result)) {
|
||||
syslog("info","FreeNAS::list_lu($object):$result_value_type : lun not found");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_list_extent {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
my $object = $params[0];
|
||||
my $result = undef;
|
||||
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
foreach my $lun (@$luns) {
|
||||
if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) {
|
||||
$result = $lun->{'iscsi_target_extent_naa'};
|
||||
syslog("info","FreeNAS::list_extent($object): naa found $result");
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (!defined($result)) {
|
||||
syslog("info","FreeNAS::list_extent($object): naa not found");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_create_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
my $lun_path = $params[0];
|
||||
my $lun_id = freenas_get_first_available_lunid($scfg);
|
||||
|
||||
die "Maximum number of LUNs per target is $MAX_LUNS" if scalar $lun_id >= $MAX_LUNS;
|
||||
die "$params[0]: LUN $lun_path exists" if defined(run_list_lu($scfg, $timeout, $method, "name", @params));
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
# Create the extent
|
||||
my $extent = freenas_iscsi_create_extent($scfg, $lun_path);
|
||||
|
||||
# Associate the new extent to the target
|
||||
my $link = freenas_iscsi_create_target_to_extent($scfg, $target_id, $extent->{'id'}, $lun_id);
|
||||
|
||||
if (defined($link)) {
|
||||
syslog("info","FreeNAS::create_lu(lun_path=$lun_path, lun_id=$lun_id) : sucessfull");
|
||||
} else {
|
||||
die "Unable to create lun $lun_path";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub run_delete_lu {
|
||||
my ($scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
my $lun_path = $params[0];
|
||||
my $luns = freenas_list_lu($scfg);
|
||||
my $lun = undef;
|
||||
my $link = undef;
|
||||
|
||||
foreach my $item (@$luns) {
|
||||
if($item->{'iscsi_target_extent_path'} =~ /^$lun_path$/) {
|
||||
$lun = $item;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
die "Unable to find the lun $lun_path for $scfg->{target}" if !defined($lun);
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
die "Unable to find the target id for $scfg->{target}" if !defined($target_id);
|
||||
|
||||
# find the target to extent
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{'iscsi_target'} == $target_id &&
|
||||
$item->{'iscsi_lunid'} == $lun->{'iscsi_lunid'} &&
|
||||
$item->{'iscsi_extent'} == $lun->{'id'}) {
|
||||
|
||||
$link = $item;
|
||||
last;
|
||||
}
|
||||
}
|
||||
die "Unable to find the link for the lun $lun_path for $scfg->{target}" if !defined($link);
|
||||
|
||||
# Remove the link
|
||||
my $remove_link = freenas_iscsi_remove_target_to_extent($scfg, $link->{'id'});
|
||||
|
||||
# Remove the extent
|
||||
my $remove_extent = freenas_iscsi_remove_extent($scfg, $lun->{'id'});
|
||||
|
||||
if($remove_link == 1 && $remove_extent == 1) {
|
||||
syslog("info","FreeNAS::delete_lu(lun_path=$lun_path) : sucessfull");
|
||||
} else {
|
||||
die "Unable to delete lun $lun_path";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#
|
||||
### FREENAS API CALLING ###
|
||||
#
|
||||
sub freenas_api_call {
|
||||
my ($scfg, $method, $path, $data) = @_;
|
||||
my $client = undef;
|
||||
my $scheme = $scfg->{freenas_use_ssl} ? "https" : "http";
|
||||
my $apihost = defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal};
|
||||
my $apiping = '/api/v1.0/system/version/';
|
||||
|
||||
$client = REST::Client->new();
|
||||
$client->setHost($scheme . '://' . $apihost);
|
||||
$client->addHeader('Content-Type' , 'application/json');
|
||||
$client->addHeader('Authorization' , 'Basic ' . encode_base64($scfg->{freenas_user} . ':' . $scfg->{freenas_password}));
|
||||
# If using SSL, don't verify SSL certs
|
||||
if ($scfg->{freenas_use_ssl}) {
|
||||
$client->getUseragent()->ssl_opts(verify_hostname => 0);
|
||||
$client->getUseragent()->ssl_opts(SSL_verify_mode => SSL_VERIFY_NONE);
|
||||
}
|
||||
# Check if the APIs are accessable via the selected host and scheme
|
||||
my $code = $client->request('GET', $apiping)->responseCode();
|
||||
if ($code != 200) {
|
||||
freenas_api_log_error($client, "freenas_api_call");
|
||||
die "Unable to connect to the FreeNAS API service at '" . $apihost . "' using the '" . $scheme . "' protocol";
|
||||
}
|
||||
syslog("info","FreeNAS::api_call : setup : sucessfull");
|
||||
if ($method eq 'GET') {
|
||||
$client->GET($path);
|
||||
}
|
||||
if ($method eq 'DELETE') {
|
||||
$client->DELETE($path);
|
||||
}
|
||||
if ($method eq 'POST') {
|
||||
$client->POST($path, encode_json($data));
|
||||
}
|
||||
|
||||
return $client
|
||||
}
|
||||
|
||||
#
|
||||
# Writes the Response and Content to SysLog
|
||||
#
|
||||
sub freenas_api_log_error {
|
||||
my ($client, $method) = @_;
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response code: " . $client->responseCode());
|
||||
syslog("info","[ERROR]FreeNAS::API::" . $method . " : Response content: " . $client->responseContent());
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
sub freenas_iscsi_get_globalconfiguration {
|
||||
my ($scfg) = @_;
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/globalconfiguration/", undef);
|
||||
my $code = $client->responseCode();
|
||||
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_globalconfig : target_basename=" . $result->{'iscsi_basename'});
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_globalconfig");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all extents.
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-extent-
|
||||
#
|
||||
sub freenas_iscsi_get_extent {
|
||||
my ($scfg) = @_;
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/extent/?limit=0", undef);
|
||||
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_extent : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Create an extent on FreeNas
|
||||
# http://api.freenas.org/resources/iscsi/index.html#create-resource
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - lun_path
|
||||
#
|
||||
sub freenas_iscsi_create_extent {
|
||||
my ($scfg, $lun_path) = @_;
|
||||
|
||||
my $name = $lun_path;
|
||||
$name =~ s/^.*\///; # all from last /
|
||||
$name = $scfg->{'pool'} . '/' . $name;
|
||||
|
||||
my $device = $lun_path;
|
||||
$device =~ s/^\/dev\///; # strip /dev/
|
||||
|
||||
my $request = {
|
||||
"iscsi_target_extent_type" => "Disk",
|
||||
"iscsi_target_extent_name" => $name,
|
||||
"iscsi_target_extent_disk" => $device,
|
||||
};
|
||||
|
||||
my $client = freenas_api_call($scfg, 'POST', "/api/v1.0/services/iscsi/extent/", $request);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 201) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info", "FreeNAS::API::create_extent(lun_path=" . $result->{'iscsi_target_extent_path'} . ") : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "create_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove an extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete-resource
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - extent_id
|
||||
#
|
||||
sub freenas_iscsi_remove_extent {
|
||||
my ($scfg, $extent_id) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'DELETE', "/api/v1.0/services/iscsi/extent/$extent_id/", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 204) {
|
||||
syslog("info","FreeNAS::API::remove_extent(extent_id=$extent_id) : sucessfull");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error($client, "remove_extent");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of all targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-target-
|
||||
#
|
||||
sub freenas_iscsi_get_target {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/target/?limit=0", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_target() : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_target");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns a list of associated extents to targets
|
||||
# http://api.freenas.org/resources/iscsi/index.html#get--api-v1.0-services-iscsi-targettoextent-
|
||||
#
|
||||
sub freenas_iscsi_get_target_to_extent {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'GET', "/api/v1.0/services/iscsi/targettoextent/?limit=0", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_target_to_extent() : sucessfull");
|
||||
# If 'iscsi_lunid' is undef then it is set to 'Auto' in FreeNAS
|
||||
# which should be '0' in our eyes.
|
||||
# This gave Proxmox 5.x and FreeNAS 11.1 a few issues.
|
||||
foreach my $item (@$result) {
|
||||
if (!defined($item->{'iscsi_lunid'})) {
|
||||
$item->{'iscsi_lunid'} = 0;
|
||||
syslog("info", "FreeNAS::API::get_target_to_extent() : change undef iscsi_lunid to 0");
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_target_to_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Associate a FreeNas extent to a FreeNas Target
|
||||
# http://api.freenas.org/resources/iscsi/index.html#post--api-v1.0-services-iscsi-targettoextent-
|
||||
# Parameters:
|
||||
# - target config (scfg)
|
||||
# - FreeNas Target ID
|
||||
# - FreeNas Extent ID
|
||||
# - Lun ID
|
||||
#
|
||||
sub freenas_iscsi_create_target_to_extent {
|
||||
my ($scfg, $target_id, $extent_id, $lun_id) = @_;
|
||||
|
||||
my $request = {
|
||||
"iscsi_target" => $target_id,
|
||||
"iscsi_extent" => $extent_id,
|
||||
"iscsi_lunid" => $lun_id
|
||||
};
|
||||
|
||||
my $client = freenas_api_call($scfg, 'POST', "/api/v1.0/services/iscsi/targettoextent/", $request);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 201) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::create_target_to_extent(target_id=$target_id, extent_id=$extent_id, lun_id=$lun_id) : sucessfull");
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "create_target_to_extent");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove a Target to extent by it's id
|
||||
# http://api.freenas.org/resources/iscsi/index.html#delete--api-v1.0-services-iscsi-targettoextent-(int-id)-
|
||||
# Parameters:
|
||||
# - scfg
|
||||
# - link_id
|
||||
#
|
||||
sub freenas_iscsi_remove_target_to_extent {
|
||||
my ($scfg, $link_id) = @_;
|
||||
|
||||
my $client = freenas_api_call($scfg, 'DELETE', "/api/v1.0/services/iscsi/targettoextent/$link_id/", undef);
|
||||
my $code = $client->responseCode();
|
||||
if ($code == 204) {
|
||||
syslog("info","FreeNAS::API::remove_target_to_extent(link_id=$link_id) : sucessfull");
|
||||
return 1;
|
||||
} else {
|
||||
freenas_api_log_error($client, "remove_target_to_extent");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Returns all luns associated to the current target defined by $scfg->{target}
|
||||
# This method returns an array reference like "freenas_iscsi_get_extent" do
|
||||
# but with an additionnal hash entry "iscsi_lunid" retrieved from "freenas_iscsi_get_target_to_extent"
|
||||
#
|
||||
sub freenas_list_lu {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
|
||||
my @luns = ();
|
||||
my $iscsi_lunid = undef;
|
||||
|
||||
if(defined($target_id)) {
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my $extents = freenas_iscsi_get_extent($scfg);
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
if($item->{'iscsi_target'} == $target_id) {
|
||||
foreach my $node (@$extents) {
|
||||
if($node->{'id'} == $item->{'iscsi_extent'}) {
|
||||
if ($item->{'iscsi_lunid'} =~ /(\d+)/) {
|
||||
$iscsi_lunid = "$1";
|
||||
} else {
|
||||
syslog("info", "FreeNAS::API::freenas_list_lu : iscsi_lunid did not pass tainted testing");
|
||||
next;
|
||||
}
|
||||
$node->{'iscsi_lunid'} .= $iscsi_lunid;
|
||||
push(@luns , $node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
syslog("info", "FreeNAS::API::freenas_list_lu : sucessfull");
|
||||
return \@luns;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the first available "lunid" (in all targets namespaces)
|
||||
#
|
||||
sub freenas_get_first_available_lunid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $target_id = freenas_get_targetid($scfg);
|
||||
my $target2extents = freenas_iscsi_get_target_to_extent($scfg);
|
||||
my @luns = ();
|
||||
|
||||
foreach my $item (@$target2extents) {
|
||||
push(@luns, $item->{'iscsi_lunid'}) if ($item->{'iscsi_target'} == $target_id);
|
||||
}
|
||||
|
||||
my @sorted_luns = sort {$a <=> $b} @luns;
|
||||
my $lun_id = 0;
|
||||
|
||||
# find the first hole, if not, give the +1 of the last lun
|
||||
foreach my $lun (@sorted_luns) {
|
||||
last if $lun != $lun_id;
|
||||
$lun_id = $lun_id + 1;
|
||||
}
|
||||
|
||||
syslog("info", "FreeNAS::API::freenas_get_first_available_lunid : return $lun_id");
|
||||
return $lun_id;
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the target id on FreeNas of the currently configured target of this PVE storage
|
||||
#
|
||||
sub freenas_get_targetid {
|
||||
my ($scfg) = @_;
|
||||
|
||||
my $global = freenas_iscsi_get_globalconfiguration($scfg);
|
||||
my $targets = freenas_iscsi_get_target($scfg);
|
||||
my $target_id = undef;
|
||||
|
||||
foreach my $target (@$targets) {
|
||||
my $iqn = $global->{'iscsi_basename'} . ':' . $target->{'iscsi_target_name'};
|
||||
if($iqn eq $scfg->{target}) {
|
||||
$target_id = $target->{'id'};
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return $target_id;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-07-25 07:34:52.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-08-07 13:28:29.268383007 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-09-03 04:24:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-09-22 13:54:51.570048336 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -160,6 +166,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -178,6 +193,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -205,14 +238,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -237,6 +274,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2019-09-23 12:17:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-10-13 09:31:58.780554103 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -162,6 +168,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -180,6 +195,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -207,14 +240,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -239,6 +276,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
<<<<<<< HEAD
|
||||
--- ZFSPlugin.pm.orig 2019-09-23 12:17:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-10-13 09:31:58.780554103 -0400
|
||||
=======
|
||||
--- ZFSPlugin.pm.orig 2019-09-03 04:24:37.000000000 -0400
|
||||
+++ ZFSPlugin.pm 2019-09-22 13:54:51.570048336 -0400
|
||||
>>>>>>> branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -162,6 +168,15 @@
|
||||
return $class->zfs_request($scfg, undef, 'list_view', $guid);
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -180,6 +195,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -207,14 +240,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -239,6 +276,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-07-15 15:45:00.000000000 -0400
|
||||
+++ apidoc.js 2019-08-07 13:28:29.292382229 -0400
|
||||
@@ -35001,6 +35001,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -35157,6 +35182,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -35362,6 +35393,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2019-07-15 15:45:00.000000000 -0400
|
||||
+++ apidoc.js 2019-08-07 13:28:29.292382229 -0400
|
||||
@@ -35001,6 +35001,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -35157,6 +35182,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -35362,6 +35393,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-07-23 13:21:08.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-08-07 13:28:29.304381840 -0400
|
||||
@@ -6182,6 +6182,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -32977,6 +32978,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -32989,10 +32991,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33010,6 +33028,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -33026,7 +33045,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -33036,11 +33055,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -33051,8 +33070,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -33083,7 +33127,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -33091,9 +33137,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-09-03 04:31:21.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-09-22 13:54:51.602048049 -0400
|
||||
@@ -6183,6 +6183,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -32992,6 +32993,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -33004,10 +33006,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33025,6 +33043,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -33041,7 +33060,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -33051,11 +33070,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -33066,8 +33085,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -33098,7 +33142,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -33106,9 +33152,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2019-09-03 04:31:21.000000000 -0400
|
||||
+++ pvemanagerlib.js 2019-09-22 13:54:51.602048049 -0400
|
||||
@@ -6183,6 +6183,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
[ 'istgt', 'istgt'],
|
||||
[ 'iet', 'IET'],
|
||||
[ 'LIO', 'LIO']
|
||||
@@ -32992,6 +32993,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true
|
||||
}
|
||||
},
|
||||
@@ -33004,10 +33006,26 @@
|
||||
}
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33025,6 +33043,7 @@
|
||||
},
|
||||
|
||||
setValues: function diff(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -33041,7 +33060,7 @@
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -33051,11 +33070,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -33066,8 +33085,33 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL')
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -33098,7 +33142,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true
|
||||
},
|
||||
@@ -33106,9 +33152,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group')
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2022-02-04 12:08:01.000000000 -0500
|
||||
+++ ZFSPlugin.pm 2022-03-26 13:51:40.660068908 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,24 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +244,18 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +280,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
--- apidoc.js.orig 2021-11-15 10:07:34.000000000 -0500
|
||||
+++ apidoc.js 2021-12-06 08:04:01.648822707 -0500
|
||||
@@ -44064,6 +44064,31 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -44275,6 +44300,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -44547,6 +44578,31 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,189 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2022-03-17 09:08:40.000000000 -0400
|
||||
+++ pvemanagerlib.js 2022-04-03 08:54:10.229689187 -0400
|
||||
@@ -8068,6 +8068,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS-API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -49636,6 +49637,7 @@
|
||||
data: {
|
||||
isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
},
|
||||
@@ -49648,10 +49650,26 @@
|
||||
},
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_password_field').setValue('');
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = true;
|
||||
+ me.lookupReference('freenas_confirmpw_field').setValue('');
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_password_field').allowBlank = false;
|
||||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -49669,6 +49687,7 @@
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
+ values.freenas_confirmpw = values.freenas_password;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -49685,7 +49704,7 @@
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -49695,11 +49714,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -49710,9 +49729,34 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -49742,7 +49786,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -49750,9 +49796,62 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_password',
|
||||
+ reference: 'freenas_password_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=freenas_confirmpw]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_confirmpw',
|
||||
+ reference: 'freenas_confirmpw_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = this.up().down('field[name=freenas_password]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Passwords do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
},
|
||||
];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,157 +0,0 @@
|
||||
--- ZFSPlugin.pm.orig 2023-12-31 09:56:18.895228853 -0500
|
||||
+++ ZFSPlugin.pm 2023-12-31 09:57:08.830488875 -0500
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !$guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,32 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password (Deprecated)",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_secret => {
|
||||
+ description => "TrueNAS API Secret",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_token_auth => {
|
||||
+ description => "TrueNAS API Authentication with Token",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +252,20 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ truenas_secret => { optional => 1 },
|
||||
+ truenas_token_auth => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +290,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -1,470 +0,0 @@
|
||||
package PVE::Storage::ZFSPlugin;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use IO::File;
|
||||
use POSIX qw(ENOENT);
|
||||
use PVE::Tools qw(run_command);
|
||||
use PVE::Storage::ZFSPoolPlugin;
|
||||
use PVE::RESTEnvironment qw(log_warn);
|
||||
use PVE::RPCEnvironment;
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
|
||||
my @ssh_opts = ('-o', 'BatchMode=yes');
|
||||
my @ssh_cmd = ('/usr/bin/ssh', @ssh_opts);
|
||||
my $id_rsa_path = '/etc/pve/priv/zfs';
|
||||
|
||||
my $lun_cmds = {
|
||||
create_lu => 1,
|
||||
delete_lu => 1,
|
||||
import_lu => 1,
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
my ($scfg) = @_;
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
return PVE::Storage::LunCmd::Iet::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
return PVE::Storage::LunCmd::LIO::get_base($scfg);
|
||||
} else {
|
||||
$zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
|
||||
}
|
||||
};
|
||||
|
||||
sub zfs_request {
|
||||
my ($class, $scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
$timeout = PVE::RPCEnvironment->is_worker() ? 60 * 60 : 10
|
||||
if !$timeout;
|
||||
|
||||
my $msg = '';
|
||||
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg =
|
||||
PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
$msg = PVE::Storage::LunCmd::Iet::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
$msg = PVE::Storage::LunCmd::LIO::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} else {
|
||||
$zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
|
||||
}
|
||||
} else {
|
||||
|
||||
my $target = 'root@' . $scfg->{portal};
|
||||
|
||||
my $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $target];
|
||||
|
||||
if ($method eq 'zpool_list') {
|
||||
push @$cmd, 'zpool', 'list';
|
||||
} else {
|
||||
push @$cmd, 'zfs', $method;
|
||||
}
|
||||
|
||||
push @$cmd, @params;
|
||||
|
||||
my $output = sub {
|
||||
my $line = shift;
|
||||
$msg .= "$line\n";
|
||||
};
|
||||
|
||||
run_command($cmd, outfunc => $output, timeout => $timeout);
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
sub zfs_get_lu_name {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
|
||||
$zvol = ($class->parse_volname($zvol))[1];
|
||||
|
||||
my $object = ($zvol =~ /^.+\/.+/) ? "$base/$zvol" : "$base/$scfg->{pool}/$zvol";
|
||||
|
||||
my $lu_name = $class->zfs_request($scfg, undef, 'list_lu', $object);
|
||||
|
||||
return $lu_name if $lu_name;
|
||||
|
||||
die "Could not find lu_name for zvol $zvol";
|
||||
}
|
||||
|
||||
sub zfs_add_lun_mapping_entry {
|
||||
my ($class, $scfg, $zvol, $guid) = @_;
|
||||
|
||||
if (!defined($guid)) {
|
||||
$guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
}
|
||||
|
||||
$class->zfs_request($scfg, undef, 'add_view', $guid);
|
||||
}
|
||||
|
||||
sub zfs_delete_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'delete_lu', $guid);
|
||||
}
|
||||
|
||||
sub zfs_create_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
my $guid = $class->zfs_request($scfg, undef, 'create_lu', "$base/$scfg->{pool}/$zvol");
|
||||
|
||||
return $guid;
|
||||
}
|
||||
|
||||
sub zfs_import_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
$class->zfs_request($scfg, undef, 'import_lu', "$base/$scfg->{pool}/$zvol");
|
||||
}
|
||||
|
||||
sub zfs_resize_lu {
|
||||
my ($class, $scfg, $zvol, $size) = @_;
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'modify_lu', "${size}K", $guid);
|
||||
}
|
||||
|
||||
sub zfs_get_lun_number {
|
||||
my ($class, $scfg, $guid) = @_;
|
||||
|
||||
die "could not find lun_number for guid $guid" if !$guid;
|
||||
|
||||
if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
|
||||
return $1;
|
||||
}
|
||||
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
return 'zfs';
|
||||
}
|
||||
|
||||
sub plugindata {
|
||||
return {
|
||||
content => [{ images => 1 }, { images => 1 }],
|
||||
'sensitive-properties' => {},
|
||||
};
|
||||
}
|
||||
|
||||
sub properties {
|
||||
return {
|
||||
iscsiprovider => {
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
nowritecache => {
|
||||
description => "disable write caching on the target",
|
||||
type => 'boolean',
|
||||
},
|
||||
comstar_tg => {
|
||||
description => "target group for comstar views",
|
||||
type => 'string',
|
||||
},
|
||||
comstar_hg => {
|
||||
description => "host group for comstar views",
|
||||
type => 'string',
|
||||
},
|
||||
lio_tpg => {
|
||||
description => "target portal group for Linux LIO targets",
|
||||
type => 'string',
|
||||
},
|
||||
'zfs-base-path' => {
|
||||
description => "Base path where to look for the created ZFS block devices. Set"
|
||||
. " automatically during creation if not specified. Usually '/dev/zvol'.",
|
||||
type => 'string',
|
||||
format => 'pve-storage-path',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
sub options {
|
||||
return {
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
target => { fixed => 1 },
|
||||
pool => { fixed => 1 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
'zfs-base-path' => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
# Storage implementation
|
||||
|
||||
sub on_add_hook {
|
||||
my ($class, $storeid, $scfg, %param) = @_;
|
||||
|
||||
if (!$scfg->{'zfs-base-path'}) {
|
||||
my $base_path;
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$base_path = PVE::Storage::LunCmd::Comstar::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$base_path = PVE::Storage::LunCmd::Istgt::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet' || $scfg->{iscsiprovider} eq 'LIO') {
|
||||
# Provider implementations hard-code '/dev/', which does not work for distributions like
|
||||
# Debian 12. Keep that implementation as-is for backwards compatibility, but use custom
|
||||
# logic here.
|
||||
my $target = 'root@' . $scfg->{portal};
|
||||
my $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $target];
|
||||
push $cmd->@*, 'ls', '/dev/zvol';
|
||||
|
||||
my $rc = eval { run_command($cmd, timeout => 10, noerr => 1, quiet => 1) };
|
||||
my $err = $@;
|
||||
if (defined($rc) && $rc == 0) {
|
||||
$base_path = '/dev/zvol';
|
||||
} elsif (defined($rc) && $rc == ENOENT) {
|
||||
$base_path = '/dev';
|
||||
} else {
|
||||
my $message = $err ? $err : "remote command failed";
|
||||
chomp($message);
|
||||
$message .= " ($rc)" if defined($rc);
|
||||
$message .= " - check 'zfs-base-path' setting manually!";
|
||||
log_warn($message);
|
||||
$base_path = '/dev/zvol';
|
||||
}
|
||||
} else {
|
||||
$zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
|
||||
}
|
||||
|
||||
$scfg->{'zfs-base-path'} = $base_path;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sub path {
|
||||
my ($class, $scfg, $volname, $storeid, $snapname) = @_;
|
||||
|
||||
die "direct access to snapshots not implemented"
|
||||
if defined($snapname);
|
||||
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
|
||||
my $target = $scfg->{target};
|
||||
my $portal = $scfg->{portal};
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $name);
|
||||
my $lun = $class->zfs_get_lun_number($scfg, $guid);
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
sub create_base {
|
||||
my ($class, $storeid, $scfg, $volname) = @_;
|
||||
|
||||
my $snap = '__base__';
|
||||
|
||||
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) = $class->parse_volname($volname);
|
||||
|
||||
die "create_base not possible with base image\n" if $isBase;
|
||||
|
||||
my $newname = $name;
|
||||
$newname =~ s/^vm-/base-/;
|
||||
|
||||
my $newvolname = $basename ? "$basename/$newname" : "$newname";
|
||||
|
||||
$class->zfs_delete_lu($scfg, $name);
|
||||
$class->zfs_request($scfg, undef, 'rename', "$scfg->{pool}/$name", "$scfg->{pool}/$newname");
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $newname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $newname, $guid);
|
||||
|
||||
my $running = undef; #fixme : is create_base always offline ?
|
||||
|
||||
$class->volume_snapshot($scfg, $storeid, $newname, $snap, $running);
|
||||
|
||||
return $newvolname;
|
||||
}
|
||||
|
||||
sub clone_image {
|
||||
my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
|
||||
|
||||
my $name = $class->SUPER::clone_image($scfg, $storeid, $volname, $vmid, $snap);
|
||||
|
||||
# get ZFS dataset name from PVE volname
|
||||
my (undef, $clonedname) = $class->parse_volname($name);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $clonedname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $clonedname, $guid);
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
sub alloc_image {
|
||||
my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;
|
||||
|
||||
die "unsupported format '$fmt'" if $fmt ne 'raw';
|
||||
|
||||
die "illegal name '$name' - should be 'vm-$vmid-*'\n"
|
||||
if $name && $name !~ m/^vm-$vmid-/;
|
||||
|
||||
my $volname = $name;
|
||||
|
||||
$volname = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
|
||||
|
||||
$class->zfs_create_zvol($scfg, $volname, $size);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $volname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $volname, $guid);
|
||||
|
||||
return $volname;
|
||||
}
|
||||
|
||||
sub free_image {
|
||||
my ($class, $storeid, $scfg, $volname, $isBase) = @_;
|
||||
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
|
||||
$class->zfs_delete_lu($scfg, $name);
|
||||
|
||||
eval { $class->zfs_delete_zvol($scfg, $name); };
|
||||
if (my $err = $@) {
|
||||
my $guid = $class->zfs_create_lu($scfg, $name);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $name, $guid);
|
||||
die $err;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub volume_resize {
|
||||
my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
my $new_size = $class->SUPER::volume_resize($scfg, $storeid, $volname, $size, $running);
|
||||
|
||||
$class->zfs_resize_lu($scfg, $volname, $new_size);
|
||||
|
||||
return $new_size;
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
$class->zfs_request($scfg, undef, 'destroy', "$scfg->{pool}/$volname\@$snap");
|
||||
}
|
||||
|
||||
sub volume_snapshot_rollback {
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
$class->zfs_delete_lu($scfg, $volname);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'rollback', "$scfg->{pool}/$volname\@$snap");
|
||||
|
||||
$class->zfs_import_lu($scfg, $volname);
|
||||
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $volname);
|
||||
}
|
||||
|
||||
sub storage_can_replicate {
|
||||
my ($class, $scfg, $storeid, $format) = @_;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub volume_has_feature {
|
||||
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
|
||||
|
||||
my $features = {
|
||||
snapshot => { current => 1, snap => 1 },
|
||||
clone => { base => 1 },
|
||||
template => { current => 1 },
|
||||
copy => { base => 1, current => 1 },
|
||||
};
|
||||
|
||||
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) = $class->parse_volname($volname);
|
||||
|
||||
my $key = undef;
|
||||
|
||||
if ($snapname) {
|
||||
$key = 'snap';
|
||||
} else {
|
||||
$key = $isBase ? 'base' : 'current';
|
||||
}
|
||||
|
||||
return 1 if $features->{$feature}->{$key};
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub activate_storage {
|
||||
my ($class, $storeid, $scfg, $cache) = @_;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub deactivate_storage {
|
||||
my ($class, $storeid, $scfg, $cache) = @_;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub activate_volume {
|
||||
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
|
||||
|
||||
die "unable to activate snapshot from remote zfs storage" if $snapname;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub deactivate_volume {
|
||||
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
|
||||
|
||||
die "unable to deactivate snapshot from remote zfs storage" if $snapname;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,169 +0,0 @@
|
||||
--- /tmp/ZFSPlugin-8.4.orig 2026-05-22 08:54:24.992472212 -0400
|
||||
+++ /tmp/ZFSPlugin-8.4-final.pm 2026-05-22 08:51:00.460468461 -0400
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -44,6 +46,8 @@
|
||||
return PVE::Storage::LunCmd::Istgt::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
return PVE::Storage::LunCmd::Iet::get_base($scfg);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
return PVE::Storage::LunCmd::LIO::get_base($scfg);
|
||||
} else {
|
||||
@@ -67,6 +71,8 @@
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
$msg = PVE::Storage::LunCmd::Iet::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
$msg = PVE::Storage::LunCmd::LIO::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} else {
|
||||
@@ -158,7 +164,7 @@
|
||||
sub zfs_get_lun_number {
|
||||
my ($class, $scfg, $guid) = @_;
|
||||
|
||||
- die "could not find lun_number for guid $guid" if !$guid;
|
||||
+ die "could not find lun_number for guid $guid" if !defined $guid;
|
||||
|
||||
if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
|
||||
return $1;
|
||||
@@ -167,6 +173,14 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !defined $guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -186,6 +200,32 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password (Deprecated)",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_secret => {
|
||||
+ description => "TrueNAS API Secret",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_token_auth => {
|
||||
+ description => "TrueNAS API Authentication with Token",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -224,6 +264,12 @@
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ truenas_secret => { optional => 1 },
|
||||
+ truenas_token_auth => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
@@ -243,6 +289,21 @@
|
||||
my $base_path;
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$base_path = PVE::Storage::LunCmd::Comstar::get_base($scfg);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $base_path = PVE::Storage::LunCmd::FreeNAS::get_base($scfg);
|
||||
+ # Auto-detect and persist correct blocksize at storage creation time.
|
||||
+ # $scfg is the live config ref -- write_config() saves it after this hook returns.
|
||||
+ eval {
|
||||
+ my $recommended = PVE::Storage::LunCmd::FreeNAS::freenas_get_recommended_blocksize($scfg);
|
||||
+ if (defined $recommended) {
|
||||
+ my $configured = PVE::Storage::LunCmd::FreeNAS::freenas_parse_blocksize($scfg->{blocksize});
|
||||
+ if (!$configured || $configured < $recommended) {
|
||||
+ warn "freenas-proxmox: auto-correcting blocksize from " . ($configured ? $configured : 'unset') . " to $recommended for '$storeid'\n";
|
||||
+ $scfg->{blocksize} = $recommended;
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+ warn "freenas-proxmox: blocksize detection in on_add_hook failed: $@\n" if $@;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$base_path = PVE::Storage::LunCmd::Istgt::get_base($scfg);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet' || $scfg->{iscsiprovider} eq 'LIO') {
|
||||
@@ -349,6 +410,32 @@
|
||||
|
||||
$volname = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
|
||||
|
||||
+ # Auto-detect ZFS blocksize from TrueNAS API and override if wrong.
|
||||
+ # SCALE requires >= 16k; CORE works with 8k. If the configured blocksize is
|
||||
+ # less than recommended (or unset), correct it now and persist to storage.cfg.
|
||||
+ if ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ eval {
|
||||
+ my $recommended = PVE::Storage::LunCmd::FreeNAS::freenas_get_recommended_blocksize($scfg);
|
||||
+ if (defined $recommended) {
|
||||
+ my $configured = PVE::Storage::LunCmd::FreeNAS::freenas_parse_blocksize($scfg->{blocksize});
|
||||
+ if (!$configured || $configured < $recommended) {
|
||||
+ warn "freenas-proxmox: blocksize " . ($configured ? $configured : 'unset') . " < recommended $recommended -- correcting storage '$storeid'\n";
|
||||
+ $scfg->{blocksize} = $recommended;
|
||||
+ eval {
|
||||
+ require PVE::Storage;
|
||||
+ PVE::Storage::lock_storage_config(sub {
|
||||
+ my $cfg = PVE::Storage::config();
|
||||
+ $cfg->{ids}{$storeid}{blocksize} = $recommended if $cfg->{ids}{$storeid};
|
||||
+ PVE::Storage::write_config($cfg);
|
||||
+ });
|
||||
+ };
|
||||
+ warn "freenas-proxmox: could not persist blocksize to storage config: $@\n" if $@;
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+ warn "TrueNAS blocksize detection failed: $@" if $@;
|
||||
+ }
|
||||
+
|
||||
$class->zfs_create_zvol($scfg, $volname, $size);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $volname);
|
||||
@@ -1,422 +0,0 @@
|
||||
package PVE::Storage::ZFSPlugin;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use IO::File;
|
||||
use POSIX;
|
||||
use PVE::Tools qw(run_command);
|
||||
use PVE::Storage::ZFSPoolPlugin;
|
||||
use PVE::RPCEnvironment;
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
|
||||
|
||||
my @ssh_opts = ('-o', 'BatchMode=yes');
|
||||
my @ssh_cmd = ('/usr/bin/ssh', @ssh_opts);
|
||||
my $id_rsa_path = '/etc/pve/priv/zfs';
|
||||
|
||||
my $lun_cmds = {
|
||||
create_lu => 1,
|
||||
delete_lu => 1,
|
||||
import_lu => 1,
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
my ($scfg) = @_;
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
return PVE::Storage::LunCmd::Iet::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
return PVE::Storage::LunCmd::LIO::get_base;
|
||||
} else {
|
||||
$zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
|
||||
}
|
||||
};
|
||||
|
||||
sub zfs_request {
|
||||
my ($class, $scfg, $timeout, $method, @params) = @_;
|
||||
|
||||
$timeout = PVE::RPCEnvironment->is_worker() ? 60*60 : 10
|
||||
if !$timeout;
|
||||
|
||||
my $msg = '';
|
||||
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
$msg = PVE::Storage::LunCmd::Iet::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'LIO') {
|
||||
$msg = PVE::Storage::LunCmd::LIO::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} else {
|
||||
$zfs_unknown_scsi_provider->($scfg->{iscsiprovider});
|
||||
}
|
||||
} else {
|
||||
|
||||
my $target = 'root@' . $scfg->{portal};
|
||||
|
||||
my $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $target];
|
||||
|
||||
if ($method eq 'zpool_list') {
|
||||
push @$cmd, 'zpool', 'list';
|
||||
} else {
|
||||
push @$cmd, 'zfs', $method;
|
||||
}
|
||||
|
||||
push @$cmd, @params;
|
||||
|
||||
my $output = sub {
|
||||
my $line = shift;
|
||||
$msg .= "$line\n";
|
||||
};
|
||||
|
||||
run_command($cmd, outfunc => $output, timeout => $timeout);
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
sub zfs_get_lu_name {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
|
||||
$zvol = ($class->parse_volname($zvol))[1];
|
||||
|
||||
my $object = ($zvol =~ /^.+\/.+/) ? "$base/$zvol" : "$base/$scfg->{pool}/$zvol";
|
||||
|
||||
my $lu_name = $class->zfs_request($scfg, undef, 'list_lu', $object);
|
||||
|
||||
return $lu_name if $lu_name;
|
||||
|
||||
die "Could not find lu_name for zvol $zvol";
|
||||
}
|
||||
|
||||
sub zfs_add_lun_mapping_entry {
|
||||
my ($class, $scfg, $zvol, $guid) = @_;
|
||||
|
||||
if (!defined($guid)) {
|
||||
$guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
}
|
||||
|
||||
$class->zfs_request($scfg, undef, 'add_view', $guid);
|
||||
}
|
||||
|
||||
sub zfs_delete_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'delete_lu', $guid);
|
||||
}
|
||||
|
||||
sub zfs_create_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
my $guid = $class->zfs_request($scfg, undef, 'create_lu', "$base/$scfg->{pool}/$zvol");
|
||||
|
||||
return $guid;
|
||||
}
|
||||
|
||||
sub zfs_import_lu {
|
||||
my ($class, $scfg, $zvol) = @_;
|
||||
|
||||
my $base = $zfs_get_base->($scfg);
|
||||
$class->zfs_request($scfg, undef, 'import_lu', "$base/$scfg->{pool}/$zvol");
|
||||
}
|
||||
|
||||
sub zfs_resize_lu {
|
||||
my ($class, $scfg, $zvol, $size) = @_;
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $zvol);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'modify_lu', "${size}K", $guid);
|
||||
}
|
||||
|
||||
sub zfs_get_lun_number {
|
||||
my ($class, $scfg, $guid) = @_;
|
||||
|
||||
die "could not find lun_number for guid $guid" if !$guid;
|
||||
|
||||
if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
|
||||
return $1;
|
||||
}
|
||||
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
return 'zfs';
|
||||
}
|
||||
|
||||
sub plugindata {
|
||||
return {
|
||||
content => [ {images => 1}, { images => 1 }],
|
||||
};
|
||||
}
|
||||
|
||||
sub properties {
|
||||
return {
|
||||
iscsiprovider => {
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
nowritecache => {
|
||||
description => "disable write caching on the target",
|
||||
type => 'boolean',
|
||||
},
|
||||
comstar_tg => {
|
||||
description => "target group for comstar views",
|
||||
type => 'string',
|
||||
},
|
||||
comstar_hg => {
|
||||
description => "host group for comstar views",
|
||||
type => 'string',
|
||||
},
|
||||
lio_tpg => {
|
||||
description => "target portal group for Linux LIO targets",
|
||||
type => 'string',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
sub options {
|
||||
return {
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
target => { fixed => 1 },
|
||||
pool => { fixed => 1 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
# Storage implementation
|
||||
|
||||
sub path {
|
||||
my ($class, $scfg, $volname, $storeid, $snapname) = @_;
|
||||
|
||||
die "direct access to snapshots not implemented"
|
||||
if defined($snapname);
|
||||
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
|
||||
my $target = $scfg->{target};
|
||||
my $portal = $scfg->{portal};
|
||||
|
||||
my $guid = $class->zfs_get_lu_name($scfg, $name);
|
||||
my $lun = $class->zfs_get_lun_number($scfg, $guid);
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
sub create_base {
|
||||
my ($class, $storeid, $scfg, $volname) = @_;
|
||||
|
||||
my $snap = '__base__';
|
||||
|
||||
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
|
||||
$class->parse_volname($volname);
|
||||
|
||||
die "create_base not possible with base image\n" if $isBase;
|
||||
|
||||
my $newname = $name;
|
||||
$newname =~ s/^vm-/base-/;
|
||||
|
||||
my $newvolname = $basename ? "$basename/$newname" : "$newname";
|
||||
|
||||
$class->zfs_delete_lu($scfg, $name);
|
||||
$class->zfs_request($scfg, undef, 'rename', "$scfg->{pool}/$name", "$scfg->{pool}/$newname");
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $newname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $newname, $guid);
|
||||
|
||||
my $running = undef; #fixme : is create_base always offline ?
|
||||
|
||||
$class->volume_snapshot($scfg, $storeid, $newname, $snap, $running);
|
||||
|
||||
return $newvolname;
|
||||
}
|
||||
|
||||
sub clone_image {
|
||||
my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
|
||||
|
||||
my $name = $class->SUPER::clone_image($scfg, $storeid, $volname, $vmid, $snap);
|
||||
|
||||
# get ZFS dataset name from PVE volname
|
||||
my (undef, $clonedname) = $class->parse_volname($name);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $clonedname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $clonedname, $guid);
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
sub alloc_image {
|
||||
my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;
|
||||
|
||||
die "unsupported format '$fmt'" if $fmt ne 'raw';
|
||||
|
||||
die "illegal name '$name' - should be 'vm-$vmid-*'\n"
|
||||
if $name && $name !~ m/^vm-$vmid-/;
|
||||
|
||||
my $volname = $name;
|
||||
|
||||
$volname = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
|
||||
|
||||
$class->zfs_create_zvol($scfg, $volname, $size);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $volname);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $volname, $guid);
|
||||
|
||||
return $volname;
|
||||
}
|
||||
|
||||
sub free_image {
|
||||
my ($class, $storeid, $scfg, $volname, $isBase) = @_;
|
||||
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
|
||||
$class->zfs_delete_lu($scfg, $name);
|
||||
|
||||
eval { $class->zfs_delete_zvol($scfg, $name); };
|
||||
if (my $err = $@) {
|
||||
my $guid = $class->zfs_create_lu($scfg, $name);
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $name, $guid);
|
||||
die $err;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub volume_resize {
|
||||
my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
my $new_size = $class->SUPER::volume_resize($scfg, $storeid, $volname, $size, $running);
|
||||
|
||||
$class->zfs_resize_lu($scfg, $volname, $new_size);
|
||||
|
||||
return $new_size;
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
$class->zfs_request($scfg, undef, 'destroy', "$scfg->{pool}/$volname\@$snap");
|
||||
}
|
||||
|
||||
sub volume_snapshot_rollback {
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
$volname = ($class->parse_volname($volname))[1];
|
||||
|
||||
$class->zfs_delete_lu($scfg, $volname);
|
||||
|
||||
$class->zfs_request($scfg, undef, 'rollback', "$scfg->{pool}/$volname\@$snap");
|
||||
|
||||
$class->zfs_import_lu($scfg, $volname);
|
||||
|
||||
$class->zfs_add_lun_mapping_entry($scfg, $volname);
|
||||
}
|
||||
|
||||
sub storage_can_replicate {
|
||||
my ($class, $scfg, $storeid, $format) = @_;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub volume_has_feature {
|
||||
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
|
||||
|
||||
my $features = {
|
||||
snapshot => { current => 1, snap => 1},
|
||||
clone => { base => 1},
|
||||
template => { current => 1},
|
||||
copy => { base => 1, current => 1},
|
||||
};
|
||||
|
||||
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
|
||||
$class->parse_volname($volname);
|
||||
|
||||
my $key = undef;
|
||||
|
||||
if ($snapname) {
|
||||
$key = 'snap';
|
||||
} else {
|
||||
$key = $isBase ? 'base' : 'current';
|
||||
}
|
||||
|
||||
return 1 if $features->{$feature}->{$key};
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub activate_storage {
|
||||
my ($class, $storeid, $scfg, $cache) = @_;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub deactivate_storage {
|
||||
my ($class, $storeid, $scfg, $cache) = @_;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub activate_volume {
|
||||
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
|
||||
|
||||
die "unable to activate snapshot from remote zfs storage" if $snapname;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub deactivate_volume {
|
||||
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
|
||||
|
||||
die "unable to deactivate snapshot from remote zfs storage" if $snapname;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,201 +0,0 @@
|
||||
--- /mnt/c/Users/Kevin/eclipse-workspace/freenas-proxmox/stable-8/perl5/PVE/Storage/ZFSPlugin.pm.orig 2026-05-20 12:28:37.312211300 -0400
|
||||
+++ /tmp/ZFSPlugin-8x-work.pm 2026-05-22 08:57:21.728470343 -0400
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use base qw(PVE::Storage::ZFSPoolPlugin);
|
||||
use PVE::Storage::LunCmd::Comstar;
|
||||
+use PVE::Storage::LunCmd::FreeNAS;
|
||||
use PVE::Storage::LunCmd::Istgt;
|
||||
use PVE::Storage::LunCmd::Iet;
|
||||
use PVE::Storage::LunCmd::LIO;
|
||||
@@ -26,13 +27,14 @@
|
||||
modify_lu => 1,
|
||||
add_view => 1,
|
||||
list_view => 1,
|
||||
+ list_extent => 1,
|
||||
list_lu => 1,
|
||||
};
|
||||
|
||||
my $zfs_unknown_scsi_provider = sub {
|
||||
my ($provider) = @_;
|
||||
|
||||
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet, LIO]";
|
||||
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet, LIO]";
|
||||
};
|
||||
|
||||
my $zfs_get_base = sub {
|
||||
@@ -40,6 +42,8 @@
|
||||
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
return PVE::Storage::LunCmd::Comstar::get_base;
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ return PVE::Storage::LunCmd::FreeNAS::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
return PVE::Storage::LunCmd::Istgt::get_base;
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -62,6 +66,8 @@
|
||||
if ($lun_cmds->{$method}) {
|
||||
if ($scfg->{iscsiprovider} eq 'comstar') {
|
||||
$msg = PVE::Storage::LunCmd::Comstar::run_lun_command($scfg, $timeout, $method, @params);
|
||||
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
|
||||
+ $msg = PVE::Storage::LunCmd::FreeNAS::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
|
||||
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
|
||||
} elsif ($scfg->{iscsiprovider} eq 'iet') {
|
||||
@@ -157,7 +163,7 @@
|
||||
sub zfs_get_lun_number {
|
||||
my ($class, $scfg, $guid) = @_;
|
||||
|
||||
- die "could not find lun_number for guid $guid" if !$guid;
|
||||
+ die "could not find lun_number for guid $guid" if !defined $guid;
|
||||
|
||||
if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
|
||||
return $1;
|
||||
@@ -166,6 +172,15 @@
|
||||
die "lun_number for guid $guid is not a number";
|
||||
}
|
||||
|
||||
+# Part of the multipath enhancement
|
||||
+sub zfs_get_wwid_number {
|
||||
+ my ($class, $scfg, $guid) = @_;
|
||||
+
|
||||
+ die "could not find lun_number for guid $guid" if !defined $guid;
|
||||
+
|
||||
+ return $class->zfs_request($scfg, undef, 'list_extent', $guid);
|
||||
+}
|
||||
+
|
||||
# Configuration
|
||||
|
||||
sub type {
|
||||
@@ -184,6 +199,32 @@
|
||||
description => "iscsi provider",
|
||||
type => 'string',
|
||||
},
|
||||
+ # This is for FreeNAS iscsi and API intergration
|
||||
+ # And some enhancements asked by the community
|
||||
+ freenas_user => {
|
||||
+ description => "FreeNAS API Username",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ freenas_password => {
|
||||
+ description => "FreeNAS API Password (Deprecated)",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_secret => {
|
||||
+ description => "TrueNAS API Secret",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
+ truenas_token_auth => {
|
||||
+ description => "TrueNAS API Authentication with Token",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_use_ssl => {
|
||||
+ description => "FreeNAS API access via SSL",
|
||||
+ type => 'boolean',
|
||||
+ },
|
||||
+ freenas_apiv4_host => {
|
||||
+ description => "FreeNAS API Host",
|
||||
+ type => 'string',
|
||||
+ },
|
||||
# this will disable write caching on comstar and istgt.
|
||||
# it is not implemented for iet. iet blockio always operates with
|
||||
# writethrough caching when not in readonly mode
|
||||
@@ -211,14 +252,20 @@
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
- target => { fixed => 1 },
|
||||
- pool => { fixed => 1 },
|
||||
+ target => { fixed => 0 },
|
||||
+ pool => { fixed => 0 },
|
||||
blocksize => { fixed => 1 },
|
||||
iscsiprovider => { fixed => 1 },
|
||||
nowritecache => { optional => 1 },
|
||||
sparse => { optional => 1 },
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
+ freenas_user => { optional => 1 },
|
||||
+ freenas_password => { optional => 1 },
|
||||
+ truenas_secret => { optional => 1 },
|
||||
+ truenas_token_auth => { optional => 1 },
|
||||
+ freenas_use_ssl => { optional => 1 },
|
||||
+ freenas_apiv4_host => { optional => 1 },
|
||||
lio_tpg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
@@ -243,6 +290,40 @@
|
||||
|
||||
my $path = "iscsi://$portal/$target/$lun";
|
||||
|
||||
+ # Multipath enhancement
|
||||
+ eval {
|
||||
+ my $wwid = $class->zfs_get_wwid_number($scfg, $guid);
|
||||
+# syslog(info,"JD: path get_lun_number guid $guid");
|
||||
+
|
||||
+ if ($wwid =~ /^([-\@\w.]+)$/) {
|
||||
+ $wwid = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ die "Bad data in '$wwid'"; # log this somewhere
|
||||
+ }
|
||||
+ my $wwid_end = substr $wwid, 16;
|
||||
+
|
||||
+ my $mapper = '';
|
||||
+ sleep 3;
|
||||
+ run_command("iscsiadm -m session --rescan");
|
||||
+ sleep 3;
|
||||
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
|
||||
+ my ($mapper_device) = split(' ', $line);
|
||||
+ $mapper_device = "" unless $mapper_device;
|
||||
+ $mapper .= $mapper_device;
|
||||
+
|
||||
+ if ($mapper =~ /^([-\@\w.]+)$/) {
|
||||
+ $mapper = $1; # $data now untainted
|
||||
+ } else {
|
||||
+ $mapper = '';
|
||||
+ }
|
||||
+
|
||||
+# syslog(info,"Multipath mapper found: $mapper\n");
|
||||
+ if ($mapper ne "") {
|
||||
+ $path = "/dev/mapper/$mapper";
|
||||
+ sleep 5;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
return ($path, $vmid, $vtype);
|
||||
}
|
||||
|
||||
@@ -299,7 +380,33 @@
|
||||
my $volname = $name;
|
||||
|
||||
$volname = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
|
||||
-
|
||||
+
|
||||
+ # Auto-detect ZFS blocksize from TrueNAS API and override if wrong.
|
||||
+ # SCALE requires >= 16k; CORE works with 8k. If the configured blocksize is
|
||||
+ # less than recommended (or unset), correct it now and persist to storage.cfg.
|
||||
+ if ( eq 'freenas') {
|
||||
+ eval {
|
||||
+ my = PVE::Storage::LunCmd::FreeNAS::freenas_get_recommended_blocksize(HASH(0x6158b91f5240));
|
||||
+ if (defined ) {
|
||||
+ my = PVE::Storage::LunCmd::FreeNAS::freenas_parse_blocksize();
|
||||
+ if (! || < ) {
|
||||
+ warn "freenas-proxmox: blocksize " . ( ? : 'unset') . " < recommended -- correcting storage ''\n";
|
||||
+ = ;
|
||||
+ eval {
|
||||
+ require PVE::Storage;
|
||||
+ PVE::Storage::lock_storage_config(sub {
|
||||
+ my HASH(0x6158b91f52a0) = PVE::Storage::config();
|
||||
+ = if HASH(0x6158b91f5420);
|
||||
+ PVE::Storage::write_config(HASH(0x6158b91f52a0));
|
||||
+ });
|
||||
+ };
|
||||
+ warn "freenas-proxmox: could not persist blocksize to storage config: \n" if ;
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+ warn "TrueNAS blocksize detection failed: " if ;
|
||||
+ }
|
||||
+
|
||||
$class->zfs_create_zvol($scfg, $volname, $size);
|
||||
|
||||
my $guid = $class->zfs_create_lu($scfg, $volname);
|
||||
@@ -1,91 +0,0 @@
|
||||
--- apidoc.js.orig 2024-01-06 13:02:06.730512378 -0500
|
||||
+++ apidoc.js 2024-01-06 13:02:55.349787105 -0500
|
||||
@@ -50336,6 +50336,37 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS Secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -50555,6 +50586,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -50854,6 +50891,37 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
||||
--- apidoc.js.orig 2024-01-06 13:02:06.730512378 -0500
|
||||
+++ apidoc.js 2024-01-06 13:02:55.349787105 -0500
|
||||
@@ -50336,6 +50336,37 @@
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
},
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS Secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
"optional" : 1,
|
||||
@@ -50555,6 +50586,12 @@
|
||||
"type" : "boolean",
|
||||
"typetext" : "<boolean>"
|
||||
},
|
||||
+ "target" : {
|
||||
+ "description" : "iSCSI target.",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
"transport" : {
|
||||
"description" : "Gluster transport: tcp or rdma",
|
||||
"enum" : [
|
||||
@@ -50854,6 +50891,37 @@
|
||||
"optional" : 1,
|
||||
"type" : "string",
|
||||
"typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_user" : {
|
||||
+ "description" : "FreeNAS user for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_password" : {
|
||||
+ "description" : "FreeNAS password for API access (Deprecated)",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "truenas_secret" : {
|
||||
+ "description" : "TrueNAS secret for API access",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
+ },
|
||||
+ "freenas_use_ssl" : {
|
||||
+ "description" : "FreeNAS API access via SSL",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "boolean",
|
||||
+ "typetext" : "<boolean>"
|
||||
+ },
|
||||
+ "freenas_apiv4_host" : {
|
||||
+ "description" : "FreeNAS API Host via IPv4",
|
||||
+ "format" : "address",
|
||||
+ "optional" : 1,
|
||||
+ "type" : "string",
|
||||
+ "typetext" : "<string>"
|
||||
},
|
||||
"fuse" : {
|
||||
"description" : "Mount CephFS through FUSE.",
|
||||
@@ -1,289 +0,0 @@
|
||||
--- pvemanagerlib.js.orig 2023-12-30 15:36:27.913505863 -0500
|
||||
+++ pvemanagerlib.js 2024-01-02 09:30:56.000000000 -0500
|
||||
@@ -9228,6 +9228,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS/TrueNAS API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -58017,16 +58018,24 @@
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSInputPanel', {
|
||||
extend: 'PVE.panel.StorageBase',
|
||||
|
||||
viewModel: {
|
||||
parent: null,
|
||||
data: {
|
||||
+isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
isLIO: false,
|
||||
- isComstar: true,
|
||||
+ isToken: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
+formulas: {
|
||||
+ hideUsername: function(get) {
|
||||
+ return (!get('isFreeNAS') || !(get('isFreeNAS') && !get('isToken')));
|
||||
+ },
|
||||
+ },
|
||||
},
|
||||
|
||||
controller: {
|
||||
@@ -58034,13 +58043,42 @@
|
||||
control: {
|
||||
'field[name=iscsiprovider]': {
|
||||
change: 'changeISCSIProvider',
|
||||
+},
|
||||
+ 'field[name=truenas_token_auth]': {
|
||||
+ change: 'changeUsername',
|
||||
},
|
||||
},
|
||||
changeISCSIProvider: function(f, newVal, oldVal) {
|
||||
+var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('truenas_token_auth_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ changeUsername: function(f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
+ var vm = me.getViewModel();
|
||||
+ vm.set('isToken', newVal);
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = newVal;
|
||||
+ if (newVal) {
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -58053,28 +58091,78 @@
|
||||
|
||||
values.nowritecache = values.writecache ? 0 : 1;
|
||||
delete values.writecache;
|
||||
+ console.warn(values.freenas_password);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ console.warn(values.truenas_secret);
|
||||
|
||||
return me.callParent([values]);
|
||||
},
|
||||
|
||||
setValues: function(values) {
|
||||
- values.writecache = values.nowritecache ? 0 : 1;
|
||||
- this.callParent([values]);
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ values.truenas_confirm_secret = values.truenas_secret;
|
||||
+ values.writecache = values.nowritecache ? 0 : 1;
|
||||
+ this.callParent([values]);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
- var me = this;
|
||||
+ var me = this;
|
||||
+
|
||||
+ var tnsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_secret',
|
||||
+ reference: 'truenas_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function(f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=truenas_confirm_secret]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ });
|
||||
|
||||
- me.column1 = [
|
||||
- {
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
- name: 'portal',
|
||||
+ var tnconfirmsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_confirm_secret',
|
||||
+ reference: 'truenas_confirm_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm API Password'),
|
||||
+ validator: function(value) {
|
||||
+ var pw = me.up().down('field[name=truenas_secret]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return "Secrets do not match!";
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ me.column1 = [
|
||||
+ {
|
||||
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ name: 'portal',
|
||||
value: '',
|
||||
fieldLabel: gettext('Portal'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'pool',
|
||||
value: '',
|
||||
fieldLabel: gettext('Pool'),
|
||||
@@ -58084,11 +58172,11 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'blocksize',
|
||||
value: '4k',
|
||||
- fieldLabel: gettext('Block Size'),
|
||||
+ fieldLabel: gettext('ZFS Block Size'),
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
- xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
+ xtype: 'textfield',
|
||||
name: 'target',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target'),
|
||||
@@ -58099,8 +58187,59 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
allowBlank: true,
|
||||
+},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'truenas_token_auth',
|
||||
+ reference: 'truenas_token_auth_field',
|
||||
+ inputId: 'truenas_use_token_auth_field',
|
||||
+ checked: false,
|
||||
+ listeners: {
|
||||
+ change: function(field, newValue) {
|
||||
+ if (newValue === true) {
|
||||
+ tnsecret.labelEl.update('API Token');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Token');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ tnsecret.labelEl.update('API Password');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Password');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API Token Auth'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{hideUsername}'
|
||||
+ },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -58131,7 +58270,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}'
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -58139,15 +58280,32 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
- fieldLabel: gettext('Target portal group'),
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('Target portal group'),
|
||||
+ allowBlank: true
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}'
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ tnsecret,
|
||||
+ tnconfirmsecret,
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
},
|
||||
});
|
||||
+
|
||||
Ext.define('PVE.storage.ZFSPoolSelector', {
|
||||
extend: 'PVE.form.ComboBoxSetStoreNode',
|
||||
alias: 'widget.pveZFSPoolSelector',
|
||||
@@ -1,241 +0,0 @@
|
||||
--- /tmp/pvemanagerlib-8.4.14-stock.js 2026-05-19 17:46:16.553917259 -0400
|
||||
+++ /tmp/pvemanagerlib-8.4.14-patched-v2.js 2026-05-19 21:35:03.162563535 -0400
|
||||
@@ -9745,6 +9745,7 @@
|
||||
alias: ['widget.pveiScsiProviderSelector'],
|
||||
comboItems: [
|
||||
['comstar', 'Comstar'],
|
||||
+ ['freenas', 'FreeNAS/TrueNAS API'],
|
||||
['istgt', 'istgt'],
|
||||
['iet', 'IET'],
|
||||
['LIO', 'LIO'],
|
||||
@@ -62673,10 +62674,17 @@
|
||||
viewModel: {
|
||||
parent: null,
|
||||
data: {
|
||||
- isLIO: false,
|
||||
isComstar: true,
|
||||
+ isFreeNAS: false,
|
||||
+ isLIO: false,
|
||||
+ isToken: false,
|
||||
hasWriteCacheOption: true,
|
||||
},
|
||||
+ formulas: {
|
||||
+ hideUsername: function(get) {
|
||||
+ return (!get('isFreeNAS') || !(get('isFreeNAS') && !get('isToken')));
|
||||
+ },
|
||||
+ },
|
||||
},
|
||||
|
||||
controller: {
|
||||
@@ -62685,12 +62693,41 @@
|
||||
'field[name=iscsiprovider]': {
|
||||
change: 'changeISCSIProvider',
|
||||
},
|
||||
+ 'field[name=truenas_token_auth]': {
|
||||
+ change: 'changeUsername',
|
||||
+ },
|
||||
},
|
||||
changeISCSIProvider: function (f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
var vm = this.getViewModel();
|
||||
vm.set('isLIO', newVal === 'LIO');
|
||||
vm.set('isComstar', newVal === 'comstar');
|
||||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
|
||||
+ vm.set('isFreeNAS', newVal === 'freenas');
|
||||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
|
||||
+ if (newVal !== 'freenas') {
|
||||
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
|
||||
+ me.lookupReference('truenas_token_auth_field').setValue(false);
|
||||
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = true;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').setValue('');
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_secret_field').allowBlank = false;
|
||||
+ me.lookupReference('truenas_confirm_secret_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ changeUsername: function (f, newVal, oldVal) {
|
||||
+ var me = this;
|
||||
+ var vm = me.getViewModel();
|
||||
+ vm.set('isToken', newVal);
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = newVal;
|
||||
+ if (newVal) {
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ }
|
||||
},
|
||||
},
|
||||
|
||||
@@ -62703,11 +62740,18 @@
|
||||
|
||||
values.nowritecache = values.writecache ? 0 : 1;
|
||||
delete values.writecache;
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
|
||||
return me.callParent([values]);
|
||||
},
|
||||
|
||||
setValues: function (values) {
|
||||
+ if (values.freenas_password) {
|
||||
+ values.truenas_secret = values.freenas_password;
|
||||
+ }
|
||||
+ values.truenas_confirm_secret = values.truenas_secret;
|
||||
values.writecache = values.nowritecache ? 0 : 1;
|
||||
this.callParent([values]);
|
||||
},
|
||||
@@ -62715,6 +62759,47 @@
|
||||
initComponent: function () {
|
||||
var me = this;
|
||||
|
||||
+ var tnsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_secret',
|
||||
+ reference: 'truenas_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('API Password'),
|
||||
+ change: function (f, value) {
|
||||
+ if (f.rendered) {
|
||||
+ f.up().down('field[name=truenas_confirm_secret]').validate();
|
||||
+ }
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ var tnconfirmsecret = Ext.create('Ext.form.TextField', {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'truenas_confirm_secret',
|
||||
+ reference: 'truenas_confirm_secret_field',
|
||||
+ inputType: me.isCreate ? '' : 'password',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ submitValue: false,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('Confirm API Password'),
|
||||
+ validator: function (value) {
|
||||
+ var pw = me.up().down('field[name=truenas_secret]').getValue();
|
||||
+ if (pw !== value) {
|
||||
+ return 'Secrets do not match!';
|
||||
+ }
|
||||
+ return true;
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
me.column1 = [
|
||||
{
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
@@ -62749,9 +62834,60 @@
|
||||
name: 'comstar_tg',
|
||||
value: '',
|
||||
fieldLabel: gettext('Target group'),
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}',
|
||||
+ },
|
||||
allowBlank: true,
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'freenas_use_ssl',
|
||||
+ reference: 'freenas_use_ssl_field',
|
||||
+ inputId: 'freenas_use_ssl_field',
|
||||
+ checked: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API use SSL'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'proxmoxcheckbox',
|
||||
+ name: 'truenas_token_auth',
|
||||
+ reference: 'truenas_token_auth_field',
|
||||
+ inputId: 'truenas_use_token_auth_field',
|
||||
+ checked: false,
|
||||
+ listeners: {
|
||||
+ change: function (field, newValue) {
|
||||
+ if (newValue === true) {
|
||||
+ tnsecret.labelEl.update('API Token');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Token');
|
||||
+ me.lookupReference('freenas_user_field').setValue('');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = true;
|
||||
+ } else {
|
||||
+ tnsecret.labelEl.update('API Password');
|
||||
+ tnconfirmsecret.labelEl.update('Confirm API Password');
|
||||
+ me.lookupReference('freenas_user_field').allowBlank = false;
|
||||
+ }
|
||||
+ },
|
||||
+ },
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ uncheckedValue: 0,
|
||||
+ fieldLabel: gettext('API Token Auth'),
|
||||
+ },
|
||||
+ {
|
||||
+ xtype: 'textfield',
|
||||
+ name: 'freenas_user',
|
||||
+ reference: 'freenas_user_field',
|
||||
+ inputId: 'freenas_user_field',
|
||||
+ value: '',
|
||||
+ fieldLabel: gettext('API Username'),
|
||||
+ bind: {
|
||||
+ hidden: '{hideUsername}',
|
||||
+ },
|
||||
+ },
|
||||
];
|
||||
|
||||
me.column2 = [
|
||||
@@ -62783,7 +62919,9 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'comstar_hg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
|
||||
+ bind: {
|
||||
+ hidden: '{!isComstar}',
|
||||
+ },
|
||||
fieldLabel: gettext('Host group'),
|
||||
allowBlank: true,
|
||||
},
|
||||
@@ -62791,10 +62929,26 @@
|
||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||
name: 'lio_tpg',
|
||||
value: '',
|
||||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
|
||||
- allowBlank: false,
|
||||
+ bind: {
|
||||
+ hidden: '{!isLIO}',
|
||||
+ },
|
||||
+ allowBlank: true,
|
||||
fieldLabel: gettext('Target portal group'),
|
||||
},
|
||||
+ {
|
||||
+ xtype: 'proxmoxtextfield',
|
||||
+ name: 'freenas_apiv4_host',
|
||||
+ reference: 'freenas_apiv4_host_field',
|
||||
+ value: '',
|
||||
+ editable: true,
|
||||
+ emptyText: Proxmox.Utils.noneText,
|
||||
+ bind: {
|
||||
+ hidden: '{!isFreeNAS}',
|
||||
+ },
|
||||
+ fieldLabel: gettext('API IPv4 Host'),
|
||||
+ },
|
||||
+ tnsecret,
|
||||
+ tnconfirmsecret,
|
||||
];
|
||||
|
||||
me.callParent();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user