The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6479
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Closes #6478 Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 051f3ecc9e8ec4780707ae0368dbacdaa1a9e81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Wed, 20 Nov 2019 12:38:45 -0500 Subject: [PATCH] lxd/storage/zfs: Fix migration on zfs 0.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #6478 Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- lxd/storage_zfs.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lxd/storage_zfs.go b/lxd/storage_zfs.go index 26c5b4af2d..6685410db8 100644 --- a/lxd/storage_zfs.go +++ b/lxd/storage_zfs.go @@ -2567,7 +2567,7 @@ func (s *storageZfs) MigrationSink(conn *websocket.Conn, op *operations.Operatio zfsName := fmt.Sprintf("containers/%s", project.Prefix(args.Instance.Project(), args.Instance.Name())) zfsRecv := func(zfsName string, writeWrapper func(io.WriteCloser) io.WriteCloser) error { zfsFsName := fmt.Sprintf("%s/%s", poolName, zfsName) - args := []string{"receive", "-F", "-o", "canmount=noauto", "-o", "mountpoint=none", "-u", zfsFsName} + args := []string{"receive", "-F", "-u", zfsFsName} cmd := exec.Command("zfs", args...) stdin, err := cmd.StdinPipe() @@ -2599,8 +2599,20 @@ func (s *storageZfs) MigrationSink(conn *websocket.Conn, op *operations.Operatio err = cmd.Wait() if err != nil { logger.Errorf("Problem with zfs recv: %s", string(output)) + return err } - return err + + err = zfsPoolVolumeSet(poolName, zfsName, "canmount", "noauto") + if err != nil { + return err + } + + err = zfsPoolVolumeSet(poolName, zfsName, "mountpoint", "none") + if err != nil { + return err + } + + return nil } // Destroy the pre-existing (empty) dataset, this avoids issues with encryption
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel