Disable vgscan ?

ouafnico

New Member
Apr 2, 2021
4
0
1
37
Hi,

I'm using proxmox for a while on a personal home server.

I'm using multiples disk devices with LVM.

Actually, I saw pve is waiking all my disks every 5 seconds for the LVM scan.
I'm not using all my lvm volumes groups for proxmox, some are for others needs.

I'm still searching how to tell proxmox to do not vgscan all disks.
I saw the solution to add some devices on global_filters of lvm, but I can't, if I do that, my uneeded proxmox VGs will not be available from system too.

Is there any way to disable this "auto-check" from proxmox?
 
I think the problem is in this function :


Code:
sub lvm_vgs {

    my ($includepvs) = @_;



    my $cmd = ['/sbin/vgs', '--separator', ':', '--noheadings', '--units', 'b',

           '--unbuffered', '--nosuffix', '--options'];



    my $cols = [qw(vg_name vg_size vg_free lv_count)];



    if ($includepvs) {

    push @$cols, qw(pv_name pv_size pv_free);

    }



    push @$cmd, join(',', @$cols);



    my $vgs = {};

    eval {

    run_command($cmd, outfunc => sub {

        my $line = shift;

        $line = trim($line);



        my ($name, $size, $free, $lvcount, $pvname, $pvsize, $pvfree) = split (':', $line);



        $vgs->{$name} //= {

        size => int ($size),

        free => int ($free),

        lvcount => int($lvcount)

        };



        if (defined($pvname) && defined($pvsize) && defined($pvfree)) {

        push @{$vgs->{$name}->{pvs}}, {

            name => $pvname,

            size => int($pvsize),

            free => int($pvfree),

        };

        }

    },

    errfunc => $ignore_no_medium_warnings,

    );

    };

    my $err = $@;



    # just warn (vgs return error code 5 if clvmd does not run)

    # but output is still OK (list without clustered VGs)

    warn $err if $err;



    return $vgs;

}

We need to execute vgs with a "device" name.
Maybe it's better to get the VG name from storage.cfg and start vgs only with this?
 
I might have found something.

vgs is scanning every /dev/sd* devices, and /dev/md* devices.
My VG are on md devices.
I have added in lvm filter, /dev/sd* in reject, but accept for /dev/md* only.

Maybe the mdadm cache is responding to vgs commands, and it's not waking up all devices.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!