diff --git a/pkg/hostman/storageman/lvmutils/lvmutils.go b/pkg/hostman/storageman/lvmutils/lvmutils.go index b86027759b1..61f7623e450 100644 --- a/pkg/hostman/storageman/lvmutils/lvmutils.go +++ b/pkg/hostman/storageman/lvmutils/lvmutils.go @@ -266,11 +266,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 e15fb71ca00..10b387fc722 100644 --- a/pkg/hostman/storageman/storage_slvm.go +++ b/pkg/hostman/storageman/storage_slvm.go @@ -152,6 +152,9 @@ func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) ( } func (s *SSLVMStorage) Accessible() error { + if err := lvmutils.VgActive(s.Path, true, true); err != nil { + log.Warningf("vgactive got %s", err) + } if err := lvmutils.VgDisplay(s.Path); err != nil { return err }