Skip to content

Commit 9b95a08

Browse files
Merge pull request #94 from TheGrandWazoo/master
Merge fixes
2 parents 837399e + bf5bec6 commit 9b95a08

File tree

4 files changed

+369
-180
lines changed

4 files changed

+369
-180
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This will place you back to a normal and unpatched Proxmox VE install.
7171

7272
Please be aware that this plugin uses the FreeNAS APIs and NOT the ssh/scp interface like the other plugins use, but...
7373

74-
You will still need to configure the SSH connector for listing the ZFS Pools because this is currently being done in a Proxmox module (ZFSPoolPlugin.pm). To configure this please follow the steps at https://pve.proxmox.com/wiki/Storage:_ZFS_over_iSCSI that have to do with SSH between Proxmox VE and FreeNAS. The code segment should start out mkdir /etc/pve/priv/zfs.
74+
You will still need to configure the SSH connector for listing the ZFS Pools because this is currently being done in a Proxmox module (ZFSPoolPlugin.pm). To configure this please follow the steps at https://pve.proxmox.com/wiki/Storage:_ZFS_over_iSCSI that have to do with SSH between Proxmox VE and FreeNAS. The code segment should start out `mkdir /etc/pve/priv/zfs`.
7575

7676
1. Remember to follow the instructions mentioned above for the SSH keys.
7777

perl5/PVE/Storage/ZFSPlugin.pm.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
+ sleep 3;
130130
+ run_command("iscsiadm -m session --rescan");
131131
+ sleep 3;
132-
+ my $line = `multipath -ll | grep \"$wwid_end\"`;
132+
+ my $line = `/usr/sbin/multipath -ll | grep \"$wwid_end\"`;
133133
+ my ($mapper_device) = split(' ', $line);
134134
+ $mapper_device = "" unless $mapper_device;
135135
+ $mapper .= $mapper_device;
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
--- pvemanagerlib.js.orig 2021-03-09 02:22:47.000000000 -0500
2+
+++ pvemanagerlib.js 2021-03-20 11:52:39.694828636 -0400
3+
@@ -7849,6 +7849,7 @@
4+
alias: ['widget.pveiScsiProviderSelector'],
5+
comboItems: [
6+
['comstar', 'Comstar'],
7+
+ ['freenas', 'FreeNAS-API'],
8+
['istgt', 'istgt'],
9+
['iet', 'IET'],
10+
['LIO', 'LIO'],
11+
@@ -46874,6 +46875,7 @@
12+
data: {
13+
isLIO: false,
14+
isComstar: true,
15+
+ isFreeNAS: false,
16+
hasWriteCacheOption: true,
17+
},
18+
},
19+
@@ -46886,10 +46888,26 @@
20+
},
21+
},
22+
changeISCSIProvider: function(f, newVal, oldVal) {
23+
+ var me = this;
24+
var vm = this.getViewModel();
25+
vm.set('isLIO', newVal === 'LIO');
26+
vm.set('isComstar', newVal === 'comstar');
27+
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt');
28+
+ vm.set('isFreeNAS', newVal === 'freenas');
29+
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt');
30+
+ if (newVal !== 'freenas') {
31+
+ me.lookupReference('freenas_use_ssl_field').setValue(false);
32+
+ me.lookupReference('freenas_apiv4_host_field').setValue('');
33+
+ me.lookupReference('freenas_user_field').setValue('');
34+
+ me.lookupReference('freenas_user_field').allowBlank = true;
35+
+ me.lookupReference('freenas_password_field').setValue('');
36+
+ me.lookupReference('freenas_password_field').allowBlank = true;
37+
+ me.lookupReference('freenas_confirmpw_field').setValue('');
38+
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true;
39+
+ } else {
40+
+ me.lookupReference('freenas_user_field').allowBlank = false;
41+
+ me.lookupReference('freenas_password_field').allowBlank = false;
42+
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false;
43+
+ }
44+
},
45+
},
46+
47+
@@ -46907,6 +46925,7 @@
48+
},
49+
50+
setValues: function diff(values) {
51+
+ values.freenas_confirmpw = values.freenas_password;
52+
values.writecache = values.nowritecache ? 0 : 1;
53+
this.callParent([values]);
54+
},
55+
@@ -46923,7 +46942,7 @@
56+
allowBlank: false,
57+
},
58+
{
59+
- xtype: me.isCreate ? 'textfield' : 'displayfield',
60+
+ xtype: 'textfield',
61+
name: 'pool',
62+
value: '',
63+
fieldLabel: gettext('Pool'),
64+
@@ -46933,11 +46952,11 @@
65+
xtype: me.isCreate ? 'textfield' : 'displayfield',
66+
name: 'blocksize',
67+
value: '4k',
68+
- fieldLabel: gettext('Block Size'),
69+
+ fieldLabel: gettext('ZFS Block Size'),
70+
allowBlank: false,
71+
},
72+
{
73+
- xtype: me.isCreate ? 'textfield' : 'displayfield',
74+
+ xtype: 'textfield',
75+
name: 'target',
76+
value: '',
77+
fieldLabel: gettext('Target'),
78+
@@ -46948,9 +46967,34 @@
79+
name: 'comstar_tg',
80+
value: '',
81+
fieldLabel: gettext('Target group'),
82+
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
83+
+ bind: {
84+
+ hidden: '{!isComstar}'
85+
+ },
86+
allowBlank: true,
87+
},
88+
+ {
89+
+ xtype: 'proxmoxcheckbox',
90+
+ name: 'freenas_use_ssl',
91+
+ reference: 'freenas_use_ssl_field',
92+
+ inputId: 'freenas_use_ssl_field',
93+
+ checked: false,
94+
+ bind: {
95+
+ hidden: '{!isFreeNAS}'
96+
+ },
97+
+ uncheckedValue: 0,
98+
+ fieldLabel: gettext('API use SSL'),
99+
+ },
100+
+ {
101+
+ xtype: 'textfield',
102+
+ name: 'freenas_user',
103+
+ reference: 'freenas_user_field',
104+
+ inputId: 'freenas_user_field',
105+
+ value: '',
106+
+ fieldLabel: gettext('API Username'),
107+
+ bind: {
108+
+ hidden: '{!isFreeNAS}'
109+
+ },
110+
+ },
111+
];
112+
113+
me.column2 = [
114+
@@ -46980,7 +47024,9 @@
115+
xtype: me.isCreate ? 'textfield' : 'displayfield',
116+
name: 'comstar_hg',
117+
value: '',
118+
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' },
119+
+ bind: {
120+
+ hidden: '{!isComstar}'
121+
+ },
122+
fieldLabel: gettext('Host group'),
123+
allowBlank: true,
124+
},
125+
@@ -46988,9 +47034,62 @@
126+
xtype: me.isCreate ? 'textfield' : 'displayfield',
127+
name: 'lio_tpg',
128+
value: '',
129+
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
130+
- allowBlank: false,
131+
+ bind: {
132+
+ hidden: '{!isLIO}'
133+
+ },
134+
fieldLabel: gettext('Target portal group'),
135+
+ allowBlank: true
136+
+ },
137+
+ {
138+
+ xtype: 'proxmoxtextfield',
139+
+ name: 'freenas_apiv4_host',
140+
+ reference: 'freenas_apiv4_host_field',
141+
+ value: '',
142+
+ editable: true,
143+
+ emptyText: Proxmox.Utils.noneText,
144+
+ bind: {
145+
+ hidden: '{!isFreeNAS}'
146+
+ },
147+
+ fieldLabel: gettext('API IPv4 Host'),
148+
+ },
149+
+ {
150+
+ xtype: 'proxmoxtextfield',
151+
+ name: 'freenas_password',
152+
+ reference: 'freenas_password_field',
153+
+ inputType: me.isCreate ? '' : 'password',
154+
+ value: '',
155+
+ editable: true,
156+
+ emptyText: Proxmox.Utils.noneText,
157+
+ bind: {
158+
+ hidden: '{!isFreeNAS}'
159+
+ },
160+
+ fieldLabel: gettext('API Password'),
161+
+ change: function(f, value) {
162+
+ if (f.rendered) {
163+
+ f.up().down('field[name=freenas_confirmpw]').validate();
164+
+ }
165+
+ },
166+
+ },
167+
+ {
168+
+ xtype: 'proxmoxtextfield',
169+
+ name: 'freenas_confirmpw',
170+
+ reference: 'freenas_confirmpw_field',
171+
+ inputType: me.isCreate ? '' : 'password',
172+
+ value: '',
173+
+ editable: true,
174+
+ submitValue: false,
175+
+ emptyText: Proxmox.Utils.noneText,
176+
+ bind: {
177+
+ hidden: '{!isFreeNAS}'
178+
+ },
179+
+ fieldLabel: gettext('Confirm Password'),
180+
+ validator: function(value) {
181+
+ var pw = this.up().down('field[name=freenas_password]').getValue();
182+
+ if (pw !== value) {
183+
+ return "Passwords do not match!";
184+
+ }
185+
+ return true;
186+
+ },
187+
},
188+
];
189+

0 commit comments

Comments
 (0)