Add a new slave to a running pool and match the patch level
Environment
- An existing XCP-ng pool with a running master.
- A new slave host to be added, with SSH access from the new slave to the pool master.
Procedure
-
On the new slave, list the packages installed on the master and locally, replacing
X.X.X.Xwith the IP of the existing pool's master:# MASTER_IP=X.X.X.X # ssh root@"$MASTER_IP" rpm -qa | sort > master-rpms.txt # rpm -qa | sort > local-rpms.txt
-
Keep the package versions present on the master but not on this host:
# comm -23 master-rpms.txt local-rpms.txt | tee updates.txt
-
Check the contents of the three files, especially
updates.txt. -
Install exactly those versions:
# yum install $(cat updates.txt)
Use
yum install, notyum update. Given exact package versions,yum installupdates the installed packages and installs the missing ones at the master's versions. An older version of this procedure usedyum update, which did not pin the versions of new packages pulled in as dependencies.
Verification
Run the comparison again. Once the host matches the master, comm -23 master-rpms.txt local-rpms.txt prints nothing when local-rpms.txt is
regenerated:
# rpm -qa | sort > local-rpms.txt # comm -23 master-rpms.txt local-rpms.txt
Was this page helpful?