The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4405

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) ===
AFAIU, we were passing to POST /1.0/storage-pools some internal config keys that
are generated by LXD when it handles the request, and shouldn't be included in
the request payload.

For some reason doing that didn't break in the case where you were creating a
new zfs pool (setting "source" to a block device), but it does break when
setting "source" to an existing zfs pool name.

I manually tested the fix to confirm it works, since at the moment we don't have
a way to run lxd init interactively in integration tests (the main issue is how
to ask for the trust password).

The lxd init --preseed case was not affected by this bug, as long as you avoid
including those internal config keys in your YAML.

Closes #4404.

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
From 8073743b5a571a3d37acd8451e12dd8553c6c932 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanay...@canonical.com>
Date: Wed, 4 Apr 2018 08:04:59 +0000
Subject: [PATCH] Fix lxd init failing to join a cluster in interactive mode
 with an existing zfs dataset

AFAIU, we were passing to POST /1.0/storage-pools some internal config keys that
are generated by LXD when it handles the request, and shouldn't be included in
the request payload.

For some reason doing that didn't break in the case where you were creating a
new zfs pool (setting "source" to a block device), but it does break when
setting "source" to an existing zfs pool name.

I manually tested the fix to confirm it works, since at the moment we don't have
a way to run lxd init interactively in integration tests (the main issue is how
to ask for the trust password).

The lxd init --preseed case was not affected by this bug, as long as you avoid
including those internal config keys in your YAML.

Closes #4404.

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
---
 lxd/main_init_interactive.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/main_init_interactive.go b/lxd/main_init_interactive.go
index 898632010..240acf0da 100644
--- a/lxd/main_init_interactive.go
+++ b/lxd/main_init_interactive.go
@@ -189,6 +189,10 @@ func (c *cmdInit) askClustering(config *initData, d 
lxd.ContainerServer) error {
                                        Name:           pool.Name,
                                }
 
+                               // Delete config keys that are automatically 
populated by LXD
+                               delete(newPool.Config, 
"volatile.initial_source")
+                               delete(newPool.Config, "zfs.pool_name")
+
                                // Only ask for the node-specific "source" key 
if it's defined in the target node
                                if pool.Config["source"] != "" {
                                        // Dummy validator for allowing empty 
strings
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to