[pve-devel] [PATCH v3] Add support for custom storage plugins

Dmitry Petuhov mityapetuhov at gmail.com
Fri Aug 26 10:53:42 CEST 2016


26.08.2016 10:08, Lindsay Mathieson пишет:
> On 25 August 2016 at 22:44, Dmitry Petuhov <mityapetuhov at gmail.com> wrote:
>> New in v3:
>> - Moved constant APIVER definion after other use statements.
>> - Added check for api() method and PVE::Storage::Plugin inheritabce.
>> - Added warning message on api version mismatch.
>> - Moved custom plugins loading after standard plugins.
>
> Will there be documentation for the Plugin API? on the Wiki?

That's not really API :)
Just create module with base class PVE::Storage::Plugin, add api() 
method and reload methods:

type, plugindata, properties, options, parse_volname, filesystem_path, 
create_base, clone_image, alloc_image, free_image, list_images, status, 
activate_storage, deactivate_storage, activate_volume, 
deactivate_volume, volume_resize, volume_snapshot, 
volume_snapshot_rollback, volume_snapshot_delete, volume_has_feature.

Many of them may be just placeholders, dying with errors or silently 
returning true, if your module not provides some functionality. See 
/usr/share/perl5/PVE/Storage/Plugin.pm for lists of parameters and 
returning values.

Although, simple description of parameters and returning values of these 
methods in comments in Plugin.pm (maybe in POD format?) could be helpful.





More information about the pve-devel mailing list