Skip to content

Instance network device rename fails, validation error #15300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edlerd opened this issue Apr 1, 2025 · 3 comments
Open

Instance network device rename fails, validation error #15300

edlerd opened this issue Apr 1, 2025 · 3 comments

Comments

@edlerd
Copy link
Contributor

edlerd commented Apr 1, 2025

Distribution

ubuntu

Distribution version

24.04

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

lxd                                   6.3-f22a395                     33085  6/stable         canonical**     -

Issue description

When changing the name for an instance NIC device, a validation error occurs. Expected is that the operation succeeds.

I.e. changing from this:

devices:
  eth-1:
    network: my-bridge
    type: nic

to this:

devices:
  eth-2:
    network: my-bridge
    type: nic

causes an error:

Failed add validation for device "eth-2": Instance DNS name "precise-ray" conflict between "eth-2" and "eth-1" because both are connected to same network

When removing the device, then saving, then adding back with new name, the procedure succeeds. Also, when doing this via a profile device, it succeeds. Only for instances, the validation seems to be broken.

Steps to reproduce

  1. Create an instance
  2. Assign a network device to the instance
  3. Rename the network device name via the PUT /1.0/instances/:name endpoint or via lxc config edit :name
  4. See error, validation fails, expected is this action to succeed
@edlerd
Copy link
Contributor Author

edlerd commented Apr 1, 2025

@Kxiru found this issue in canonical/lxd-ui#1151

@edlerd edlerd changed the title Instance network device rename not allowed Instance network device rename not allowed, due to validation error Apr 1, 2025
@edlerd edlerd changed the title Instance network device rename not allowed, due to validation error Instance network device rename fails, validation error Apr 1, 2025
@edlerd
Copy link
Contributor Author

edlerd commented Apr 1, 2025

There is another problem with the validation:

  1. An instance with the name "foo" exists in two projects: "project-1" and "project-2". Instance foo in project-1 is connected to a network.
  2. Now editing instance "foo" in project-2, adding a new nic device with the same network.
  3. We get a validation error, that the DNS name is already taken. Even though, the instance DNS names should be considered project specific.

@tomponline
Copy link
Member

3. We get a validation error, that the DNS name is already taken. Even though, the instance DNS names should be considered project specific.

Lets just test that assumption. If the instance NICs are connected to the same bridge network then DNS names are global for that network and not project specific, so that sounds correct to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants