Public bug reported: function _net_setup_link in cloudinit/net/netplan.py will get all device list and execute "udevadm test-builtin net_setup_link xx" cmd, This is a cycle without any filtering, but some types of devices may not seem necessary to perform this operation, For example, Veth devices(I don't think it's necessary for all virtual network devices to perform this operation except for those enabled by real drivers, I don't know much about kernel rename devices, please point out my mistake),So I think at least some device types should be ignored, such as lo, veth, and other devices that use the keep strategy,
a test steps: root@iZbp12x7bx8gp999t1zp62Z:~# cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.1 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.1 LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo root@iZbp12x7bx8gp999t1zp62Z:~# cloud-init --version /usr/bin/cloud-init 24.4-0ubuntu1~24.04.2 start test: add many veth in instance ``` for nu in $(seq 20 2000);do ip link add "veth${nu}" type veth peer name "vethoer${nu}" done and execute `cloudinit init --local` command execution is slow, The log shows that there are many udevadm operations. there is also a similar operation in netplan, and a bug was raised. At least netplan should return directly when Predictable interface names disabled, like cloudinit netplan bug: https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2098831 ``` ** Affects: cloud-init (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2098843 Title: cloudinit local execute will slow when there are many veth devices To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2098843/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
