Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/storage/volume/linstor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to Linstor CloudStack plugin will be documented in this file
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2025-01-20]

### Fixed

- Volume snapshots on zfs used the wrong dataset path to hide/unhide snapdev

## [2024-12-13]

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ public final class LinstorBackupSnapshotCommandWrapper
{
private static final Logger s_logger = Logger.getLogger(LinstorBackupSnapshotCommandWrapper.class);

private static String zfsDatasetName(String zfsFullSnapshotUrl) {
String zfsFullPath = zfsFullSnapshotUrl.substring(6);
int atPos = zfsFullPath.indexOf('@');
return atPos >= 0 ? zfsFullPath.substring(0, atPos) : zfsFullPath;
}

private String zfsSnapdev(boolean hide, String zfsUrl) {
Script script = new Script("/usr/bin/zfs", Duration.millis(5000));
Script script = new Script("zfs", Duration.millis(5000));
script.add("set");
script.add("snapdev=" + (hide ? "hidden" : "visible"));
script.add(zfsUrl.substring(6)); // cutting zfs://
script.add(zfsDatasetName(zfsUrl)); // cutting zfs:// and @snapshotname
return script.execute();
}

Expand Down Expand Up @@ -133,10 +139,10 @@ public CopyCmdAnswer execute(LinstorBackupSnapshotCommand cmd, LibvirtComputingR
s_logger.info("Src: " + srcPath + " | " + src.getName());
if (srcPath.startsWith("zfs://")) {
zfsHidden = true;
if (zfsSnapdev(false, srcPath) != null) {
if (zfsSnapdev(false, src.getPath()) != null) {
return new CopyCmdAnswer("Unable to unhide zfs snapshot device.");
}
srcPath = "/dev/" + srcPath.substring(6);
srcPath = "/dev/zvol/" + srcPath.substring(6);
}

secondaryPool = storagePoolMgr.getStoragePoolByURI(dstDataStore.getUrl());
Expand Down