diff --git a/pkg/hostman/storageman/storage_lvm.go b/pkg/hostman/storageman/storage_lvm.go index 19efd2d9299..9088762eddb 100644 --- a/pkg/hostman/storageman/storage_lvm.go +++ b/pkg/hostman/storageman/storage_lvm.go @@ -225,7 +225,9 @@ func (s *SLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (j return nil, err } } - snapId := path.Join("/dev", s.GetPath(), input.SnapshotId) + + snapName := "snap_" + input.SnapshotId + snapId := path.Join("/dev", s.GetPath(), snapName) err := lvmutils.LvRemove(snapId) if err != nil { return nil, err diff --git a/pkg/hostman/storageman/storage_slvm.go b/pkg/hostman/storageman/storage_slvm.go index cd1faa8185b..f36ff2e7baa 100644 --- a/pkg/hostman/storageman/storage_slvm.go +++ b/pkg/hostman/storageman/storage_slvm.go @@ -109,7 +109,7 @@ func (s *SSLVMStorage) CreateDiskFromSnapshot(ctx context.Context, disk IDisk, i } func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) { - input, ok := params.(SStorageDeleteSnapshot) + input, ok := params.(*SStorageDeleteSnapshot) if !ok { return nil, hostutils.ParamsError } @@ -139,7 +139,8 @@ func (s *SSLVMStorage) DeleteSnapshot(ctx context.Context, params interface{}) ( } } - snapId := path.Join("/dev", s.GetPath(), input.SnapshotId) + snapName := "snap_" + input.SnapshotId + snapId := path.Join("/dev", s.GetPath(), snapName) err := lvmutils.LvRemove(snapId) if err != nil { return nil, err