Hi,
in another thread @nephri and me discussed using zfs over iscsi with FreeNAS.
Proxmox VE 4.3, set an LACP bond
Somewhen this summer some (undocumented) changes went into Proxmox that allow custom storage plugins that don't break with the next update, the discussion on the pve-devel list can be found here:
[pve-devel] [PATCH] Add support for custom storage plugins
A sample implementation for MPIO with Netapp is here:
GitHub - mityarzn/pve-storage-custom-mpnetapp
In this thread i will give a short introduction how to use this and also an example with zfs on an scst iscsi target, in the hope it is usefull for someone.
Perl is not my 'native language' but i`m getting more and more used to by reading bit`s of code i need to understand to get things setup and/or do minor changes, mainly in the proxmox codebase.
So, if there is code, use it with caution and on your own risk !
Also, if someone knows a better / cleaner way to do those things in perl i`m happy to learn
I was looking for a way to get zfs over iscsi with an SCST Target earlier, and have made some work that would require small changes in proxmox to survive updates. As i had some trouble with the code itself, migrating storage away from such a volume always caused errors and also had no urgent need for it i put this on hold.
However, after @nephri decided he would put some work on an plugin for FreeNAS i gave it another try, did some refactoring to use the 'custom-plugin' mechanism and also the silly io-errors that drove me nuts were gone.
Here is a short introduction how the mechanism of custom storage plugins in proxmox works:
- the plugins reside in /usr/share/perl5/PVE/Storage/Custom/
So create this directory if not present
- each plugin should reside in a file #name#.pm within this directory, i.E. scstZFSPlugin.pm or FreeNASZFSPlugin.pm
- this is basically a perl module that holds the implementation of the storage-plugin.
The 'Interface' is defined in PVE::Storage:: Plugin. Therefore its a good idea to inherit from this (or a subclass).
Besides the Implementation itself some bits of configuration should be done within this, too.
This is basically an api-version, the plugins name (to be used in storage.cgf), what type of data the storage will be capable of, it`s properties and options:
- a good way to actually test an implementation is pvesm status - this includes your plugin and throws errors in the case there are some
- to activate / see it in the gui a restart of pvedaemon is required: /etc/init.d/pvedaemon restart
in another thread @nephri and me discussed using zfs over iscsi with FreeNAS.
Proxmox VE 4.3, set an LACP bond
Somewhen this summer some (undocumented) changes went into Proxmox that allow custom storage plugins that don't break with the next update, the discussion on the pve-devel list can be found here:
[pve-devel] [PATCH] Add support for custom storage plugins
A sample implementation for MPIO with Netapp is here:
GitHub - mityarzn/pve-storage-custom-mpnetapp
In this thread i will give a short introduction how to use this and also an example with zfs on an scst iscsi target, in the hope it is usefull for someone.
Perl is not my 'native language' but i`m getting more and more used to by reading bit`s of code i need to understand to get things setup and/or do minor changes, mainly in the proxmox codebase.
So, if there is code, use it with caution and on your own risk !
Also, if someone knows a better / cleaner way to do those things in perl i`m happy to learn
I was looking for a way to get zfs over iscsi with an SCST Target earlier, and have made some work that would require small changes in proxmox to survive updates. As i had some trouble with the code itself, migrating storage away from such a volume always caused errors and also had no urgent need for it i put this on hold.
However, after @nephri decided he would put some work on an plugin for FreeNAS i gave it another try, did some refactoring to use the 'custom-plugin' mechanism and also the silly io-errors that drove me nuts were gone.
Here is a short introduction how the mechanism of custom storage plugins in proxmox works:
- the plugins reside in /usr/share/perl5/PVE/Storage/Custom/
So create this directory if not present
- each plugin should reside in a file #name#.pm within this directory, i.E. scstZFSPlugin.pm or FreeNASZFSPlugin.pm
- this is basically a perl module that holds the implementation of the storage-plugin.
The 'Interface' is defined in PVE::Storage:: Plugin. Therefore its a good idea to inherit from this (or a subclass).
Code:
use base qw(PVE::Storage::Plugin);
This is basically an api-version, the plugins name (to be used in storage.cgf), what type of data the storage will be capable of, it`s properties and options:
Code:
sub api {
return 1;
}
sub type {
return 'scstzfs';
}
sub plugindata {
return {
content => [ { images => 1 }, {images => 1} ]
};
}
# @todo why is it needed ?
sub properties {
return {
nowritecache_scst => {
description => "disable write cache on the target",
type => 'boolean'
}
}
}
sub options {
return {
nodes => { optional => 1 },
disable => { optional => 1 },
portal => { fixed => 1 },
target => { fixed => 1 },
iscsiprovider => {fixed => 1},
pool => { fixed => 1 },
blocksize => { fixed => 1 },
nowritecache => { optional => 1 },
sparse => { optional => 1 },
comstar_hg => { optional => 1 },
comstar_tg => { optional => 1 },
content => { optional => 1 },
shared => { fixed => 1 },
};
}
- to activate / see it in the gui a restart of pvedaemon is required: /etc/init.d/pvedaemon restart
Last edited: