I have two virtualmin instances on two physical nodes. One is running as primary where we create and manage all the accounts/virtual hosts. The second server I'd like to sync the configuration files from the first one but without the home dir. For this I have an external SAN connected via NFS to both servers. I've bought a cloudmin license because it's says that can replicate master node to number of other hosts. However I stumbled upon a very annoying issue - when doing replication of the accounts, the cloudmin doesn't preserve user id's. Which means on the second server all the accounts are created with different UID's and thus cannot access the shared storage or in my case - started to change permission on the storage and thus making the first server unable to access it's content anymore. I did some reasearch looking for a way to have a centralized auth system, like LDAP, but it seems the LDAP support of virtualmin has been discontinued. So here is my question(s):
- Is it possible for Cloudmin virtualmin replication to preserve UID?
- If it's not possible then would it be possible to integrate LDAP as auth storage with Virtualmin?
- If non of the above are possible, then would it be possible to sync some files/directories in order to have a mirror copy of the primary server configuration? For sure passwd and shadow files for account preservation, but which files/dirs should be synced when it comes to the virtualmin/webmin itself?
Does anyone ever made such a setup - two or more virtualmin instances serving the same content with load balancer in front?
Best regards, Iliyan Vutov
Submitted by JamieCameron on Wed, 01/21/2015 - 21:41 Comment #1
Cloudmin replication is built on top of Virtualmin's backup and restore process, which should already preserve UIDs on restore - unless the UID for the domain being re-created is already in use by another user?
Submitted by vutoff on Thu, 01/22/2015 - 02:52 Comment #2
Thanks for your answer. However it seems that's not the case with my systems. I have fully working instance of Virtualmin installed on one server. The second server is a fresh installation of Debian with fresh installation of Virtualmin. So you can imaging there are no created users yet on the second server besides the system users. Now when I start the replication, which as you said is a backup/restore process, the UID's on the second system seem to be picked at random. For example
First server UID: user1:x:2788:1218:user1:/home/user1:/bin/sh Second server UID: user1:x:1196:1057:user1:/home/user1:/bin/sh
Submitted by JamieCameron on Thu, 01/22/2015 - 20:50 Comment #3
So, it turns out I was wrong - Virtualmin will be default re-allocate UIDs when restoring as part of the sync process.
A quick work-around until this behavior is changed is to edit the file
/usr/share/webmin/virtual-server/restore-domain.plon the destination system, and remove the line
$reuid = 1;