mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
fix(xfs): fixing xfs duplicate uuid for cloned volumes
for mounting the cloned volume for xfs, a new UUID has to be generated. We are generating a new UUID for the cloned volumes which are formatted as xfs using xfs_admin command. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
1c9ee3102a
commit
468bf66b0c
1 changed files with 10 additions and 0 deletions
|
|
@ -361,6 +361,16 @@ func CreateClone(vol *apis.ZFSVolume) error {
|
|||
logrus.Infof("using existing clone volume %v", volume)
|
||||
}
|
||||
|
||||
if vol.Spec.FsType == "xfs" {
|
||||
// for mounting the cloned volume for xfs, a new UUID has to be generated
|
||||
device := ZFS_DEVPATH + volume
|
||||
cmd := exec.Command("xfs_admin", "-U", "generate", device)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
logrus.Errorf("zfspv: Clone XFS uuid generate failed error: %s", string(out))
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue