canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.39k stars 931 forks source link

Elaborate difference between `lxc launch` and `lxc init` in help text #13243

Closed sed-i closed 8 months ago

sed-i commented 8 months ago

The description on launch and init docs is very similar:

  lxc init ubuntu:22.04 u1 < config.yaml
      Create the instance with configuration from config.yaml

vs

  lxc launch ubuntu:22.04 u1 < config.yaml
      Create and start a container with configuration from config.yaml

and in the cloud-init doc it says to use init rather than launch.

https://github.com/canonical/lxd/blob/7f0ad17f620f065845b8eda762c692948c22c0b9/doc/cloud-init.md?plain=1#L70

Coming from multipass blueprints, I find this a bit confusing.

I'm also curious about the effect of --preseed in lxd init --preseed and how it compares to the above.

holmanb commented 8 months ago

The description on launch and init docs is very similar:

The diff between those two descriptions, 'and start' is key.

The launch command is basically shorthand for lxc init ubuntu:22.04 u1 < config.yaml && lxc start u1.

i.e., if you don't want the instance started, just use lxc init, otherwise use lxc launch

sed-i commented 8 months ago

Thanks @holmanb! Another diff is instance vs. container. I imagine it should be instance in both cases? I guess instance is "container or vm".

sed-i commented 8 months ago

Btw, what does --preseed add to this?

holmanb commented 8 months ago

I imagine it should be instance in both cases?

I'm guessing that's just accidentally inconsistent.

Btw, what does --preseed add to this?

I think the docs explain it pretty well - it's intended for providing an instance configuration non-interactively.

sed-i commented 8 months ago

Got it! So, iiuc,

Is there a schema doc for the lxd daemon config?

tomponline commented 8 months ago

Yes we should update lxc launch and lxc init help text to be consistent, with the only difference being that launch starts the instance after creating it.

tomponline commented 8 months ago

@sed-i for future reference support questions are best asked over on the forums

https://discourse.ubuntu.com/c/lxd/126

Thanks!