diff --git a/pkg/hostman/storageman/lvmutils/lvmutils.go b/pkg/hostman/storageman/lvmutils/lvmutils.go index b918e142b7..8287c8dce0 100644 --- a/pkg/hostman/storageman/lvmutils/lvmutils.go +++ b/pkg/hostman/storageman/lvmutils/lvmutils.go @@ -280,11 +280,14 @@ func VgDisplay(vgName string) error { return nil } -func VgActive(vgName string, active bool) error { +func VgActive(vgName string, active, autoActivation bool) error { opts := "-ay" if !active { opts = "-an" } + if active && autoActivation { + opts = "-aay" + } out, err := procutils.NewRemoteCommandAsFarAsPossible("lvm", "vgchange", opts, vgName).Output() if err != nil { return errors.Wrapf(err, "vgchange %s %s failed %s", opts, vgName, out) diff --git a/pkg/hostman/storageman/storage_slvm.go b/pkg/hostman/storageman/storage_slvm.go index f36ff2e7ba..8ddcf38dee 100644 --- a/pkg/hostman/storageman/storage_slvm.go +++ b/pkg/hostman/storageman/storage_slvm.go @@ -152,7 +152,7 @@ func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) ( } func (s *SSLVMStorage) Accessible() error { - if err := lvmutils.VgActive(s.Path, true); err != nil { + if err := lvmutils.VgActive(s.Path, true, true); err != nil { log.Warningf("vgactive got %s", err) }