From 8bde54c8f0e024f7930f8302c395af9ec5d3880a Mon Sep 17 00:00:00 2001 From: tugbataluy Date: Fri, 10 Apr 2026 12:08:01 +0300 Subject: [PATCH 1/2] lxd/lxd/instances_post: Use source's Architecture type when copying an instance Signed-off-by: tugbataluy --- lxd/instances_post.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lxd/instances_post.go b/lxd/instances_post.go index b246ef242b27..32245dd4b190 100644 --- a/lxd/instances_post.go +++ b/lxd/instances_post.go @@ -1297,6 +1297,12 @@ func instancesPost(d *Daemon, r *http.Request) response.Response { req.Type = api.InstanceType(sourceInst.Type.String()) + // Use source instance's architecture. + req.Architecture, err = osarch.ArchitectureName(sourceInst.Architecture) + if err != nil { + return err + } + // Use source instance's profiles if no profile override. if req.Profiles == nil { sourceInstArgs, err := tx.InstancesToInstanceArgs(ctx, true, *sourceInst) From 367a95853e0785f966f54144f3ff496e9a2a6c72 Mon Sep 17 00:00:00 2001 From: tugbataluy Date: Fri, 10 Apr 2026 12:16:36 +0300 Subject: [PATCH 2/2] test/suites/container_copy: Add architecture inheritance case to container copying test. Signed-off-by: tugbataluy --- test/suites/container_copy.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/suites/container_copy.sh b/test/suites/container_copy.sh index c4e92bd1d660..7f7714ff5fff 100644 --- a/test/suites/container_copy.sh +++ b/test/suites/container_copy.sh @@ -131,6 +131,11 @@ test_container_copy_start() { lxc copy c1 c2 [ "$(lxc list -f csv -c s c2)" = "STOPPED" ] + sub_test "Copied container inherits the source architecture" + source_arch="$(lxc query /1.0/instances/c1 | jq --raw-output '.architecture')" + target_arch="$(lxc query /1.0/instances/c2 | jq --raw-output '.architecture')" + [ "${source_arch}" = "${target_arch}" ] + lxc delete -f c2 echo "==> Check that a container can be copied and started with the same command"