Browse Source

Use vitastor-cli df to show pool stats in Proxmox

master
Vitaliy Filippov 12 months ago
parent
commit
b82c30328f
  1. 10
      patches/PVE_VitastorPlugin.pm

10
patches/PVE_VitastorPlugin.pm

@ -339,11 +339,11 @@ sub list_images
sub status
{
my ($class, $storeid, $scfg, $cache) = @_;
# FIXME: take it from etcd
my $free = 0;
my $used = 0;
my $total = $used + $free;
my $active = 1;
my $stats = [ grep { $_->{name} eq $scfg->{vitastor_pool} } @{ run_cli($scfg, [ 'df' ]) } ]->[0];
my $free = $stats ? $stats->{max_available} : 0;
my $used = $stats ? $stats->{used_raw}/($stats->{raw_to_usable}||1) : 0;
my $total = $free+$used;
my $active = $stats ? 1 : 0;
return ($total, $free, $used, $active);
}

Loading…
Cancel
Save