Skip to content
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

Match by MAC in Netplan for LXD VMs #17327

Merged
merged 1 commit into from
May 23, 2024
Merged

Conversation

manadart
Copy link
Member

@manadart manadart commented May 2, 2024

Some time ago, we observed that 22.04 LXD containers were sometimes getting NICs with different MAC addresses to what the on-machine broker was configuring.

At this time we changed the behaviour of the cloud-init Netplan generation to match NICs by name instead of MAC when provisioning LXD containers.

The linked bug describes network configuration failures for VMs on LXD due to being unable to match by name. This is because interfaces get the kernel generated names (such as "ens5s0") instead of the configured "eth0".

Here we recruit matching by name specifically for LXD containers. LXD VMs and VMs provisioned by the KVM broker use MAC matching, which fixes the issue.

QA steps

I tested on MAAS, but the manual provider should work.

  • juju add-model work.
  • juju add-machine.
  • juju deploy ubuntu --to lxd:0 --constraints virt-type=virtual-machine.
  • Ensure quiescence.

Documentation changes

None.

Links

Launchpad bug: https://bugs.launchpad.net/juju/+bug/2064515

Jira card: JUJU-5981

@manadart manadart added the 3.4 label May 2, 2024
@hpidcock hpidcock added 3.6 and removed 3.4 labels May 3, 2024
@manadart manadart changed the base branch from 3.6 to 3.4 May 3, 2024 04:28
@manadart manadart added 3.4 and removed 3.6 labels May 3, 2024
Copy link
Member

@nvinuesa nvinuesa left a comment

Choose a reason for hiding this comment

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

Code LGTM, although QA doesn't pass on my manual cloud: the container never gets an address:

juju status
Model  Controller  Cloud/Region              Version  SLA          Timestamp
m      c           manual-multipass/default  3.4.3.1  unsupported  17:10:25+02:00

App     Version  Status   Scale  Charm   Channel        Rev  Exposed  Message
ubuntu           waiting    0/1  ubuntu  latest/stable   24  no       waiting for machine

Unit      Workload  Agent       Machine  Public address  Ports  Message
ubuntu/0  waiting   allocating  0/lxd/0                         waiting for machine

Machine  State    Address         Inst id                Base          AZ  Message
0        started  10.215.127.216  manual:10.215.127.216  [email protected]      Manually provisioned machine
0/lxd/0  pending                  juju-e594e5-0-lxd-0    [email protected]      Container started

I don't see any error on the logs though.

@manadart
Copy link
Member Author

/merge

1 similar comment
@manadart
Copy link
Member Author

/merge

@manadart
Copy link
Member Author

/build

@manadart
Copy link
Member Author

/merge

@SimonRichardson
Copy link
Member

/merge

@manadart
Copy link
Member Author

/merge

1 similar comment
@manadart
Copy link
Member Author

/merge

address, when we create LXD VMs on-machine. This mimics the behaviour
for the KVM provider.

The option setting is simplified to remove multiple negative clauses,
and the KVM broker made explicit in it's use of the option.
@manadart
Copy link
Member Author

/merge

@jujubot jujubot merged commit c95ac79 into juju:3.4 May 23, 2024
22 of 23 checks passed
@manadart manadart deleted the 3.4-lxd-vm-in-machine branch May 23, 2024 14:09
@manadart manadart mentioned this pull request May 24, 2024
@wallyworld wallyworld mentioned this pull request May 29, 2024
jujubot added a commit that referenced this pull request May 29, 2024
#17438

Merge 3.6

Conflicts were mainly due to previous series to base work (delete code in 4.0 target).
The secrets conflict was code moved to the domain service.
The deployrepository change essentially brought in new code from 3.6

Also, the juju charm repo has since been brought in tree so recent changes from upstream needed to be copied down.

#17061 [from jack-w-shaw/fix_regression_local_pylib…](65c9f60)
#17079 [from jack-w-shaw/fix_another_regression_wit…](501fcd8)
#17136 [from benhoyt/pebble-v1.1.1](a0e0041)
#17221 [from jameinel/2.9-cla-workflow](58bc12d)
#17283 [from Aflynn50/fix-terraform-ci-2.9](cfad18e)
#17356 [from jack-w-shaw/use_base_in_bootstrap_config](aeec03c)
#17313 [from cderici/gce-remove-unused-region](ec7d269)
#17328 [from jack-w-shaw/Remove_LegacyKubernetesSeries](51a0f74)
#17331 [from jack-w-shaw/Replace_BootstrapSeries_wi…](439fd0a)
#17340 [from ycliuhw/fix/lp-2064772](322312b)
#17353 [from cderici/fix-controllercharm-prometheus…](a5c211d)
#17365 [from wallyworld/fix-secret-watcher](804e5b0)
#17309 [from babakks/css-8360/apply-client-in-simpl…](62599ce)
#17370 [from cderici/fix-controllercharm-prometheus…](48d82f2)
#17366 [from hmlanigan/panic-nil-pointer](57070f7)
#17380 [from jack-w-shaw/bump_os_patch](78004ae)
#17382 [from hmlanigan/not-equal](ad87b5a)
#17388 [from jack-w-shaw/fix_broken_test](1ff63ec)
#17400 [from jack-w-shaw/remove_used_code](5be5c43)
#17327 [from manadart/3.4-lxd-vm-in-machine](c95ac79)
#17415 [from hpidcock/fix-non-rootless](ecabfa8)
#17425 [from tmihoc/JUJU-6065_add_credential_outdat…](1a89726)
#17427 [from wallyworld/delete-old-acceptancetests](7f169f3)
```
# Conflicts:
# acceptancetests/assess
# acceptancetests/deploy_stack.py
# acceptancetests/jujupy/k8s_provider/aks.py
# acceptancetests/jujupy/k8s_provider/eks.py
# apiserver/facades/agent/secretsmanager/secrets.go
# apiserver/facades/agent/secretsmanager/secrets_test.go
# apiserver/facades/client/application/deployrepository.go
# apiserver/facades/client/application/deployrepository_test.go
# apiserver/watcher.go
# caas/kubernetes/provider/application/application_test.go
# caas/kubernetes/provider/k8s_test.go
# cmd/juju/commands/bootstrap_test.go
# container/kvm/kvm.go
# core/base/base.go
# environs/bootstrap.go
# environs/bootstrap/bootstrap_test.go
# go.mod
# go.sum
# internal/bundle/changes/handlers.go
# internal/provider/common/bootstrap_test.go
# juju/testing/conn.go
# testing/factory/factory.go
# tests/suites/static_analysis/copyright.sh
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants