131 Commits

Author SHA1 Message Date
Timur Kumakbayev 6c4411ede9 Merge pull request #95 from brngates98/issue94-add-lxc
feat: advertise rootdir for LXC root volumes (plugindata + docs)
2026-05-04 02:18:16 +05:00
Brian Gates 45bb0e24eb Update README to include LXC support details
Added support for LXC container root volumes in the plugin documentation.
2026-05-03 17:12:36 -04:00
Brian Gates 2c222ef704 Update plugindata to include rootdir in content 2026-05-03 17:11:57 -04:00
Timur Kumakbayev 40eb92df32 Merge pull request #93 from brngates98/issue84
Refactor pod capacity retrieval and space calculations
2026-05-04 01:58:30 +05:00
Brian Gates f7d06166fc Run Perltidy and fix linting issues 2026-05-03 16:48:34 -04:00
Brian Gates ed358b13c5 Fix purestorage pod status totals, usage scope, and space metrics 2026-05-03 16:27:05 -04:00
Brian Gates 397e2f5b64 Refactor pod capacity retrieval and space calculations 2026-05-03 15:28:50 -04:00
Timur Kumakbayev d6b0035d5e Merge pull request #90 from tommymcguiver/api-version-13-updates
API Version 13
2026-02-27 10:59:13 +05:00
Ken Miles e0e4009426 Merge remote-tracking branch 'origin/main' into api-version-13-updates 2026-02-26 09:49:04 +10:00
Timur Kumakbayev c1ff0acf15 Merge pull request #87 from tommymcguiver/syslogging-improvments-2
Improve syslogging implementation and code
2026-02-25 15:13:00 +05:00
Ken Miles 63b2c46104 API Version 13
Modify function signatures, no functionality changes
2026-02-25 13:50:02 +10:00
Ken Miles 0ace4fe87d Improve syslogging implementation and code
Convert direct print statements to use the logger for consistent info message handling.

Also convert warn and die calls to log with the common logger for unified logging.

Removes repetition, enables logging to syslog which allows each message to be timestamped, and can more easily compare
with other systemctl logs like multipathd and iscsid daemons and proxmox services to make it easier to identify race
conditions.
2026-02-24 15:52:59 +10:00
Timur Kumakbayev c666235082 Build script and documentation updates (#83) 2026-01-18 05:05:25 +05:00
dependabot[bot] 1c719ba7f8 Bump tj-actions/changed-files from 44 to 47 in /.github/workflows (#82)
* Bump tj-actions/changed-files from 44 to 47 in /.github/workflows

Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44 to 47.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v44...v47)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: '47'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timansky <timansky@kolesa.team>
v0.0.7
2026-01-18 02:48:06 +05:00
Timur Kumakbayev f9f8eed94b Active Cluster Support, Pod Quota Fixes,Token Cache and CI Improvements (#81)
feat: add Active Cluster support and improve plugin stability

## Major Features

### Active Cluster Support (Experimental) (#42)
- Add support for multiple PureStorage arrays in Active Cluster configuration
- Automatic volume connection on all arrays for high availability
- Configure via comma-separated addresses and tokens

### Pod Quota Limit Support (#69)
- Add proper handling of pod quota_limit parameter
- Use quota_limit when set, fall back to array capacity when unlimited
- Fix capacity reporting for pods with quotas

### Session Token Caching
- Implement session token caching in /etc/pve/priv/purestorage/
- Automatic token refresh at 80% of TTL to prevent expiration
- In-memory and file-based caching with jitter to prevent thundering herd

### Debug Logging
- Add configurable debug logging with 4 levels (0-3)
- Support both config parameter and PURESTORAGE_DEBUG environment variable

## Bug Fixes
- Fix volume deletion when connected to multiple hosts
- Query all connections before destroy
- Disconnect from all hosts on all arrays
- Prevents "Cannot destroy volume because it is currently connected" error

## CI/CD Improvements
- Add workflow_dispatch trigger to checks workflow
- Add option to check all files or only changed files
- Add comprehensive markdown linting with markdownlint-cli2

## Testing
- Add token caching tests (tests/token_cache_test.pl)
- Test token validation, expiration, and race conditions
- Test cleanup of expired cache files

## Refactoring (#72)
- Refactor volume removal logic to handle multiple host connections
- Improve device cleanup sequence (LVM, partitions, multipath)
- Extract connection querying logic before volume destruction
- Refactor CI/CD workflows for better maintainability and flexibility
- Improve error handling and logging throughout the plugin
- Enhance Active Cluster support with proper multi-array operations

## Code Formatting
- Format all Perl files with perltidy using .perltidyrc configuration
- Ensure consistent code style across the codebase
- Fix formatting issues in PureStoragePlugin.pm and test files

## Documentation
- Update README with new functionality
2026-01-17 17:20:28 +05:00
Timur Kumakbayev c693d189df Merge pull request #76 from plieven/fix/bump_apiver
fix: adjust api version to 12, return only max apiver from PVE
2025-10-20 15:18:53 +05:00
Peter Lieven a488acbe59 fix(apiver): return lowest apiver we support in fallback case
Signed-off-by: Peter Lieven <pl@dlhnet.de>
2025-09-22 21:23:32 +02:00
Timur Kumakbayev f9a458efae Merge pull request #65 from PwrBank/patch-2
Update README.md
2025-09-10 08:28:24 +05:00
Timur Kumakbayev 66fa249d91 Merge pull request #71 from PwrBank/patch-3
Update README.md
2025-09-10 08:26:50 +05:00
Peter Lieven b03b80a7b4 fix: adjust api version to 12, return only max apiver from PVE
Signed-off-by: Peter Lieven <pl@dlhnet.de>
2025-08-29 15:20:43 +02:00
PwrBank 14096218b9 Update README.md
Added a features section to the README, so users are able to easily identify the benefits of the plugin.

More features listed would be helpful
2025-06-24 06:22:25 -05:00
Timur Kumakbayev 422063e49a Merge pull request #68 from cbka/main
Update README.md
2025-05-26 21:54:34 +05:00
cbka 71c7074675 Update README.md
add some information about hostconfig and pvesm setup
2025-05-26 10:08:41 +02:00
PwrBank 098ea4dc4f Update README.md
Updated the cd command to reflect the folder create by git
Removed sudo from the commands
2025-03-28 13:12:01 -05:00
Timur Kumakbayev 0aebefe4d3 Merge pull request #62 from plieven/fix/snap_mount
fix: error out if snapname is set in filesystem_path
2025-03-26 12:06:35 +05:00
Peter Lieven e0fcb81e69 fix: error out if snapname is set in filesystem_path
Pure currently does not support direct mounting of snapshots.
As we currently silently ignore the snapname field at least error
out if we receive a non empty snapname. Its unclear if this is
still used as vzdump nowadays does live backups.

Signed-off-by: Peter Lieven <pl@dlhnet.de>
2025-03-19 17:16:34 +01:00
Timur Kumakbayev b4c81dd5a2 Merge pull request #55 from amulet1/cleanup3
Cleanup
v0.0.6
2025-02-17 15:17:37 +05:00
amulet1 08955ca5e1 Use file_read_firstline() in get_device_size() 2025-02-16 13:56:02 -05:00
amulet1 6d70cb8c4b Drop $cache usage as there are no caller using it and the same storeid multiple times
* Stop using $cache in list_images()
 * Stop using $cache in status()
2025-02-15 14:05:22 -05:00
amulet1 aac760b3cb Use /sys/block/*/size to determine device size 2025-02-15 13:30:12 -05:00
Timur Kumakbayev aeb3547d5e Merge pull request #54 from amulet1/scsi_scan
Redesign to use same scanning functions for both fc and iscsi protocols
2025-02-14 12:54:40 +05:00
amulet1 87b579b65a Rescan slaves on volume resize instead of searching for wwn across all SCSI devices
Eliminate scsi_rescan_device()

Add get_device_path_wwn()

Add device_op() to serve as helper for device operations

In scsi_scan_new()
 * Use device_op()

In purestorage_get_device_size()
 * Rename to get_device_size()
 * Drop $class

In remove_block_device()
 * Rename it to block_device_action()
 * Use common code to remove or rescan devices
 * Use device_op() helper to perform a device action

Add block_device_slaves() returning resolved device path and its slaves

In purestorage_get_wwn()
 * Use get_device_path_wwn() to simplify the code

Redesign purestorage_resize_volume()
 * Avoid extra API call by using volume serial returned by volume resize action
 * Use get_device_path_wwn()
 * Remove unneeded protocol checks
 * Support [unlikely] case when resized volume is not mapped/connected
 * Use block_device_slaves() and block_device_action() to simplify the code

Redesign unmap_volume()
 * Use block_device_slaves() and block_device_action() to simplify the code
2025-02-13 19:10:24 -05:00
amulet1 b016137857 General changes to use scsi_*() functions for iSCSI mode
In scsi_scan_new()
 * Pass protocol as parameter
 * Adjust code to scan hosts for specified protocol
 * Count number of scanned hosts, report it in debug mode

In scsi_rescan_new()
 * Search for wwid in /sys/class/scsi_disk
 * Use stricter search pattern
 * Count number of found matches, report it in debug mode

Rename purestorage_unmap_disk() to remove_block_device()

In purestorage_resize_volume()
 * Report that volume was resized after its new size is confirmed
 * Use scsi_rescan_device() for iscsi
 * Change "Info :: New size detected ..." to debug output

In map_volume()
 * Use scsi_scan_new() for iscsi

In unmap_volume()
 * Remove redundant block device check
 * Change info messages to debug output
2025-02-13 11:04:10 -05:00
Timur Kumakbayev c029d3b90a Merge pull request #53 from amulet1/cleanup2
Minor changes and logging improvements
2025-02-12 21:31:42 +05:00
amulet1 f1bf737d39 Minor changes and logging improvements
Include leading "3" into $purestorage_wwn_prefix

In purestorage_get_wwn()
 * modify code to use updated $purestorage_wwn_prefix value
 * add warning if volume is not found

In exec_command()
 * die on error by default, update affected callers
 * allow to invert success/failure with warning suppression (e.g. to support "fuser")
 * update executables to full path inside of the function
 * update affected callers

In wait_for()
 * die on timeout instead of returning 0, update affected callers

In purestorage_unmap_disk()
 * drop $class
 * check that disk is a block device

In unmap_volume()
 * improve error checking and logging
 * add support for "fuser" check (but leave it commented out)

In scsi_rescan_device()
 * remove 'multipath -r' call (there is a 'multipathd resize map' call)
2025-02-12 11:01:41 -05:00
Timur Kumakbayev 14d93fab80 Merge pull request #48 from NojuHD/fc-support
Add support for SCSI (Fibre Channel)
2025-02-10 09:00:52 +05:00
NojuHD 7c77b06585 Merge branch 'main' into fc-support 2025-02-09 06:07:48 +01:00
Timur Kumakbayev 58265255f1 Merge pull request #51 from amulet1/cleanup
Multipathing cleanup and improvements
2025-02-09 01:21:44 +05:00
amulet1 d93f562bdc Multipathing cleanup and improvements
* use multipathd for certain functions
 * suppress output of exec_command() by default if $DEBUG value is less than 3
 * introduce multipath_check() function
 * eliminate purestorage_cleanup_diskmap()

Introduce wait_for() function
 * to be used instead of waiting loops
 * reduce default timeout and sleep delay
 * do not log "Waiting for..." unless it actually waited
 * show total time spent while waiting [not counting actual wait checks]

In purestorage_resize_volume()
 * replace "multipath -r" call (unneeded reload of *all* multipath maps) with "multipathd resize map" call
 * use wait_for() instead of waiting loop

In map_volume()
 * remove unneeded "multipath -a" call
 * use wait_for() instead of waiting loop
 * call "multipathd add map" unless multipath_check() succeeds

In unmap_volume()
 * use multipath_check()
 * remove unneeded "multipath -w" call
 * replace "multipath -f" with "multipathd remove map" call, die on error
2025-02-08 12:01:25 -05:00
Timur Kumakbayev a32f42999f Merge pull request #50 from amulet1/cluster
ActiveCluster support
2025-02-08 14:55:52 +05:00
NojuHD 32ed77d155 Set protocol default via "$default_protocol" 2025-02-08 00:06:34 -05:00
NojuHD 44e53e7e20 Fix typos & change name scheme 2025-02-07 21:41:14 -05:00
NojuHD e6abf236a0 Correct formatting (perltidy) 2025-02-07 12:29:05 -05:00
NojuHD 7bb26c2a7b Remove multipathd (use existing multipath) 2025-02-07 13:57:24 +01:00
Timur Kumakbayev 7b5b78ad55 Merge pull request #45 from NojuHD/main
Update README.md
2025-02-07 08:22:09 +05:00
amulet1 576a4d4181 Initial ActiveCluster support (#42)
* ActiveCluster is enabled by providing comma-separated cluster arrays parameters in "address" and "token"
 * retry non-API errors on a second array
 * connect/disconnect volumes to host on both arrays
 * related code refactoring and improvements
2025-02-06 14:56:51 -05:00
NojuHD 4f3f2d081d Added support for SCSI (Fibre Channel)
- Added subroutines
    - added sub::scsi_scan_new
    - added sub::scsi_rescan_device
- Added protocol selection
2025-02-05 19:40:18 -05:00
NojuHD 3cb2f31699 Update README.md
1. changing git clone to https so no auth is needed.
2. removing doubled "token" in pvesm template.
2025-02-04 18:36:48 +01:00
Timur Kumakbayev e7f429da28 Merge pull request #21 from amulet1/veeam
Support Veeam snapshots
v0.0.5
2025-01-30 09:32:42 +05:00
amulet1 ac971e0425 Added support for Veeam snapshots 2025-01-29 16:28:57 -05:00