Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention lxd-p2c in getting started #340

Closed
danboid opened this issue Jan 8, 2019 · 3 comments
Closed

Mention lxd-p2c in getting started #340

danboid opened this issue Jan 8, 2019 · 3 comments
Labels
Documentation Documentation needs updating Easy Good for new contributors

Comments

@danboid
Copy link

danboid commented Jan 8, 2019

Having spent a few weeks getting to grips with the basics of lxd, I have a couple of suggested additions /improvements that could be made to the lxd getting started guide ( https://linuxcontainers.org/lxd/getting-started-cli/ ) that would've saved me days or weeks of troubleshooting, searching and experimentation.

The first is in respect to lxd networking, specifically the bridge configuration. After days spent reading the lxd forums and trying many configs, I finally worked out why I couldn't get networking to work in any of my containers. It turns out that you have to explicitly disable IPv6 in the lxdbr0 configuration for both NAT and addressing or else it breaks any IPv4 only hosts networking. This may seem obvious but it really isn't and I didn't see this suggested in any of the related lxd blog or forum posts I found and nor was this suggested to me by anyone in the lxcontainers IRC channel.

I would recommend either modifying/extending the Initial configuration section of the getting started guide to cover this or adding a new networking section immediately after that section of the guide that would read something like this:


LXD networking

In order for your lxd containers to get network access, a bridged network device has to be created on your lxd host, this device (usually called lxdbr0) has to be attached to an lxd profile (usually 'default') and this profile needs to be added to your container(s) so that they can access the network. Running lxd init and answering yes when asked about creating a new local network bridge will do nearly all of the required configuration to enable networking for lxd but your IPv4 hosts won't work unless you specifically tell lxd to disable IPv6 NAT and addressing in your bridge configuration.

To disable IPv6, presuming you used lxd init to create a bridged interface called lxdbr0, you would run the command:

# lxc network edit lxdbr0

Then edit it so that the bridge configuration looks something like this:

config:
  ipv4.address: 146.87.119.1/24
  ipv4.nat: "true"
  ipv6.address: none
  ipv6.nat: "false"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/containers/test
managed: true
status: Created
locations:
- none

There is usually no need to restart any containers after changing your lxd host network settings, the changes are applied instantly.


The other addition I would suggest adding to the getting started guide is that it makes no mention of lxd-p2c to ease the process of creating containers from existing servers. I posted a short guide on the usage of lxd-p2c on the forums here https://discuss.linuxcontainers.org/t/howto-use-lxd-p2c/3574/3

Thanks

@stgraber stgraber transferred this issue from canonical/lxd Jan 8, 2019
@stgraber
Copy link
Member

stgraber commented Jan 8, 2019

Moving over to the right repo.

I don't understand your IPv6 point though. There is no problem with having a container get an IPv6 address when the host doesn't have IPv6, this simply leads to an IPv6 connection failure (no route to host) and immediately falls back to IPv4.

That's how pretty much all our users have it setup (since that's the default) and based on statistics, only 25% or so actually have public IPv6 routes available.

This suggests that something else was wrong on your system if that ended up preventing network connections.

@danboid
Copy link
Author

danboid commented Jan 9, 2019

Yes you're right about the networking. I've removed the IP6 lines from my bridge config and its still working so it I must've got the subnet, address or something else wrong earlier.

My suggestion about adding a mention of lxd-p2c and linking to /including some documentation for it still stands, newcomers may think they have to do conversions fully manually or start afresh otherwise.

@stgraber stgraber changed the title Suggested additions to the lxd getting started guide Mention lxd-p2c in getting started Jan 9, 2019
@stgraber stgraber added Documentation Documentation needs updating Easy Good for new contributors labels Apr 14, 2020
@toby63 toby63 mentioned this issue Jun 25, 2020
19 tasks
@toby63
Copy link
Contributor

toby63 commented Jun 25, 2020

Added this as a point to the todo list of #413 .

Maybe we could close this then, but it's up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating Easy Good for new contributors
Development

No branches or pull requests

3 participants