Merge pull request #1 from eugene-chow/master

Merge Eugene's changes to my repo
This commit is contained in:
Kevin Scott Adams 2018-06-07 15:24:49 -04:00 committed by GitHub
commit 09c33308ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 94 additions and 96 deletions

27
README
View File

@ -1,27 +0,0 @@
FreeNAS ZFS over iSCSI interface
Please be aware that this enhancment uses the FreeNAS API's and NOT the ssh/scp
like the other interface provide.
1) First use the following commands to patch the needed files forthe FreeNAS Interface
patch /usr/share/pve-manager/js/pvemanagerlib.js < pve-manager/js/pvemanagerlib.js.patch
patch /usr/share/perl5/PVE/Storage/ZFSPlugin.pm < perl5/PVE/Storage/ZFSPlugin.pm.patch
patch /usr/share/pve-docs/api-viewer/apidoc.js < pve-docs/api-viewer/apidoc.js.patch
2) Use the following commands to copy the needed files for the FreeNAS
mkdir -p /usr/share/perl5/REST
cp perl5/REST/Client.pm /usr/share/perl5/REST/Client.pm
cp perl5/PVE/Storage/LunCmd/FreeNAS.pm /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm
3) Edit /usr/bin/pvedaemon and remove the '-T' from the perl command line.
vi /usr/bin/pvedaemon
Not really sure about 'why' this is do I need to do some research on this PERL
directive option.
4) Execute the following at a console command prompt to active the above
systemctl restart pvedaemon
5) Either goto the URL for the Proxmox GUI in your favorite browser
or
If you are already logged in via the GUI just refresh your browser to receive
the new Javascript code.

29
README.md Normal file
View File

@ -0,0 +1,29 @@
# FreeNAS ZFS over iSCSI interface
Please be aware that this enhancment uses the FreeNAS APIs and NOT the ssh/scp like the other interface provides.
1. First use the following commands to patch the needed files forthe FreeNAS Interface
```bash
patch -b /usr/share/pve-manager/js/pvemanagerlib.js < pve-manager/js/pvemanagerlib.js.patch
patch -b /usr/share/perl5/PVE/Storage/ZFSPlugin.pm < perl5/PVE/Storage/ZFSPlugin.pm.patch
patch -b /usr/share/pve-docs/api-viewer/apidoc.js < pve-docs/api-viewer/apidoc.js.patch
```
1. Use the following commands to copy the needed files for the FreeNAS
```bash
mkdir -p /usr/share/perl5/REST
cp perl5/REST/Client.pm /usr/share/perl5/REST/Client.pm
cp perl5/PVE/Storage/LunCmd/FreeNAS.pm /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm
```
1. Remove the `-T` taint directive from `/usr/bin/pvedaemon`. Not sure why this is needed. I need to do some research on this PERL directive option.
```bash
sed -E -i.orig 's|^(#!/usr/bin/perl) -T|\1|' /usr/bin/pvedaemon
```
1. Execute the following at a console command prompt to active the above
```bash
systemctl restart pvedaemon
```
1. Refresh the Proxmox GUI in your browser to load the new Javascript code.

View File

