...
Warning |
---|
In order to perform this migration, you need to request Openstack Application Credentials EWC - How to request Openstack Application Credentials |
User procedure
- ssh to a machine and login with openstack client EWC - OpenStack Command-Line client
- add port 636 TCP.749 TCP,464 UDP to ldap security group
Code Block ADD OPENSTACK COMMAND
openstack security group rule create ldap --protocol tcp --ingress --dst-port 636 --remote-ip 0.0.0.0/0 --ethertype IPv4 openstack security group rule create ldap --protocol tcp --ingress --dst-port 749 --remote-ip 0.0.0.0/0 --ethertype IPv4 openstack security group rule create ldap --protocol udp --ingress --dst-port 464 --remote-ip 0.0.0.0/0 --ethertype IPv4
- SSH into the OLD LDAP machine (your current one) and create DNS reverse zone (NAME_FROM_IP = LDAP IP or using IP range ) Create DNS reverse zone into LDAP machine (if missing)
ipa dnszone-add --name-from-ip=10.0.0.63 or using IP range (https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/linux_domain_identity_authentication_and_policy_guide/managing-reverse-dns-zones)Code Block Code Block ipa dnszone-add --name-from-ip=NAME_FROM_IP
- Backup existing ldap VM using the following documentation: EWC - How to create and restore backups from VMs
- If your LDAP is rocky 8 based jump to step 9., if it is centos7 continue normally.
- Create LDAP replica instance type to move from centos7 to rocky 8 (see MigratefromCentos7toRocky8);
- run workflow to switch Switch IP interfaces between LDAP LDAPs (see RunworkflowtoswitchIPinterfacesbetweenLDAP);
- Check everything is fine (see Tests);
- Create LDAP replica instance type to move from centos7 rocky 8 to rocky 8 9 (see MigratefromRocky8toRocky9)
- run workflow to switch Switch IP interfaces between LDAP LDAPs (see RunworkflowtoswitchIPinterfacesbetweenLDAP);
- Check everything is fine (see Tests);
- Remove old LDAPs machines to free resources (from Morpheus)
Migrate from Centos7 to Rocky 8
Creating a new LDAP to migrate to
- From Morpheus, deploy a new machine with
- image: rocky 8
- new security group: ldap security group
- plan: eo1.medium
- become sudo
- name: different from existing ldap machine
- SSH to the new machine and become root
- Stop stop and disable firewalld on the machine
Code Block systemctl stop firewalld && systemctl disable firewalld
- add old ldap IP and domain of the machine acting as LDAP in one line to /etc/hosts on this machine
Code Block [test234@test-podman2 ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> 10.0.0.133 test-podman2.eumetsat.sandbox.ewc 10.0.0.63 <OLD LDAP complete domain (e.g. ldap.eumetsat.sandbox.ewc)> <!-- END ANSIBLE MANAGED BLOCK -->
- Install dependencies
- for rocky 8:
Code Block sudo yum -y update
Code Block sudo yum module reset idm:DL1
Code Block sudo yum module enable idm:DL1
Code Block sudo dnf install freeipa-server ipa-server-dns bind-dyndb-ldap -y
- for rocky 8:
- Run the following command to install the LDAP replica
Code Block ipa-replica-install --domain "eumetsat.sandbox.ewc" --principal sandbox-ldap-admin --admin-password hunter2 --server <OLD LDAP complete domain (e.g. ldap.eumetsat.sandbox.ewc)> --setup-ca --setup-dns --force-join --forwarder=8.8.8.8 --forwarder=1.1.1.1 --no-host-dns --unattended
(add --verbose for more logs) NOTE: go ahead with the default netbios and also put yes when asked about the ipa-sidgen task installation for users
Make the new ldap machine primary, running the following commands
Find the dns zone name
Code Block ipa dnszone-find
Make the ldap machine primary (SERVER IS the new LDAP machine complete domain (e.g. ldap-test-rocky.eumetsat.sandbox.ewc), while DNS_ZONE is the zone name from the previous command)
Code Block ipa dnszone-mod DNS_ZONE --name-server=SERVER
Migrate from Rocky 8 to Rocky 9
Creating a new LDAP to migrate to
- From Morpheus, deploy a new machine with
- image: rocky 9
- new security group: ldap security group
- plan: eo1.medium
- name: different from existing ldap machine
- become sudo
- SSH to the new machine and become root
- Stop stop and disable firewalld on the machine
Code Block systemctl stop firewalld && systemctl disable firewalld
- add old ldap IP and domain of the machine acting as LDAP in one line to /etc/hosts on this machine
Code Block [test234@test-podman2 ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> 10.0.0.133 test-podman2.eumetsat.sandbox.ewc 10.0.0.63 <OLD LDAP complete domain (e.g. ldap.eumetsat.sandbox.ewc)> <!-- END ANSIBLE MANAGED BLOCK -->
- Install dependencies
- for rocky 9:
Code Block sudo dnf install ipa-server ipa-server-dns -y
- for rocky 9:
- Run the following command to install the LDAP replica
Code Block ipa-replica-install --domain "eumetsat.sandbox.ewc" --principal sandbox-ldap-admin --admin-password hunter2 --server <OLD LDAP complete domain (e.g. ldap.eumetsat.sandbox.ewc)> --setup-ca --setup-dns --force-join --forwarder=8.8.8.8 --forwarder=1.1.1.1 --no-host-dns --unattended
add --verbose for more logs
Make the new ldap machine primary, running the following commands
Find the dns zone name
Code Block ipa dnszone-
find
Make the ldap machine primary (SERVER is the new LDAP machine complete domain (e.g. ldap-test-rocky.eumetsat.sandbox.ewc)
- on the new ldap machine specify which ldap to be master (using command: ipa-csreplica-manage set-renewal-master)
DON'T DO IT, see next steps comment on why → create an A record for existing ldap domain to point to the new LDAP ipa dnsrecord-add eumetsat.sandbox.ewc. ldap --a-rec <NEW_LDAP_IP>
- Modify the DNS primary in Network (cannot be done by a user, unless we give permissions to modify networks) and wait some time (1 week? ) or do manual action on each machine to make the changes: (lease time ~5.20 hours)
- for Ubuntu a restart of the machine or the newotk systemctl restart networking or maybe after while you will get it (TBT)
- for Rocky 9 network manager has priority on resolve.conf
- for Rocky 8 happening in sandbox but not in mcat, one option either remove /etc/resolve.conf and dhclient or ??
- Change the secret/ldap_hostname to point to the new ipa host
sudo ipactl stop on the old LDAP machine (check if this step can be removed on another test run)
- ipa-replica-manage del ldap.eumetsat.sandbox.ewc --force delete the replica ldap
Run workflow to switch IP interfaces between LDAP
, while DNS_ZONE is the zone name from the previous command)
Code Block ipa dnszone-mod DNS_ZONE --name-server=SERVER
Switch IP interfaces between LDAP
- Using Openstack Application credentials (EWC - OpenStack Command-Line client), identify your OLD LDAP machine
Code Block openstack server list
- Detach the interface from the OLD LDAP machine (SERVER_NAME is the name of the VM from previous command, IP_ADDRESS is the private IP of the OLD LDAP VM, you listed with the previous command, SAVE IT in your notes and don't lose it!)
Code Block openstack server remove fixed ip SERVER_NAME IP_ADDRESS
- SSH In the NEW LDAP machine,
- Detach the interface from the old LDAP
- update the ip in the /etc/hosts and remove the old LDAP record
- Delete old LDAP DNS records
- Update the IP of the NEW LDAP machine in the /etc/hosts (IP_ADDRESS ) with the IP of the OLD LDAP machine ( The one you saved before in your notes!)
Code Block [murdaca@ipa ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> IP_ADDRESS ipa.batchpro.ewc <!-- END ANSIBLE MANAGED BLOCK -->
- Delete OLD LDAP machine DNS records (SERVER is the old LDAP machine complete domain (e.g. ldap-test-rocky.eumetsat.sandbox.ewc)
Code Block ipa-replica-manage del
SERVER --force
Find the dns zone name
Code Block ipa dnszone-find
- Replace the
- NEW LDAP machine IP with the IP of the interface of
- the OLD LDAP machine (HOSTED_ZONE is the output name from the previous command, IP_ADDRESS=The one you saved before in your notes!, HOSTNAME is the new LDAP machine complete domain (e.g. ldap-test-rocky.eumetsat.sandbox.ewc)
Code Block ipa dnsrecord-mod
HOSTED_ZONE ipa-ca --a-rec
IP_ADDRESS ipa dnsrecord-mod
HOSTED_
ZONE
HOSTNAME
--a-rec
IP_ADDRESS
- Update the IP of the NEW LDAP machine in the /etc/hosts (IP_ADDRESS ) with the IP of the OLD LDAP machine ( The one you saved before in your notes!)
- Switch off the new LDAP
- Remove interface
- NEW LDAP machine (SERVER_NAME is the name of the VM, you can find it with openstack server list )
Code Block openstack server stop SERVER_NAME
- Detach the interface from the NEW LDAP machine (SERVER_NAME is the name of the VM, IP_ADDRESS is the private IP of the NEW LDAP VM )
Code Block openstack server remove fixed ip SERVER_NAME IP_ADDRESS
- Add interface to the NEW LDAP machine Add interface with the IP of the old LDAP machine (SERVER_NAME is the name of the VM, IP_ADDRESS=The one you saved before in your notes!
Code Block openstack server add fixed ip SERVER_NAME IP_ADDRESS
- Add security groups to new LDAP
- Restart new NEW LDAP machine (SERVER_NAME is the name of the VM)
Code Block openstack server restart SERVER_NAME
- Go to Morpheus and change Change the value in Cypher: Change the Delete the secret/ldap_hostname and recreate secret/ldap_hostname it to point to the new ipa host (e.g. ldap.eumetsat.sandbox.ewc)
Tests
- login with DNS from ssh-proxy
- Run sudo ipactl status → verify the services are all up and running
- Deploy a new machine and enroll
Post Installation (optional in case of similar errors)
After the IPA Migration, especially from Centos7 to Rocky9, there might be still some possible errors, like the one below:
...