Initial commit

This commit is contained in:
timansky
2024-12-04 22:27:16 +05:00
commit c252c0310f
21 changed files with 1545 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
name: Build deb
concurrency:
group: branch-${{ github.ref_name }}
cancel-in-progress: true
on:
workflow_call:
outputs:
deb:
description: "Deb artifact url FQIN"
value: ${{ jobs.config.outputs.fqin_release }}
jobs:
build-deb:
name: Build deb
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
path: src
- name: Install depedencies
working-directory: ./src
run: |
sudo apt-get build-dep .
- name: Generate changelog
working-directory: ./src
run: |
pkgname=libpve-storage-purestorage-perl
tag_list=$(git tag -l | grep -ve '-rc\.[0-9]$' | grep -ve '-beta\.[0-9]$' | sort -V)
for tag in ${tag_list}; do
tag_header="$tag^..$tag"
tag_info=$prevtag..$tag
tag_version=$(echo $tag | cut -c2-)-1
if [[ "$prevrag" == "" ]]; then
tag_header="$tag"
tag_info="$tag"
elif [[ "$tag" == "$prevtag" ]]; then
continue
fi
echo >> changelog
git log --pretty='format: -- %aN <%aE> %aD%n%n' $tag_header >> changelog
git log --pretty=format:' * %s%n' $tag_info >> changelog
echo "" >> changelog
echo "$pkgname ($tag_version) stable; urgency=medium" >> changelog
prevtag=$tag
done
tac changelog > debian/changelog
- name: Build deb
working-directory: ./src
run: |
dpkg-buildpackage -us -uc
- name: generate sha256sums
run: |
sha256sum *.deb > sha256sums
- id: artifact-upload
uses: actions/upload-artifact@v4
with:
name: deb-artifact-${{ github.sha }}
if-no-files-found: error
compression-level: 0
overwrite: true
path: |
*.deb
sha256sums
+56
View File
@@ -0,0 +1,56 @@
name: Release
run-name: Release-${{ github.ref_name }}-${{ github.run_number }}
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]'
jobs:
test:
name: Test release tag
runs-on: ubuntu-22.04
steps:
- run: |
echo ${{ github.ref }}
- if: ${{ github.ref_type != 'tag' }}
run: |
echo "::error::${{ github.ref }} branch is not a release tag"; exit 1
build:
name: Make deb package
needs:
- test
uses: ./.github/workflows/_deb.yml
secrets: inherit
release:
name: Release
needs:
- build
runs-on: ubuntu-22.04
steps:
- id: artifact-download
uses: actions/download-artifact@v4
with:
name: deb-artifact-${{ github.sha }}
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
generate_release_notes: true
make_latest: true
prerelease: true
files: |
*.deb
sha256sums
+11
View File
@@ -0,0 +1,11 @@
debian/.debhelper
debian/changelog
debian/debhelper-build-stamp
debian/libpve-storage-purestorage-perl
debian/files
debian/package
debian/tmp
/*.buildinfo
/*.deb
*.log
*.substvars
+20
View File
@@ -0,0 +1,20 @@
# .perltidyrc - Configuration for perltidy
# Indentation
--indent-columns=2
--continuation-indentation=2
--extended-continuation-indentation
# Line length and wrapping
--maximum-line-length=160
# Brackets spaces
--paren-tightness=0
--brace-tightness=0
--block-brace-tightness=0
# Comments
# Blocks
--cuddled-else
--cuddled-blocks
+1
View File
@@ -0,0 +1 @@
Timur Kumakbayev <timansky@neko.kz>
+1
View File
@@ -0,0 +1 @@
* @timansky @zigmund
+61
View File
@@ -0,0 +1,61 @@
# Contributing Guidelines
The following is a set of guidelines for contributing to nginx project.
We really appreciate that you are considering contributing!
## Table of Contents
- [Ask a Question](#ask-a-question)
- [Report a Bug](#report-a-bug)
- [Suggest a Feature or Enhancement](#suggest-a-feature-or-enhancement)
- [Open a Discussion](#open-a-discussion)
- [Submit a Pull Request](#submit-a-pull-request)
- [Issue Lifecycle](#issue-lifecycle)
## Ask a Question
To ask a question, open an issue on GitHub with the label `question`.
## Report a Bug
To report a bug, open an issue on GitHub with the label `bug` using the
available bug report issue template. Before reporting a bug, make sure the
issue has not already been reported.
## Suggest a Feature or Enhancement
To suggest a feature or enhancement, open an issue on GitHub with the label
`feature` or `enhancement` using the available feature request issue template.
Please ensure the feature or enhancement has not already been suggested.
## Submit a Pull Request
Follow this plan to contribute a change to plugin source code:
- Fork repository
- Create a branch
- Implement your changes in this branch
- Submit a pull request (PR) when your changes are tested and ready for review
### Formatting Changes
- Changes should be formatted according to the code style
- Keep a clean, concise and meaningful commit history on your branch, rebasing
locally and breaking changes logically into commits before submitting a PR
- Each commit message should have a single-line subject line followed by verbose
description after an empty line
- Limit the subject line to 67 characters, and the rest of the commit message
to 76 characters
- Reference issues in the the subject line; if the commit fixes an issue,
[name it](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
accordingly
### Before Submitting
- Try to make it clear why the suggested change is needed, and provide a use
case, if possible
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Kolesa, JSC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+1044
View File
File diff suppressed because it is too large Load Diff
+147
View File
@@ -0,0 +1,147 @@
# Proxmox VE Plugin for Pure Storage as Multipath iSCSI Source
This plugin enables the integration of Pure Storage arrays with Proxmox Virtual Environment (VE) using multipath iSCSI or Fibre Channel (FC). It allows you to use Pure Storage as a backend for your virtual machine disks, providing high performance and reliability.
## Table of Contents
- [Prerequisites](#prerequisites)
- [Multipath Configuration](#multipath-configuration)
- [Installation](#installation)
- [Manual](#manual)
- [APT](#apt)
- [Configuration](#configuration)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
## Prerequisites
Before installing and using this plugin, ensure that your Proxmox VE environment meets the following prerequisites.
### Multipath Configuration
To ensure correct operation with Pure Storage, you need to configure your multipath settings appropriately. Specifically, you need to set find_multipaths to no in your multipath.conf file. This setting disables the automatic detection of multipath devices, which is necessary for Pure Storage devices to be correctly recognized.
Below is an example of how your multipath.conf file should look when configured for Pure Storage arrays:
```
defaults {
polling_interval 2
find_multipaths no
}
devices {
device {
vendor "PURE"
product "FlashArray"
path_selector "queue-length 0"
hardware_handler "1 alua"
path_grouping_policy group_by_prio
prio alua
failback immediate
path_checker tur
fast_io_fail_tmo 10
user_friendly_names no
no_path_retry 0
features "0"
dev_loss_tmo 60
recheck_wwid yes
}
}
blacklist {
device {
vendor ".*"
product ".*"
}
}
blacklist_exceptions {
device {
vendor "PURE"
}
}
```
## Installation
There are two methods to install the plugin: manual installation and APT package installation.
### Manual
To manually install the plugin, follow these steps:
```bash
# Clone repository
git clone git@github.com:kolesa-team/pve-purestorage.git
# Navigate to the Plugin Directory
cd pve-purestorage
# Copy plugin to custom plugin directory
sudo cp PureStoragePlugin.pm /usr/share/perl5/PVE/Storage/Custom
# Restart Proxmox VE
sudo systemctl restart pve-cluster.service pvedaemon.service pvestatd.service pveproxy.service pvescheduler.service
```
### APT
**Note**: Replace `<PACKAGE_VERSION>` with your desired version number (e.g., `0.0.1`).
```bash
PACKAGE_VERSION="<PACKAGE_VERSION>" curl -L -o libpve-storage-purestorage-perl.deb "https://github.com/kolesa-team/pve-purestorage-plugin/releases/download/v$PACKAGE_VERSION/libpve-storage-purestorage-perl_$PACKAGE_VERSION-1_all.deb"
sudo apt install ./libpve-storage-purestorage-perl.deb
```
## Configuration
After installing the plugin, you need to configure Proxmox VE to use it. Since Proxmox VE does not currently support adding custom storage plugins via the GUI, you will need to manually edit the storage configuration file `/etc/pve/storage.conf`.
```
purestorage: pure
nodes: <proxmox_node_list>
address https://<purestorage_fqdn_or_ip>
token <purestorage_api_token>
vgname <purestorage_volume_group_name>
hgsuffix <purestorage_host_suffix>
content images
```
| Parameter | Description |
| --------- | ----------- |
| nodes | (`optional`) A comma-separated list of Proxmox node names. Use this parameter to limit the plugin to specific nodes in your cluster. If omitted, the storage is available to all nodes. |
| address | The URL or IP address of the Pure Storage API endpoint. Ensure that the Proxmox VE nodes can reach this address over the network. |
| token | The API token used for authentication with the Pure Storage array. This token must have sufficient permissions to create and manage volumes. |
| vgname | The name of the volume group where new virtual disks will be created. This should match the configuration on your Pure Storage array. |
| hgsuffix | (`optional`) A suffix that is appended to the hostname when the plugin interacts with the Pure Storage array. This can help differentiate hosts if necessary. |
| content | Specifies the types of content that can be stored. For virtual machine disk images, use images. |
> **_NOTE:_** Ensure that the token and other sensitive information are kept secure and not exposed publicly.
Example Configuration:
```
purestorage: pure
address https://purestorage.example.com
token abc123
vgname pure_vg
content images
```
## Troubleshooting
If you encounter issues while using the plugin, consider the following steps:
- Check Service Status: Ensure that the Proxmox VE services are running correctly. You can restart the services if necessary:
```bash
sudo systemctl restart pve-cluster.service pvedaemon.service pvestatd.service pveproxy.service pvescheduler.service
```
- Verify Network Connectivity: Ensure that the Proxmox VE nodes can reach the Pure Storage array over the network. Check for firewall rules or network issues that might be blocking communication.
- Review Logs: Check the Proxmox VE logs for any error messages related to storage or the plugin. Logs are typically found in /var/log/pve.
- Multipath Configuration: Verify that your multipath.conf is correctly configured and that multipath devices are recognized. Use multipath -ll to list the current multipath devices.
- API Token Permissions: Ensure that the API token used has the necessary permissions to create and manage volumes on the Pure Storage array.
- Plugin Updates: Ensure you are using the latest version of the plugin. Check the GitHub repository for updates.
## Contributing
Contributions to this project are welcome.
+1
View File
@@ -0,0 +1 @@
13
+19
View File
@@ -0,0 +1,19 @@
Source: libpve-storage-purestorage-perl
Section: perl
Priority: optional
Maintainer: Timur Kumakbayev <timansky@neko.kz>
Standards-Version: 4.6.0
Homepage: https://github.com/kolesa-team/pve-purestorage-plugin/blob/main/README.md
Vcs-Browser: https://github.com/kolesa-team/pve-purestorage-plugin
Vcs-Git: https://github.com/kolesa-team/pve-purestorage-plugin.git
Build-Depends: debhelper, devscripts
Package: libpve-storage-purestorage-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, libpve-storage-perl (>= 8.2.1), multipath-tools
Description: Pure Storage integration library for Proxmox VE
This package provides a Perl library to integrate Pure FlashArray Storage systems
with the Proxmox VE storage management infrastructure.
.
It allows administrators to configure and manage Pure FlashArray Storage devices
directly within the Proxmox VE environment.
+45
View File
@@ -0,0 +1,45 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libpve-storage-purestorage-perl
Upstream-Contact: Timur Kumakbayev <timansky@neko.kz>
Source: https://github.com/wimpysworld/deb-get
Files: *
Copyright: 2024 Kolesa, JSC <webmaster@kolesa.team>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2024 Kolesa, JSC <webmaster@kolesa.team>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
Vendored
+1
View File
@@ -0,0 +1 @@
docs/README.md
+1
View File
@@ -0,0 +1 @@
PureStoragePlugin.pm usr/share/perl5/PVE/Storage/Custom
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
if [ "$1" = "configure" ]; then
systemctl try-restart pve-cluster.service || true
systemctl try-restart pvedaemon.service || true
systemctl try-restart pvestatd.service || true
systemctl try-restart pveproxy.service || true
systemctl try-restart pvescheduler.service || true
fi
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
if [ "$1" = "configure" ]; then
systemctl try-restart pve-cluster.service || true
systemctl try-restart pvedaemon.service || true
systemctl try-restart pvestatd.service || true
systemctl try-restart pveproxy.service || true
systemctl try-restart pvescheduler.service || true
fi
Vendored Executable
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/make -f
%:
dh $@ --parallel
override_dh_auto_install:
dh_auto_install
install -d ${CURDIR}/debian/tmp/docs
install -m 0644 ${CURDIR}/README.md ${CURDIR}/debian/tmp/docs
override_dh_auto_clean:
dh_auto_clean
rm --force --recursive ${CURDIR}/debian/tmp
+1
View File
@@ -0,0 +1 @@
3.0 (native)
+3
View File
@@ -0,0 +1,3 @@
compression = gzip
compression-level = 9
tar-ignore = .git
+5
View File
@@ -0,0 +1,5 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%deb-get-$1.tar.gz%" \
https://github.com/kolesa-team/pve-purestorage-plugin/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz