bsdci / libioc

A Python library to manage jails with ioc{age,ell}
https://bsd.ci/libioc
Other
38 stars 11 forks source link

Host ID #634

Closed gronke closed 5 years ago

gronke commented 5 years ago

At the current time there is no check implemented that validates a jail's hostid. Please leave a comment if you find a use-case for that, so that the feature can be added to ioc.

igalic commented 5 years ago

what is host-id?

ole-db commented 5 years ago

The hostid is the ID of the Server (/etc/hostid) the jail should run on. The Jail should not start on mismatch.

The feature comes originally from the old iocage. I don't know what it was used for, I never used this old iocage. But know I am using it for multi host setup. All Jails are synced between different hosts. The hostid decides where it should run.

Please see: https://github.com/iocage/iocage/issues/529 https://github.com/iocage/iocage/pull/538

gronke commented 5 years ago

Thanks for the explaination, @ole-db. Is that some feature that is really needed by anybody? In case I'd mirror two servers mutually, I'd probably just use the multi-pool feature to keep each hosts jails in a separate dataset that is not enabled on the mirroring host unless needed.

I get the point where locking jails for a specific host makes sense, but the hostid stored in the jails config file seems to be the wrong place to achieve the goal. My wish is to unwrap the idea behind the hostid feature and re-think the method before blindly implementing the feature.

ole-db commented 5 years ago

Is that some feature that is really needed by anybody?

yes, me ;-)

In case I'd mirror two servers mutually, I'd probably just use the multi-pool feature to keep each hosts jails in a separate dataset that is not enabled on the mirroring host unless needed.

Please explain this a little bit more.

I am not syncing on two hosts. I am syncing 5 hosts with about 30 jails. For me this is an easy way for Backup scheduling and mirgration between this hosts.

Yes, maybe there is a more elegant way.

gronke commented 5 years ago

yes, me ;-)

Okay, one is enough. You find the feature implemented in #653 and the enhancements to the CLI in https://github.com/bsdci/ioc/pull/20

Installation from the CLI works as follows (make install will update the submodule accordingly):

cd /usr/local/src/ioc/
git checkout feature/hostid-check
make install