@ -1,24 +1,24 @@
--- ZFSPlugin.pm.orig 2018-04-17 09:52:36.917394028 -0400
+++ ZFSPlugin.pm 2018-04-18 14:20:52.711457607 -0400
--- /usr/share/perl5/PVE/Storage/ZFSPlugin.pm.orig 2018-06-04 11:59:59.851426278 +0800
+++ /usr/share/perl5/PVE/Storage/ZFSPlugin.pm 2018-06-04 12:04:56.781049166 +0800
@@ -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;
@@ -31,7 +32,7 @@
my $zfs_unknown_scsi_provider = sub {
my ($provider) = @_;
- die "$provider: unknown iscsi provider. Available [comstar, istgt, iet]";
+ die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet]";
};
my $zfs_get_base = sub {
@@ -39,6 +40,8 @@
if ($scfg->{iscsiprovider} eq 'comstar') {
return PVE::Storage::LunCmd::Comstar::get_base;
+ } elsif ($scfg->{iscsiprovider} eq 'freenas') {
@ -35,27 +35,27 @@
} elsif ($scfg->{iscsiprovider} eq 'istgt') {
$msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params);
} elsif ($scfg->{iscsiprovider} eq 'iet') {
@@ -188,6 +193,14 @@
description => "host group for comstar views",
type => 'string',
},
+ freenas_user => {
+ description => "FreeNAS API Username",
+ type => 'string',
+ },
+ freenas_password => {
+ description => "FreeNAS API Password",
+ type => 'string',
+ },
};
}
@@ -173,6 +178,14 @@
description => "iscsi provider",
type => 'string',
},
+ freenas_user => {
+ description => "FreeNAS API Username",
+ type => 'string',
+ },
+ freenas_password => {
+ description => "FreeNAS API Password",
+ 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
@@ -204,6 +217,8 @@
sparse => { optional => 1 },
comstar_hg => { optional => 1 },
comstar_tg => { optional => 1 },
+ freenas_user => { optional => 1 },
+ freenas_password => { optional => 1 },
content => { optional => 1 },
bwlimit => { optional => 1 },
sparse => { optional => 1 },
comstar_hg => { optional => 1 },
comstar_tg => { optional => 1 },
+ freenas_user => { optional => 1 },
+ freenas_password => { optional => 1 },
content => { optional => 1 },
bwlimit => { optional => 1 },
};

View File

@ -1,5 +1,5 @@
--- /usr/share/pve-docs/api-viewer/apidoc.js.orig 2018-05-24 10:18:20.694525300 -0400
+++ /usr/share/pve-docs/api-viewer/apidoc.js 2018-05-24 10:11:22.329925779 -0400
--- /usr/share/pve-docs/api-viewer/apidoc.js.orig 2018-06-04 12:08:17.416780601 +0800
+++ /usr/share/pve-docs/api-viewer/apidoc.js 2018-06-04 12:07:28.073832212 +0800
@@ -27549,6 +27549,18 @@
"type" : "string",
"typetext" : "<string>"

View File

@ -1,42 +1,38 @@
--- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2018-05-23 16:53:17.014250092 -0400
+++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-05-23 16:58:22.848825697 -0400
--- /usr/share/pve-manager/js/pvemanagerlib.js.orig 2018-06-04 11:21:26.419121310 +0800
+++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-06-04 11:52:58.628592707 +0800
@@ -5303,6 +5303,7 @@
alias: ['widget.pveiScsiProviderSelector'],
comboItems: [
['comstar', 'Comstar'],
+ ['freenas', 'FreeNAS-API'],
[ 'istgt', 'istgt'],
[ 'iet', 'IET']
['comstar', 'Comstar'],
+ ['freenas', 'FreeNAS-API'],
[ 'istgt', 'istgt'],
[ 'iet', 'IET']
]
@@ -27145,7 +27146,14 @@
value: '',
fieldLabel: gettext('Target group'),
allowBlank: true
- }
+ },
+ {
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
+ name: 'freenas_user',
+ value: '',
+ fieldLabel: gettext('FreeNAS User'),
+ allowBlank: true
+ }
];
me.column2 = [
@@ -27176,7 +27184,14 @@
value: '',
fieldLabel: gettext('Host group'),
allowBlank: true
- }
+ },
+ {
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
+ name: 'freenas_password',
+ value: '',
+ fieldLabel: gettext('FreeNAS Password'),
+ allowBlank: true
+ }
];
me.callParent();
@@ -27145,6 +27146,13 @@
value: '',
fieldLabel: gettext('Target group'),
allowBlank: true
+ },
+ {
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
+ name: 'freenas_user',
+ value: '',
+ fieldLabel: gettext('FreeNAS User'),
+ allowBlank: true
}
];
@@ -27176,6 +27184,13 @@
value: '',
fieldLabel: gettext('Host group'),
allowBlank: true
+ },
+ {
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
+ name: 'freenas_password',
+ value: '',
+ fieldLabel: gettext('FreeNAS Password'),
+ allowBlank: true
}
];