Merge pull request #1 from eugene-chow/master
Merge Eugene's changes to my repo
This commit is contained in:
		
						commit
						09c33308ff
					
				
							
								
								
									
										27
									
								
								README
								
								
								
								
							
							
						
						
									
										27
									
								
								README
								
								
								
								
							|  | @ -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.  |  | ||||||
|  | @ -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.  | ||||||
|  | @ -1,24 +1,24 @@ | ||||||
| --- ZFSPlugin.pm.orig   2018-04-17 09:52:36.917394028 -0400
 | --- /usr/share/perl5/PVE/Storage/ZFSPlugin.pm.orig	2018-06-04 11:59:59.851426278 +0800
 | ||||||
| +++ ZFSPlugin.pm        2018-04-18 14:20:52.711457607 -0400
 | +++ /usr/share/perl5/PVE/Storage/ZFSPlugin.pm	2018-06-04 12:04:56.781049166 +0800
 | ||||||
| @@ -10,6 +10,7 @@
 | @@ -10,6 +10,7 @@
 | ||||||
| 
 |   | ||||||
|  use base qw(PVE::Storage::ZFSPoolPlugin); |  use base qw(PVE::Storage::ZFSPoolPlugin); | ||||||
|  use PVE::Storage::LunCmd::Comstar; |  use PVE::Storage::LunCmd::Comstar; | ||||||
| +use PVE::Storage::LunCmd::FreeNAS;
 | +use PVE::Storage::LunCmd::FreeNAS;
 | ||||||
|  use PVE::Storage::LunCmd::Istgt; |  use PVE::Storage::LunCmd::Istgt; | ||||||
|  use PVE::Storage::LunCmd::Iet; |  use PVE::Storage::LunCmd::Iet; | ||||||
| 
 |   | ||||||
| @@ -31,7 +32,7 @@
 | @@ -31,7 +32,7 @@
 | ||||||
|  my $zfs_unknown_scsi_provider = sub { |  my $zfs_unknown_scsi_provider = sub { | ||||||
|      my ($provider) = @_; |      my ($provider) = @_; | ||||||
| 
 |   | ||||||
| -    die "$provider: unknown iscsi provider. Available [comstar, istgt, iet]";
 | -    die "$provider: unknown iscsi provider. Available [comstar, istgt, iet]";
 | ||||||
| +    die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet]";
 | +    die "$provider: unknown iscsi provider. Available [comstar, freenas, istgt, iet]";
 | ||||||
|  }; |  }; | ||||||
| 
 |   | ||||||
|  my $zfs_get_base = sub { |  my $zfs_get_base = sub { | ||||||
| @@ -39,6 +40,8 @@
 | @@ -39,6 +40,8 @@
 | ||||||
| 
 |   | ||||||
|      if ($scfg->{iscsiprovider} eq 'comstar') { |      if ($scfg->{iscsiprovider} eq 'comstar') { | ||||||
|          return PVE::Storage::LunCmd::Comstar::get_base; |          return PVE::Storage::LunCmd::Comstar::get_base; | ||||||
| +    } elsif ($scfg->{iscsiprovider} eq 'freenas') {
 | +    } elsif ($scfg->{iscsiprovider} eq 'freenas') {
 | ||||||
|  | @ -35,27 +35,27 @@ | ||||||
|          } elsif ($scfg->{iscsiprovider} eq 'istgt') { |          } elsif ($scfg->{iscsiprovider} eq 'istgt') { | ||||||
|              $msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params); |              $msg = PVE::Storage::LunCmd::Istgt::run_lun_command($scfg, $timeout, $method, @params); | ||||||
|          } elsif ($scfg->{iscsiprovider} eq 'iet') { |          } elsif ($scfg->{iscsiprovider} eq 'iet') { | ||||||
| @@ -188,6 +193,14 @@
 | @@ -173,6 +178,14 @@
 | ||||||
|             description => "host group for comstar views", |  	    description => "iscsi provider", | ||||||
|             type => 'string', |  	    type => 'string', | ||||||
|         }, |  	}, | ||||||
| +        freenas_user => {
 | +	freenas_user => {
 | ||||||
| +            description => "FreeNAS API Username",
 | +	    description => "FreeNAS API Username",
 | ||||||
| +            type => 'string',
 | +	    type => 'string',
 | ||||||
| +        },
 | +	},
 | ||||||
| +        freenas_password => {
 | +	freenas_password => {
 | ||||||
| +            description => "FreeNAS API Password",
 | +	    description => "FreeNAS API Password",
 | ||||||
| +            type => 'string',
 | +	    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 @@
 | @@ -204,6 +217,8 @@
 | ||||||
|         sparse => { optional => 1 }, |  	sparse => { optional => 1 }, | ||||||
|         comstar_hg => { optional => 1 }, |  	comstar_hg => { optional => 1 }, | ||||||
|         comstar_tg => { optional => 1 }, |  	comstar_tg => { optional => 1 }, | ||||||
| +        freenas_user => { optional => 1 },
 | +	freenas_user => { optional => 1 },
 | ||||||
| +        freenas_password => { optional => 1 },
 | +	freenas_password => { optional => 1 },
 | ||||||
|         content => { optional => 1 }, |  	content => { optional => 1 }, | ||||||
|         bwlimit => { optional => 1 }, |  	bwlimit => { optional => 1 }, | ||||||
|      }; |      }; | ||||||
|  |  | ||||||
|  | @ -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.orig	2018-06-04 12:08:17.416780601 +0800
 | ||||||
| +++ /usr/share/pve-docs/api-viewer/apidoc.js    2018-05-24 10:11:22.329925779 -0400
 | +++ /usr/share/pve-docs/api-viewer/apidoc.js	2018-06-04 12:07:28.073832212 +0800
 | ||||||
| @@ -27549,6 +27549,18 @@
 | @@ -27549,6 +27549,18 @@
 | ||||||
|                             "type" : "string", |                             "type" : "string", | ||||||
|                             "typetext" : "<string>" |                             "typetext" : "<string>" | ||||||
|  |  | ||||||
|  | @ -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.orig	2018-06-04 11:21:26.419121310 +0800
 | ||||||
| +++ /usr/share/pve-manager/js/pvemanagerlib.js  2018-05-23 16:58:22.848825697 -0400
 | +++ /usr/share/pve-manager/js/pvemanagerlib.js	2018-06-04 11:52:58.628592707 +0800
 | ||||||
| @@ -5303,6 +5303,7 @@
 | @@ -5303,6 +5303,7 @@
 | ||||||
|      alias: ['widget.pveiScsiProviderSelector'], |      alias: ['widget.pveiScsiProviderSelector'], | ||||||
|      comboItems: [ |      comboItems: [ | ||||||
|         ['comstar', 'Comstar'], |  	['comstar', 'Comstar'], | ||||||
| +       ['freenas', 'FreeNAS-API'],
 | +	['freenas', 'FreeNAS-API'],
 | ||||||
|         [ 'istgt', 'istgt'], |  	[ 'istgt', 'istgt'], | ||||||
|         [ 'iet', 'IET'] |  	[ 'iet', 'IET'] | ||||||
|      ] |      ] | ||||||
| @@ -27145,7 +27146,14 @@
 | @@ -27145,6 +27146,13 @@
 | ||||||
|                 value: '', |  		value: '', | ||||||
|                 fieldLabel: gettext('Target group'), |  		fieldLabel: gettext('Target group'), | ||||||
|                 allowBlank: true |  		allowBlank: true | ||||||
| -           }
 | +	    },
 | ||||||
| +           },
 | +	    {
 | ||||||
| +            {
 | +		xtype: me.isCreate ? 'textfield' : 'displayfield',
 | ||||||
| +                xtype: me.isCreate ? 'textfield' : 'displayfield',
 | +		name: 'freenas_user',
 | ||||||
| +                name: 'freenas_user',
 | +		value: '',
 | ||||||
| +                value: '',
 | +		fieldLabel: gettext('FreeNAS User'),
 | ||||||
| +                fieldLabel: gettext('FreeNAS User'),
 | +		allowBlank: true
 | ||||||
| +                allowBlank: true
 |  	    } | ||||||
| +            }
 |  	]; | ||||||
|         ]; |   | ||||||
| 
 | @@ -27176,6 +27184,13 @@
 | ||||||
|         me.column2 = [ |  		value: '', | ||||||
| @@ -27176,7 +27184,14 @@
 |  		fieldLabel: gettext('Host group'), | ||||||
|                 value: '', |  		allowBlank: true | ||||||
|                 fieldLabel: gettext('Host group'), | +	    },
 | ||||||
|                 allowBlank: true | +	    {
 | ||||||
| -           }
 | +		xtype: me.isCreate ? 'textfield' : 'displayfield',
 | ||||||
| +           },
 | +		name: 'freenas_password',
 | ||||||
| +            {
 | +		value: '',
 | ||||||
| +                xtype: me.isCreate ? 'textfield' : 'displayfield',
 | +		fieldLabel: gettext('FreeNAS Password'),
 | ||||||
| +                name: 'freenas_password',
 | +		allowBlank: true
 | ||||||
| +                value: '',
 |  	    } | ||||||
| +                fieldLabel: gettext('FreeNAS Password'),
 |  	]; | ||||||
| +                allowBlank: true
 |   | ||||||
| +            }
 |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         me.callParent(); |  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue