X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FStorage%2FISCSIDirectPlugin.pm;h=9777969b39e02ee03c44aca84da332b8bb56a316;hb=56897a920350d4429485e27b2b165860c6c543cf;hp=e13e4e658144c2f24c060bb39a02247b1b215839;hpb=39ab682a68f4d2367ad470532c7b77604560c09b;p=pve-storage.git diff --git a/PVE/Storage/ISCSIDirectPlugin.pm b/PVE/Storage/ISCSIDirectPlugin.pm index e13e4e6..9777969 100644 --- a/PVE/Storage/ISCSIDirectPlugin.pm +++ b/PVE/Storage/ISCSIDirectPlugin.pm @@ -36,6 +36,7 @@ sub iscsi_ls { $list->{$storeid}->{$image} = { name => $image, size => $size * $unittobytes{$unit}, + format => 'raw', }; } }); @@ -56,7 +57,8 @@ sub type { sub plugindata { return { - content => [ {images => 1, none => 1}, { images => 1 }], + content => [ {images => 1, none => 1}, { images => 1 }], + select_existing => 1, }; } @@ -67,6 +69,7 @@ sub options { nodes => { optional => 1}, disable => { optional => 1}, content => { optional => 1}, + bwlimit => { optional => 1 }, }; } @@ -77,7 +80,7 @@ sub parse_volname { if ($volname =~ m/^lun(\d+)$/) { - return ('images', $1, undef); + return ('images', $1, undef, undef, undef, undef, 'raw'); } die "unable to parse iscsi volume name '$volname'\n"; @@ -85,7 +88,10 @@ sub parse_volname { } sub path { - my ($class, $scfg, $volname) = @_; + my ($class, $scfg, $volname, $storeid, $snapname) = @_; + + die "volume snapshot is not possible on iscsi device" + if defined($snapname); my ($vtype, $lun, $vmid) = $class->parse_volname($volname); @@ -104,7 +110,7 @@ sub create_base { } sub clone_image { - my ($class, $scfg, $storeid, $volname, $vmid) = @_; + my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_; die "can't clone images in iscsi storage\n"; } @@ -181,12 +187,18 @@ sub deactivate_storage { } sub activate_volume { - my ($class, $storeid, $scfg, $volname, $exclusive, $cache) = @_; + my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_; + + die "volume snapshot is not possible on iscsi device" if $snapname; + return 1; } sub deactivate_volume { - my ($class, $storeid, $scfg, $volname, $exclusive, $cache) = @_; + my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_; + + die "volume snapshot is not possible on iscsi device" if $snapname; + return 1; } @@ -205,7 +217,7 @@ sub volume_resize { } sub volume_snapshot { - my ($class, $scfg, $storeid, $volname, $snap, $running) = @_; + my ($class, $scfg, $storeid, $volname, $snap) = @_; die "volume snapshot is not possible on iscsi device"; } @@ -231,7 +243,7 @@ sub volume_has_feature { my $key = undef; if($snapname){ - $key = $snapname + $key = 'snap'; }else{ $key = $isBase ? 'base' : 'current'; }