Regenerating cloud-init in incus

I made a mistake in cloud-init configuration for an incus guest.

Now I can see that the file holding the wrong configuration is

/var/lib/cloud/instances/datura/obj.pkl

– but it’s a binary file.

How can I edit this file to fix my guest?

Hi,
I suppose you can reach from the container config.
incus config edit <container_name>
Regards.

Unfortunately - not. I edited the config for that guest on host level but it seems that cloud-init inside the guest ignores my changes. The guest is debian sid/cloud by the way.

Have you ever checked the cloud-init package in the quest (debian/sid)? And services as well.
And indeed you can check the status on the cloud-init log on the quest.
Regards.

What do you mean by checking please? :slight_smile:

If you are using vm-name/cloud containers this means that cloud-XXX packages are installed on the quest side, so you can control the log on the container side with the related error.
Regards.

I know that the faulty line is inside the file:

/var/lib/cloud/instances/datura/obj.pkl

on the guest. I do not know how to edit that file though :slight_smile:

You should be able to run cloud-init clean and then reboot the instance to have cloud-init perform a new clean run.

3 Likes

It works indeed, thanks! The only disadvantage is that it has generated new guest SSH keys as well, but it’s a minor issue.