protected => 1,
proxyto => 'node',
permissions => {
- check => ['perm', '/', ['Sys.Audit', 'Datastore.Audit'], any => 1],
+ check => ['or',
+ ['perm', '/', ['Sys.Audit', 'Datastore.Audit'], any => 1],
+ ['perm', '/nodes/{node}', ['Sys.Audit', 'Datastore.Audit'], any => 1],
+ ],
},
parameters => {
additionalProperties => 0,
properties => {
node => get_standard_option('pve-node'),
+ 'include-partitions' => {
+ description => "Also include partitions.",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
skipsmart => {
description => "Skip smart checks.",
type => 'boolean',
serial => { type => 'string', optional => 1 },
wwn => { type => 'string', optional => 1},
health => { type => 'string', optional => 1},
+ parent => {
+ type => 'string',
+ description => 'For partitions only. The device path of ' .
+ 'the disk the partition resides on.',
+ optional => 1
+ },
},
},
},
my ($param) = @_;
my $skipsmart = $param->{skipsmart} // 0;
+ my $include_partitions = $param->{'include-partitions'} // 0;
- my $disks = PVE::Diskmanage::get_disks(undef, $skipsmart);
+ my $disks = PVE::Diskmanage::get_disks(
+ undef,
+ $skipsmart,
+ $include_partitions
+ );
my $type = $param->{type} // '';
my $result = [];
my $entry = $disks->{$disk};
if ($type eq 'journal_disks') {
next if $entry->{osdid} >= 0;
- next if !($entry->{gpt} || !$entry->{used} || $entry->{used} eq 'LVM');
+ if (my $usage = $entry->{used}) {
+ next if !($usage eq 'partitions' && $entry->{gpt}
+ || $usage eq 'LVM');
+ }
} elsif ($type eq 'unused') {
next if $entry->{used};
} elsif ($type ne '') {