Commit Graph

70 Commits

Author SHA1 Message Date
Kevin Scott Adams 3e128e673c Allow multiple instances of the [Free|True}NAS REST::Client construct.
- When optimizing the code to remove the redundant calls to create a
'new' REST::Client this had a single variable to hold the instance. If
you were moving between two different servers then the variables would
not match the destination parameters of the [Free|True]NAS server.
Implemented a hashref of the construct of REST:Client with the hashref
being the IP address of the portal or API IP. Fixes #61.
- Remove some white spacing and superfluous code.
- Added some comments so I know what I was changing.
2020-07-14 17:54:37 -04:00
Kevin Scott Adams c3935785c0 Update comments/doc of the methods changes
- Just a change to two doc of 'GET' and 'DELETE' method subs.
2020-07-14 17:32:53 -04:00
Kevin Scott Adams ac1c31f2d0 Added 302 and 307 code handlers on initial API connection and various
other changes.

- Add logic to freenas_api_connect to handle a '302 Found' which seems
to mean it does not handle v1.0 API's. Fixes #60.
- Add logic to freenas_api_connect to handle a '307 Temporary Redirect'
which is when the redirect http to https box is checked. Fixes #59.
- Redesign the RegEx that validates and pulls the version information
from the API system/version call. This is due to a format like
TrueNAS-12.0-BETA instead of [FreeNAS|TrueNAS]-12.0-U1.1. Also make sure
empty RegEx return variables are zero (0) so the version number that is
formulated is correct (e.g. 12000000, 11030302). Fixes #60.
- During testing needed to add a check due to the
api/v2.0/system/version returning a quoted string where
api/v1.0/system/version returned a JSON-format data.
- Tested against baremetal FreeNAS 11.3-U3.2 and virtual TrueNAS
12.0-BETA machines.
2020-07-07 11:14:30 -04:00
Kevin Scott Adams aa11d596bd Code efficiency improvements.
- Cleaned up the API calling routine so it will only create one instance
of the REST::Client module. Typically was 10 to 30+ instances per VM
disk CRUD.
- Due to this some variables needed to be “global” to the plugin.
- Removed some superfluous hashes and variables.
- Repetitive code reduced to only on call.
- Created one “Frankenstein” hash that retains all API methods,
variables and json body structures for each API version used by the
plugin.
- One call to the global configuration in the version check to reduce
execution time.
- Cleanup some code and formatting.
- Added some comments.
2020-06-11 12:49:28 -04:00
Kevin Scott Adams 977b00a178 FreeNAS API v2.0 features
- Allows the use of FreeNAS API v2.0 so we can finally remove a VM drive
from the Proxmox VE GUI.
- Created a Frankenstein of out of FreeNAS.pm to allow 'one module to
rule them all' for v1.0 and v2.0 API's to FreeNAS.
- librest-client-perl changes so the call can have a <body/> to it on
GET and DELETE methods.
- Some spelling mistakes.
- Better syslog entries.
- More debbugging for testing purposes to the syslog.
2020-06-09 12:31:31 -04:00
Kevin Scott Adams 006dacc479 Add librest-client-perl to the package.
- librest-client-perl needs to be updated so it can have data in the
body of the call for GET and DELETE's.
2020-06-09 09:59:39 -04:00
Kevin Scott Adams 9f9b6ed171 Formatting and spelling errors
- Change some formatting and placement of lines.
- Fixed a few typos
2020-06-02 08:31:44 -04:00
Kevin Scott Adams 17e3625094 Merge remote-tracking branch 'origin/master' 2020-06-01 16:28:42 -04:00
Kevin Scott Adams 2a9e478704 Update the README.md for new features.
- Instruct the use of the package system to auto update the needed files
on the Prommox system
- Archive original README.md in the WIKI.
2020-06-01 16:24:55 -04:00
Kevin Scott Adams d46334e46a Set theme jekyll-theme-merlot 2020-05-26 12:22:36 -04:00
Kevin Scott Adams 233c85a141 Set theme jekyll-theme-merlot 2020-05-26 12:20:53 -04:00
Kevin Scott Adams 0cc39a4958 Add addtional file to new structure
- Forgot the FreeNAS.pm file in stable-6
2019-10-22 21:19:52 -04:00
Kevin Scott Adams 826e1e7ad2 Merge branch 'master' of
https://github.com/TheGrandWazoo/freenas-proxmox.git

Conflicts:
	perl5/PVE/Storage/ZFSPlugin.pm.patch
	stable-6/perl5/PVE/Storage/ZFSPlugin.pm.patch
2019-10-22 21:18:35 -04:00
Kevin Scott Adams 0e14d207ad Update patch sets
- Update ZFSPlugin.pm patch for Proxmox libpve-storage-perl version
6.0-9
2019-10-13 13:03:43 -04:00
Kevin Scott Adams c25fa0fe58 Update patch sets
- Update pvemanagerlib.js patch for Proxmox version to 6.0-7
- Update ZFSPlugin.pm patch for Proxmox version 6.0-8
- Adjusted new directory structure and added some missing files.
2019-10-13 09:26:52 -04:00
Kevin Scott Adams 5d40ce4de6 New Directory structure
- Just preping for a new install process.
2019-09-24 07:55:10 -04:00
Kevin Scott Adams 4b46f2240f Updated patches for the latest Proxmox VE updates and added donation
button.

- Update README.md to include a requested donation button for the
project. Thank you.
- Updated patch for pvemanagerlib.js for Proxmox VE pve-manager: 6.0-5
- Updated patch for apidoc.js for Proxmox VE pve-docs: 6.0-4
- Updated patch for ZFSPlugin.pm for Proxmox VE libpve-storage-perl:
6.0-6
2019-08-07 22:57:22 -04:00
Kevin Scott Adams 5091f0ae12 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
2019-08-05 18:02:01 -04:00
Kevin Scott Adams 16b3bd1a0b Update the FreeNAS-API related files to the latest Proxmox VE
- Updated apidoc.js.patch to reflect pve-docs: 5.4-2
- New apidoc-5.4-2_1.js.patch
- Updated pvemanagerlib.js.patch to reflect pve-manager: 5.4-5
- New pvemanagerlib-5.4-5_1.js.patch
- Updated ZFSPlugin.pm.patch to reflect libpve-storage-perl: 5.0-42
- New ZFSPlugin-5.0-42.pm.patch
- Revised the README.md
2019-05-11 11:13:54 -04:00
KevinAdams 94db23550b Merge branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git 2019-03-01 13:36:21 -05:00
Kevin Scott Adams ea73c4f7c9 Update to latest Proxmox VE update
- Update ZFSPlugin.pm to reflect 'libpve-storage-perl: 5.0-38'
- Update pvemanager.js to reflect 'pve-manager: 5.3-11'
- Update pve-docs.js to reflect 'pve-docs: 5.3-3'
2019-02-26 21:28:15 -05:00
Kevin Scott Adams 54d27aa58a Merge branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git 2019-02-05 07:40:16 -05:00
Kevin Scott Adams 920fbed342 Fixed issue on non-FreeNAS providers that would give a 'property' error.
- Issue was found that when saving a non-FreeNAS provider config that a
'delete: property error' was generated via the javascript. This issue
came from using the 'deleteEmpty' property used in the password fields
of the FreeNAS.pm provider pluging. Fixes issue #36, I hope.
2019-02-05 07:39:03 -05:00
KevinAdams aee275ed4a Remove ZFSPoolPlugin.pm from repo.
- Mistakenly added the ZFSPoolPlugin.pm to the repo. Closes issue #37
2019-02-04 10:51:07 -05:00
KevinAdams 2f22e60626 Remove ZFSPoolPlugin.pm from repo.
- Mistakenly added the ZFSPoolPlugin.pm to the repo.
2019-02-04 10:48:05 -05:00
KevinAdams a1cdede403 Fix non-FreeNAS providers to enable the 'Add' button.
- When using the 'allowBlank' property of extjs, it provided the
functionality to the FreeNAS provider but disabled the 'Add' button of
other providers when all necessary data was entered. This was because
three fields in the FreeNAS provider was 'allowBlank' equal to 'false'
causing the ‘Add’ button to not be ‘enabled’. Upon further development
the 'allowBlank' property is not 'bindable' and was causing issues with
the modal window. No other similar code was found in the
pvemanagerlib.js to replicate this and it was mentioned in a post that
the ‘allowBlank’ property to be bindable was a feature request to come.
This fix allows for all functionality of the providers to work correctly
in the modal window. This fixes issue #36.
2019-02-01 14:34:40 -05:00
KevinAdams 8e2f6673b0 Small grammer changes 2019-01-18 13:31:39 -05:00
KevinAdams 4c6856828e Added some additional notes and conditions. 2019-01-18 13:28:40 -05:00
Kevin Scott Adams d0efcd49c5 Update Proxmox VE patches to 5.3-6
- Updated ZFSPlugin.pm.patch for libpve-storage-perl: 5.3-34
- Updated pvemanagerlib.js.patch for pve-manager: 5.3-6
- Patch file versions will now have a '_<#>' (e.g. 5.3-34_1) appended to
it denoting the patch version for that Proxmox VE lib/file version.
2018-12-24 07:36:33 -05:00
KevinAdams 5e255a6208 Fixed block size issue and updated for Proxmox VE 5.3-5
- Removed code in FreeNAS.PM that used the blocksize field from the GUI
for the use of iSCSI block size causing migration and large extent
sizes. Fixes issues #9 and #33.
- Prefixed 'ZFS' to the 'Block Size' label on the GUI.
- Updated for 5.3-5
2018-12-22 13:18:51 -05:00
Kevin Scott Adams 5e5f649fe1 Fix ZFS error: Unrecognized command "list_extent"
- A regression error that added the 'list_extent" method to the
$lun_cmds array in ZFSPlugin.pm. Fixes issue #32.
2018-12-15 09:50:44 -05:00
Kevin Scott Adams 82fe27242f Update patch set to the latest version of Proxmox-VE: 5.3-1
- Updated patch file for pvemanagerlib.js to pve-manager: 5.3-5
- Updated patch file for apidoc.js to pve-docs: 5.3-1
- Updated patch file for ZFSPlugin.pm to libpve-storage-perl: 5.0-33
2018-12-13 07:37:03 -05:00
Kevin Scott Adams f1542e712e Updated apidoc.js.patch for pve-docs version 5.2-9.
- Only change to the patch was to place it in alphabetical order like
the rest of the doc.
- Added version specific files.
- Closes issue #28.
2018-11-11 09:46:45 -05:00
Kevin Scott Adams 64afc5a70a Fix 'Parameter verification failed' when editing
- When changing the 'target' and 'pool' field to be editable in the Edit
ZFS over iSCSI panel it created an issue when you went to save any
change to that panel. The parameters were defined as { fixed => 1 }. Now
I don't know the backend of this but I changed it to { optional => 1} or
to { fixed => 0} they both worked. So I went with the { fixed => 0 } on
the 'target' and 'pool'. This fixes issue #27.
- Added a file with the version of the 'libpve-storage-perl' (e.g. -
ZFSPlugin-5.0-30.pm.patch to follow each version has it is changed.
2018-10-28 21:37:06 -04:00
Kevin Scott Adams c487158579 Added editable field in the ZFS over iSCSI panel
- Made the fields Pool, Target, API Username, API Password editable.
- Added a Confirm Password field and logic to compare
- Hide the password in the 'Edit' panel.
- This is for issue/enhancement #26
- Kept each patch for the version of pvemanagerlib.js and if there are
bugs from the first patch release then added an '_<int>' to the version
of the patch. The pvemanagerlib.js will always follow the highest
version.
2018-10-23 15:42:23 -04:00
Kevin Scott Adams 7dfa7f367d No FreeNAS option in dropdown box.
- Did not added an entry into the pulldown array for Freenas. Closes
issue #25.
2018-10-21 01:13:20 -04:00
Kevin Scott Adams 9a14130375 Updated files to latest Proxmox repo as of 2018-10-16.
- Updated pvemanagerlib.js.patch to reflect pve-manager version 5.2-9
- Updated ZFSPlugin.pm.patch to reflect libpve-storage-perl version
5.0-30
- Fixed issue with multipathing when NOT multipathing on the run_command
function.
- Fixed whitespace in README.md
2018-10-16 08:19:01 -04:00
Kevin Scott Adams 0e58a78e4a Add functionality for iSCSI multipathing
- Added patch from @tl8roy to add multipathing to the ZFSPluging.pm for
FreeNAS. I believe this was only patched and tested for FreeNAS.  I
tested WITHOUT using multipathing and I have had no issues. Closes
enhancement request #15 and reference #11.
2018-08-19 16:35:28 -04:00
Kevin Scott Adams 94d897f7d1 Added API Host
- This change allows the API traffic to be on a different interface then
the iSCSI Provider interface. This allows the selection of the FreeNAS
WebGUI address for HTTP/HTTPS to be on a specific interface instead of
"ALL" (0.0.0.0) interfaces.  If the API Host is not defined then the API
traffic will default to the iSCSI Provider interface.
2018-08-19 15:28:39 -04:00
Kevin Scott Adams 3f6059e75f Add test for the FreeNAS API
- Add a simple API test using the FreeNAS API call to get its version
number, which could prove useful in future versions. Closes #17
- Whitespace cleanup
2018-07-31 22:40:22 -04:00
Kevin Scott Adams 42edb8614e Few housekeeping changes
- Whitespace cleanup
- Removed the 'hardcoded' username and password. Will not throw an error
if it is not defined or blank in /etc/pve/storage.cfg for each ZFS via
ISCSI definition.
- Used a Ternary (Elvis - ?:) Operator for the scheme variable.
2018-07-31 21:33:21 -04:00
Kevin Scott Adams 32d243b872 Transfer the patch do not cut and paste
- My bad

Change-Id: Ic0db22e16feb3e42c4af70426e2afe5775d46400
Signed-off-by: Kevin Scott Adams <kevin.adams@ksatechnologies.com>
2018-07-30 23:24:55 -04:00
Kevin Scott Adams a6906fe4d6 Merge branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git 2018-07-30 22:49:12 -04:00
Kevin Scott Adams 458549ae2a - Updates and enhancements to pve-manager and pve-docs
Updates for pve-manager 5.2-6 and pve-docs 5.2-5. Fixes issue #13.
Added some functionality to the js code to be selective on the FreeNAS
fields only when FreeNAS-API is chosen. Fixes issue #14.
2018-07-30 22:48:37 -04:00
Kevin Scott Adams ad0864bd2d
Merge pull request #11 from 1300webpro/multipath
Adds a function to return NAA
2018-07-16 17:13:57 -04:00
Tristan Lostroh cce719afb7 Add a function to return NAA
Adds a function to return NAA. This is required to match the WWID for multipath
2018-07-16 09:16:10 +10:00
Kevin Scott Adams cde040aeca
Merge pull request #8 from GNU-tech/master
Support for SSL access to FreeNAS API
2018-07-11 21:09:22 -04:00
Krzysztof Raczkowski bc463f1229 Updated README. 2018-07-11 12:43:08 +02:00
Krzysztof Raczkowski d3c477c40d Support for SSL access to FreeNAS API. 2018-07-11 12:41:19 +02:00
Krzysztof Raczkowski 5f339dfce5 Refreshing pvemanagerlib.js.patch to apply clean on PVE 5.2-5. 2018-07-11 12:15:57 +02:00