5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-01-08 21:18:06 +03:00

add ESXi plugin for import and wire-it up to a new get_guest_import plugin fn

The get_guest_import fn is currently a private/internal API and should
not yet be exposed as a public part of the storage API.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-03-04 10:10:47 +01:00 committed by Thomas Lamprecht
parent a02056f8df
commit a171036789
4 changed files with 1037 additions and 2 deletions

3
debian/control vendored
View File

@ -49,6 +49,7 @@ Depends: ceph-common (>= 12.2~),
udev,
${misc:Depends},
${perl:Depends},
Recommends: zfs-zed,
Recommends: pve-esxi-import-tools,
zfs-zed,
Description: Proxmox VE storage management library
This package contains the storage management library used by Proxmox VE.

View File

@ -39,6 +39,7 @@ use PVE::Storage::ZFSPoolPlugin;
use PVE::Storage::ZFSPlugin;
use PVE::Storage::PBSPlugin;
use PVE::Storage::BTRFSPlugin;
use PVE::Storage::ESXiPlugin;
# Storage API version. Increment it on changes in storage API interface.
use constant APIVER => 10;
@ -64,6 +65,7 @@ PVE::Storage::ZFSPoolPlugin->register();
PVE::Storage::ZFSPlugin->register();
PVE::Storage::PBSPlugin->register();
PVE::Storage::BTRFSPlugin->register();
PVE::Storage::ESXiPlugin->register();
# load third-party plugins
if ( -d '/usr/share/perl5/PVE/Storage/Custom' ) {
@ -2165,4 +2167,20 @@ sub normalize_content_filename {
return $filename;
}
# If a storage provides an 'import' content type, it should be able to provide
# an object implementing the import information interface.
sub get_import_metadata {
my ($cfg, $volid) = @_;
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
if (!$plugin->can('get_import_metadata')) {
die "storage does not support the importer API\n";
}
return $plugin->get_import_metadata($scfg, $volname, $storeid);
}
1;

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,8 @@ SOURCES= \
ZFSPlugin.pm \
PBSPlugin.pm \
BTRFSPlugin.pm \
LvmThinPlugin.pm
LvmThinPlugin.pm \
ESXiPlugin.pm
.PHONY: install
install: