canonical / pylxd

Python module for LXD
https://pylxd.readthedocs.io/en/latest/
Apache License 2.0
259 stars 135 forks source link

support lxd clustering #292

Open bit opened 6 years ago

bit commented 6 years ago

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

ajkavanagh commented 6 years ago

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.)

ghoshanjega commented 6 years ago

Any timeline on when clustering will be supported?

felix-engelmann commented 6 years ago

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 commented 5 years ago

@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.

mkowalski commented 4 years ago

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?

felix-engelmann commented 4 years ago

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

stgraber commented 4 years ago

@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.