Skip to content

lxc copy API requires architecture in request #18100

@shundezhang

Description

@shundezhang

Please confirm

  • I have searched existing issues to check if an issue already exists for the bug I encountered.

Distribution

Ubuntu

Distribution version

22.04

Output of snap list --all lxd core20 core22 core24 snapd

Name    Version         Rev    Tracking       Publisher   Notes
core20  20260105        2717   latest/stable  canonical✓  base,disabled
core20  20260211        2769   latest/stable  canonical✓  base
core22  20260225        2411   latest/stable  canonical✓  base
core24  20260317        1587   latest/stable  canonical✓  base
lxd     5.0.6-e49d9f4   38469  5.21/stable    canonical✓  disabled,in-cohort,held
lxd     5.21.4-1374f39  38368  5.21/stable    canonical✓  in-cohort,held
snapd   2.74.1          26382  latest/stable  canonical✓  snapd

System info

Kernel version: 5.15.0-174-generic
LXC version: 6.0.4
LXD version: 5.21.4
Storage backend: zfs

Instance log

n/a

Expected behavior

When sending API request from AMS to LXD to do container copy, the InstancesPost object doesn't have an value for architecture.

	req := api.InstancesPost{}
	req.Name = targetName
	req.Source.Type = "copy"
	req.Source.Source = sourceName
	req.Type = api.InstanceTypeContainer

The architecture should not be changed during copy, so it is expected that LXD server can retrieve it from the source container, rather than using the value in the request object.

Actual behavior

An error is returned, showing empt in architecture field.

Error: Architecture isn't supported

Steps to reproduce

Use the above code and not set architecture value.

Information to attach

  • Any relevant kernel output (dmesg)
  • Instance configuration (lxc config show <instance> --expanded)
  • Main daemon log (at /var/log/lxd/lxd.log or /var/snap/lxd/common/lxd/logs/lxd.log)
  • If a lxc command fails, output of the command with --debug
  • Output of the daemon with --debug (or use lxc monitor while reproducing the issue)

Metadata

Metadata

Assignees

Labels

JiraTriggers the synchronization of a GitHub issue in Jira

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions