pylxd icon indicating copy to clipboard operation
pylxd copied to clipboard

support lxd clustering

Open bit opened this issue 6 years ago • 7 comments

i.e. no way to specify the target host in container.create. in the rest api this is done by adding ?target=target_id

api extension are document at: https://github.com/lxc/lxd/blob/master/doc/api-extensions.md#clustering

bit avatar Mar 29 '18 10:03 bit

Yes, this is a 3.x feature added via the 'clustering' API extension.

The 'clustering' extension affects a number of areas: containers, storage-pools, and networks.

(Note for implementation: remember to check that the 'clustering' API extension exists as a check as to whether to accept this parameter.)

ajkavanagh avatar Apr 01 '18 07:04 ajkavanagh

Any timeline on when clustering will be supported?

ghoshanjega avatar Oct 02 '18 09:10 ghoshanjega

I also required the clustering features and therefore built the minimum as PR #331 As mentioned, it might fail if the extension is not existent. (To be checked)

felix-engelmann avatar Oct 08 '18 21:10 felix-engelmann

@ghoshanjega there is now an api endpoint for getting cluster and member info. What else would you need? @bit there is a target parameter for containers now.

felix-engelmann avatar Dec 12 '18 20:12 felix-engelmann

Hi guys,

I have started using pylxd very recently and the first thing I noticed missing in the cluster supports is creation of networks. Where in the standalone LXD it's enough to do

lxc network create ...

in a clustered environment the process is a bit more complex

lxc network create ... --target node1
...
lxc network create ... --target nodeN
lxc network create ...

Any idea if we could get this supported?

mkowalski avatar Feb 14 '20 12:02 mkowalski

The addition of a target argument for containers was very lightweight. To support networks in cluster mode, I need the following information:

  • @stgraber does the lxd api support an undocumented ?target= query parameter for networks like the instance endpoint?
  • @ajkavanagh what is the architecture decision on the abstraction of this library: Make one complex call which manages the network creation on all nodes or leave it up to the user to perform the necessary calls and add a simple target argument?

felix-engelmann avatar Feb 14 '20 14:02 felix-engelmann

@felix-engelmann ?target for networks and storage-pools is supported and lets you create/set the host-specific config ahead of adding a network or storage-pool globally.

That's why you usually need to create a network like:

lxc network create blahbr0 --target a
lxc network create blahbr0 --target b
lxc network create blahbr0 --target c
lxc network create blahbr0

The targeted ones can set keys that are only relevant to a particular member, in the network case, that's pretty much just bridge.external_interfaces.

stgraber avatar Feb 14 '20 14:02 stgraber