Is it possible to undo init? (and feedback on docs)

Hi,

This is both a question and feedback on the beginner docs; I hope that’s ok.

I asked some of this on irc, but there’s not many active people there, at least during times I’m there.

As a new user, I made a mistake during ‘incus admin init’ (due to misunderstanding the prompts).

I’m sure what I did (choosing wrong options for the default storage) can be fixed, but that is rather more advanced than where I’m up to. Is it possible to undo the init so I can start again? I couldn’t find any advice on that, so I purged the debian packages and reinstalled them, which seems like overkill.

If there are better ways to do it (deleting one or more files?), could they be added to the beginner documentation?

More tips on what the options and prompts mean would be handy too - eg what LVM setup I should have before I start (and what I shouldn’t), what the IP address prompts relate to (external? internal? routed? NATted?)

Cheers,

Richard

incus admin init is just a convenient way to do a bunch of incus config, incus storage, incus network and incus profile calls.

So you can use those commands to modify what you want to see changed.

I’m starting to understand that better now, thanks :slight_smile:

It was less clear when I was reading the first steps docs …

Other things I’ve learned:

  • Start experimenting without any other firewall rules; integrating them requires some thought. For me, it didn’t even allocate an IPv4 address to the container interface.
  • Don’t expect to give incus an LVM volume group; give it a raw partition (or RAID device, or other block device) on which it will set up a new pv from scratch.

Maybe this is just me being odd, but these are things that would have been useful to know earlier.

Thanks,

Richard

No, you certainly can give incus an existing LVM volume group if you want.

# If you DON'T want incus to use a thinpool
incus storage create vg0 lvm source="vg0" \
  lvm.vg.force_reuse=true lvm.use_thinpool=false

# If you DO want incus to use a thinpool, which uses all available space in the VG
incus storage create vg0 lvm source="vg0" \
  lvm.vg.force_reuse=true lvm.thinpool_name=IncusThinPool

# If you DO want incus to use a thinpool, which uses less than all available space in the VG
incus storage create vg0 lvm source="vg0" \
   lvm.vg.force_reuse=true lvm.thinpool_name=IncusThinPool size=100GiB

(where “source” gives the existing volume group name)

Here is the code for the interactive incus admin init,

For example, the functions askStorage and askStoragePool deal with getting the information on the choice for the storage pool.

I believe that you are asking, if you have been through to the storage pool questions, but you got stuck with the networking, did the storage pool get created?

And, what’s the equivalent in Incus CLI commands for what you get with the incus admin init --interactive wizard?

Thanks, that’s good to know. I don’t think it’s an available option from incus admin init, though.

I think what I was asking is, having run init and chosen the wrong options (because I didn’t understand the questions, or other reasons), how do I go back and choose different options? I don’t think it’s possible to delete the storage, for example - edit it, maybe, but what does that mean? Move my filesystems to somewhere else?

Sometimes, having learned more, it’s nice to be able to throw it all away and start again. But that option doesn’t seem to be available, or at least it’s not obvious.

Just changing the volume storage is possible by creating a new volume storage at a new location, transfer all current instances to the new location, update all profiles and remove the old one. Of course for a brand new installation this are many steps, so may be the next paragraph might be the better option.

If during incus admin init default settings have be chosen you can perform the following:

  • stop all Incus services
  • remove /var/lib/incus (default location)
  • start all services
  • rerun incus admin init with different settings

It works as long as default settings have been selected and dir was selected as storage. In case other storage types than dir are used it requires to delete the storage selection manually.

As @simos and @stgraber mentioned all settings can be changed by using the Incus CLI. ìncus admin init doesn’t do anything else behind the scenes. The CLI will be anyway your best friend in performing any kind of update or review current configurations. Yes, there are UI’s available but they don’t fully support all latest options or tricky configurations.