Patches created for latest 5.4 branch of Proxmox VE
- Patch created for pve-manager 5.4-11 specifically for pvemanagerlib.js - Patch created for pve-manager 5.4-13 specifically for pvemanagerlib.js - Patch created for libpve-storage-perl 5.0-44 specifically for ZFSPlugin.pm
This commit is contained in:
		
							parent
							
								
									16b3bd1a0b
								
							
						
					
					
						commit
						5091f0ae12
					
				|  | @ -0,0 +1,147 @@ | ||||||
|  | --- 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,5 +1,5 @@ | ||||||
| --- ZFSPlugin.pm.orig	2019-04-30 09:54:55.000000000 -0400
 | --- ZFSPlugin.pm.orig	2019-06-25 06:54:50.000000000 -0400
 | ||||||
| +++ ZFSPlugin.pm	2019-05-11 10:32:36.326734352 -0400
 | +++ ZFSPlugin.pm	2019-07-16 13:36:48.817831174 -0400
 | ||||||
| @@ -10,6 +10,7 @@
 | @@ -10,6 +10,7 @@
 | ||||||
|   |   | ||||||
|  use base qw(PVE::Storage::ZFSPoolPlugin); |  use base qw(PVE::Storage::ZFSPoolPlugin); | ||||||
|  |  | ||||||
|  | @ -0,0 +1,189 @@ | ||||||
|  | --- 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;
 | ||||||
|  | +		}
 | ||||||
|  |  	    } | ||||||
|  |  	]; | ||||||
|  |   | ||||||
|  | @ -0,0 +1,189 @@ | ||||||
|  | --- 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,5 +1,5 @@ | ||||||
| --- pvemanagerlib.js.orig	2019-04-24 07:28:11.000000000 -0400
 | --- pvemanagerlib.js.orig	2019-07-26 04:14:56.000000000 -0400
 | ||||||
| +++ pvemanagerlib.js	2019-05-11 10:33:38.130198999 -0400
 | +++ pvemanagerlib.js	2019-08-05 16:02:38.484913553 -0400
 | ||||||
| @@ -6094,6 +6094,7 @@
 | @@ -6094,6 +6094,7 @@
 | ||||||
|      alias: ['widget.pveiScsiProviderSelector'], |      alias: ['widget.pveiScsiProviderSelector'], | ||||||
|      comboItems: [ |      comboItems: [ | ||||||
|  | @ -8,7 +8,7 @@ | ||||||
|  	[ 'istgt', 'istgt'], |  	[ 'istgt', 'istgt'], | ||||||
|  	[ 'iet', 'IET'], |  	[ 'iet', 'IET'], | ||||||
|  	[ 'LIO', 'LIO'] |  	[ 'LIO', 'LIO'] | ||||||
| @@ -31483,6 +31484,7 @@
 | @@ -31722,6 +31723,7 @@
 | ||||||
|  	data: { |  	data: { | ||||||
|  	    isLIO: false, |  	    isLIO: false, | ||||||
|  	    isComstar: true, |  	    isComstar: true, | ||||||
|  | @ -16,7 +16,7 @@ | ||||||
|  	    hasWriteCacheOption: true |  	    hasWriteCacheOption: true | ||||||
|  	} |  	} | ||||||
|      }, |      }, | ||||||
| @@ -31495,10 +31497,26 @@
 | @@ -31734,10 +31736,26 @@
 | ||||||
|  	    } |  	    } | ||||||
|  	}, |  	}, | ||||||
|  	changeISCSIProvider: function(f, newVal, oldVal) { |  	changeISCSIProvider: function(f, newVal, oldVal) { | ||||||
|  | @ -44,7 +44,7 @@ | ||||||
|  	} |  	} | ||||||
|      }, |      }, | ||||||
|   |   | ||||||
| @@ -31516,6 +31534,7 @@
 | @@ -31755,6 +31773,7 @@
 | ||||||
|      }, |      }, | ||||||
|   |   | ||||||
|      setValues: function diff(values) { |      setValues: function diff(values) { | ||||||
|  | @ -52,7 +52,7 @@ | ||||||
|  	values.writecache = values.nowritecache ? 0 : 1; |  	values.writecache = values.nowritecache ? 0 : 1; | ||||||
|  	this.callParent([values]); |  	this.callParent([values]); | ||||||
|      }, |      }, | ||||||
| @@ -31532,7 +31551,7 @@
 | @@ -31771,7 +31790,7 @@
 | ||||||
|  		allowBlank: false |  		allowBlank: false | ||||||
|  	    }, |  	    }, | ||||||
|  	    { |  	    { | ||||||
|  | @ -61,7 +61,7 @@ | ||||||
|  		name: 'pool', |  		name: 'pool', | ||||||
|  		value: '', |  		value: '', | ||||||
|  		fieldLabel: gettext('Pool'), |  		fieldLabel: gettext('Pool'), | ||||||
| @@ -31542,11 +31561,11 @@
 | @@ -31781,11 +31800,11 @@
 | ||||||
|  		xtype: me.isCreate ? 'textfield' : 'displayfield', |  		xtype: me.isCreate ? 'textfield' : 'displayfield', | ||||||
|  		name: 'blocksize', |  		name: 'blocksize', | ||||||
|  		value: '4k', |  		value: '4k', | ||||||
|  | @ -75,7 +75,7 @@ | ||||||
|  		name: 'target', |  		name: 'target', | ||||||
|  		value: '', |  		value: '', | ||||||
|  		fieldLabel: gettext('Target'), |  		fieldLabel: gettext('Target'), | ||||||
| @@ -31557,8 +31576,33 @@
 | @@ -31796,8 +31815,33 @@
 | ||||||
|  		name: 'comstar_tg', |  		name: 'comstar_tg', | ||||||
|  		value: '', |  		value: '', | ||||||
|  		fieldLabel: gettext('Target group'), |  		fieldLabel: gettext('Target group'), | ||||||
|  | @ -110,7 +110,7 @@ | ||||||
|  	    } |  	    } | ||||||
|  	]; |  	]; | ||||||
|   |   | ||||||
| @@ -31589,7 +31633,9 @@
 | @@ -31828,7 +31872,9 @@
 | ||||||
|  		xtype: me.isCreate ? 'textfield' : 'displayfield', |  		xtype: me.isCreate ? 'textfield' : 'displayfield', | ||||||
|  		name: 'comstar_hg', |  		name: 'comstar_hg', | ||||||
|  		value: '', |  		value: '', | ||||||
|  | @ -121,7 +121,7 @@ | ||||||
|  		fieldLabel: gettext('Host group'), |  		fieldLabel: gettext('Host group'), | ||||||
|  		allowBlank: true |  		allowBlank: true | ||||||
|  	    }, |  	    }, | ||||||
| @@ -31597,9 +31643,62 @@
 | @@ -31836,9 +31882,62 @@
 | ||||||
|  		xtype: me.isCreate ? 'textfield' : 'displayfield', |  		xtype: me.isCreate ? 'textfield' : 'displayfield', | ||||||
|  		name: 'lio_tpg', |  		name: 'lio_tpg', | ||||||
|  		value: '', |  		value: '', | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue