I have a problem with netplan.
when i declare a profile with a fixed ip it works.
But it is impossible to run a package installation as an ssh server for exemple or htop.
the netplan works but it takes a long time in the logs I have this:
/var/log/cloud-init-output.log
Reading package lists...
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-backports/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
python3 is already the newest version (3.8.2-0ubuntu2).
Suggested packages:
lsof strace
The following NEW packages will be installed:
htop
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 76.1 kB of archives.
After this operation, 220 kB of additional disk space will be used.
Err:1 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 htop arm64 2.2.0-2build1
Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/h/htop/htop_2.2.0-2build1_arm64.deb Temporary failure resolving 'ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:final' at Mon, 07 Mar 2022 10:08:59 +0000. Up 131.24 seconds.
2022-03-07 10:09:03,955 - util.py[WARNING]: Failed to install packages: ['python3', 'htop']
2022-03-07 10:09:03,960 - cc_package_update_upgrade_install.py[WARNING]: 1 failed with exceptions, re-raising the last one
2022-03-07 10:09:03,962 - util.py[WARNING]: Running module package-update-upgrade-install (<module 'cloudinit.config.cc_package_update_upgrade_install' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_package_update_upgrade_install.py'>) failed
Hi tintin,
You can create a simple yaml file like that, which is called net.yaml. Then you can launch container as, lxc launch images:ubuntu/20.04/cloud testcloud -c user.network-config="$(cat net.yaml)"
Beside this you can specify network and user data seperately.
Regards.
Hi tintin,
Please change address, gateway information with your needs, your network information can be different. That net.yaml file is just an example.
Regards.