Skip to content

CP-54441 Adapt interface ordering in xe-reset-networking #6544

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

Conversation

changlei-li
Copy link
Contributor

If interface-rename script doesn't exist, networkd will

  • handle the interfaces sorting
  • write inventory when first boot

So, when interface-rename doesn't exist, xe-reset-networking should:

  • NOT call interface-rename script
  • Delete MANAGEMENT_INTERFACE value in inventory.

BTW, the current bridge name conversion method rely on hardcode 'eth' which is correct only when interface-rename script exists.

@changlei-li
Copy link
Contributor Author

@changlei-li changlei-li requested a review from minglumlu June 20, 2025 02:00
@changlei-li changlei-li force-pushed the private/changleli/CP-54441 branch 2 times, most recently from 8fff11c to 33e349f Compare June 20, 2025 10:49
# NOTE: Only correct when interface-rename script exists
if vlan != None:
return 'xentemp'
if device[:3] == 'eth':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use a regexp to make sure the entire string has an expected format? I think it's risky to check a part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check if we have a stricter check when generate bridge name in xapi code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not consistent about converting interface name to bridge name in OCaml code. One is based on start_with, one is based on sscanf "eth%d%!" which is stricter. I will raise another PR to improve this as well as this python script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See first commit in #6556

If interface-rename script doesn't exist, networkd will
- handle the interfaces sorting
- write inventory when first boot

So, when interface-rename doesn't exist, xe-reset-networking
should:
- NOT call interface-rename script
- Delete MANAGEMENT_INTERFACE value in inventory.

BTW, the current bridge name conversion method rely on hardcode
'eth' which is correct only when interface-rename script exists.

Signed-off-by: Changlei Li <changlei.li@cloud.com>
On XS 8, `service xapi stop` redirect to `systemctl`.
On XS 9, `service` is not supported.
So use `systemctl` to stop xapi service.

Signed-off-by: Changlei Li <changlei.li@cloud.com>
@changlei-li changlei-li force-pushed the private/changleli/CP-54441 branch from 33e349f to cb365f2 Compare June 23, 2025 09:39
@changlei-li changlei-li merged commit 4c1d034 into xapi-project:feature/host-network-device-ordering Jun 24, 2025
16 checks passed
@changlei-li changlei-li deleted the private/changleli/CP-54441 branch June 24, 2025 02:00
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

Successfully merging this pull request may close these issues.

4 participants