/srv/irclogs.ubuntu.com/2024/06/04/#cloud-init.txt

=== cpaelzer_ is now known as cpaelzer
SDes91Hi all. I have a rather weird thing happening. I have mentioned explicitly `python3-pip` in the packages list and then the `ansible` section according to the examples. But the error states that `pip` is not installed. Image is Ubuntu 24.04 LTS cloud-init 24.1.614:36
SDes91also when I create a couple of users the user IDs seems to be okay but the Group IDs are always one ahead value ahead of the user id. e.g. userid 1000 but groupid 100114:42
minimalSDes91: why would the UIDs and GIDs necessarily be in sync?15:12
minimaltypically the next available UID and GID are chosen15:13
minimalas for the ansible issue, did you check /var/log/cloud-init.log to see what is happening?15:16
SDes91minimal it explicitly mentioned that the ansible module failed. upon inspecting the logs in `results.json` it mentions that pip is not installed15:20
minimaldid the logs show whether cc_oackage_update_upgrade_install actually installed python3-pip?15:21
minimalby "I have mentioned explicitly `python3-pip` in the packages list" you mean you listed python3-pip in user-data: "packages:\n  - python3-pip\n" ?15:22
SDes91yes.15:24
SDes91I am checking the logs again to check the cc_package_update_upgrade_install logs.15:25
minimalthen that means you are using the *distro* packaging of pip and therefore for your cc_ansible configuration you should be specifying "install_method: distro"15:26
SDes91I really have a weird thing going on here. I luckily had a backup `user-data` file that works like a charm when installing the packages. Ironically I have only ever added a few more packages to the `packages` list and suddenly it skips it. I might have misconfigured something.15:31
minimalSDes91: does your user-data specify "install_method: distro" ?15:32
minimalsounds like whatever additional entries you added to the "packages:" list might have created some sort of package conflict. I'd expect that to result in some form of output in cloud-init.log15:33
SDes91yes I am able to log into the qcow2 image and I have the logs on the machine. Strangely I cannot find any logs for `cc_package_...` and it somehow skips or overrides the `packages_upgrade: true` set with another subprocess.15:35
SDes91I guess I will have to check the packages as you mentioned. If I find something I will post it here on the chat. But I fear it might be some apt package that I was previously using for 20.04 LTS and may have to be verified for 24.04 LTS. The packages I added in posterity are: `bc`, `bison`, `flex`, `gcc`, `jq`, `libelf-dev`, `make`, `mc`,15:40
SDes91`pciutils`, `unzip`, `zip` which are pretty standard.15:40
minimalSDes91: search for "Running module package_update_upgrade_install"15:40
SDes91very strange. upon `cat cloud-init.log | grep -i "running module"` I do not find the module execution at all in the log.15:42
SDes91there are other modules that ran. not the package_update_upgrade_install15:43
minimalthen check for "Skipping modules" ?15:44
SDes91this was also rather visible on my end. I was building the image using QEMU and Packer. Previously I could see the logs for `while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for Cloud-Init...'; sleep 1; done` in packer that cloud-init was wrapping up correctly. Upon the change it literally skipped this provisioning step.15:45
SDes91skipping modules does not mention anything about `package`. It skips all other modules which I have not configured. But no explicit mention of packages.15:48
SDes91the image I made with the previous configuration has been built successfully and in that image I can see the logs for `package_update_upgrade_install` very clearly.15:50
minimalthen is "package_update_upgrade_install" missing from the "cloud_final_modules" list in the /etc/cloud/cloud.cfg file and /etc/cloud/cloud.cfg.d/* files?15:50
SDes91it exists in the `cloud_final_modules` in cloud.cfg but there is no explicit file under `/etc/cloud/cloud.cfg.d/` directory.15:55
minimalthen it should be run and appear in cloud-init.log15:56
minimalare you using Ubuntu or Ubuntu Server?15:56
SDes91albeit in the `99-installer.cfg` the the raw userdata configuration has the list of `packages` in it and I can see `python3-pip`15:56
blackboxswminimal: > doesn't cc_growpart only grow the rootfs partition?          ....  By default is down attempt only to resize devices: ["/"] but in user-data additional device paths can be provided https://cloudinit.readthedocs.io/en/latest/reference/modules.html#growpart15:56
SDes91Ubuntu Live Server AMD64 image.15:56
minimalSDes91: isn't Ubuntu Server using Subiquity (which makes use of cloud-init behind the scenes) ?15:57
minimalblackboxsw: the growpart tool (from cloud-utils) can only grow (extend) the last partition on a device...15:57
SDes91yes. I use autoinstall which as the subpart of cloud-init configuration in it.15:57
minimalSDes91: so are you running subiquity or cloud-init?15:58
blackboxswSDes91: .. per using your while loop on presence of /var/lib/cloud/instance/boot-finished, why wouldn't you use the blocking `cloud-init status --wait` command?15:58
minimalsounds like this is a Subiquity issues rather than a "native" cloud-init issue15:59
SDes91umm... if i understand if the `user-data` starts with `autoinstall` it might be subiquity?15:59
blackboxswSDes91: maybe not wanting to invoke python from within a shell script...15:59
SDes91sorry you are correct this might be a subiquity problem.16:00
minimalyes, "autoinstall" is Subiquity16:00
blackboxswSDes91: yes any cloud-config user-data beginning with autoinstall "has to" be subiquity as cloud-init doesn't really do anything with that key besides check that it contains a version: 1 value16:00
SDes91blackboxsw I will take that into consideration for using `status --wait`16:00
blackboxsw+1 on cloud-init status --wait. Also subiquity invokes that too https://github.com/canonical/subiquity/blob/main/subiquity/cloudinit.py#L11716:01
SDes91appreciate your help here. Thanks again. i have reverted back to my original config and I will try to see if I can reproduce it.16:02
minimalblackboxsw: To clarify, from the c-i cc_growpart docs: "Note that this only works if the partition to be resized is the last one on a disk with classic partitioning scheme (MBR, BSD, GPT). LVM, Btrfs and ZFS have no such restrictions."16:02
minimalblackboxsw: so yeah you're right in the context of ZFS16:02
minimalBTW the reference to "LVM" should probably be removed as cc_growpart does not *currently* support LVM, it's on my list once I fix LUKS handling16:03
blackboxswSDes91: so also your ansible config issue.  I thought you didn't have to provide a separate packages: [python3-pip] when providing config with `ansible: {install_method: pip}` I thought cloud-init just did the right thing and installed if it was unable to import pip. https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cc_ansible.py#L99-L10116:04
=== kuraudo1 is now known as kuraudo

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!