Table of Contents |
---|
Warning |
---|
Pre-requisites: In order to perform this migration, you need to request Openstack Application Credentials
|
User procedure
- pre requisite (openstack)
- deploy the machine from morpheus and then run first workflow (all Morpheus )
- switch IP interface (openstack + ssh + Morpheus )
- tests (Morpheus + ssh)
- deploy second machine from morpheus and then run first workflow (all Morpheus )
- switch IP interface (openstack + ssh + Morpheus )
- tests (Morpheus + ssh)
- SSH into the OLD LDAP machine (your current one) and create DNS reverse zone (NAME_FROM_IP = LDAP IP 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 ipa dnszone-add --name-from-ip=NAME_FROM_IP
- ssh to the VM with Openstack Client and run the following commands (see ssh to a machine in your tenancy and login with Openstack client EWC - OpenStack Command-Line client for more details):
- List ldap security group rule
Code Block openstack security group rule list ldap
- add port 636 TCP.749 TCP,464 UDP to ldap security group if they are missing
Code Block 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
ipa dnszone-add --name-from-ip=NAME_FROM_IPCode Block - Backup existing LDAP machine using the following documentation: EWC - How to create and restore backups from VMs
- List ldap security group rule
- If your LDAP is rocky 8 based, jump to step 9., if it is centos7 based continue the procedure normally.
- Create LDAP replica instance type to move from centos7 to rocky 8 (see MigratefromCentos7toRocky8);
- Switch IP interfaces between LDAPs (see RunworkflowtoswitchIPinterfacesbetweenLDAP);
- Check everything is fine (see Tests);
- Create LDAP replica instance type to move from rocky 8 to rocky 9 (see MigratefromRocky8toRocky9)
- Switch IP interfaces between 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
- security group: ldap security group
- plan: eo1.medium
- name: different from existing ldap machine
- SSH to the new machine and become root
- 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 (OLD_LDAP_IP is the private IP of your current LDAP and OLD_LDAP_DOMAIN is the domain from your current LDAP (e.g. ldap.eumetsat.sandbox.ewc) )
Code Block [test234@test-podman2 ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> 10.0.0.133 test-podman2.eumetsat.sandbox.ewc (this is an example, you will see the private IP of your machine and the domain from your machine here) OLD_LDAP_IP OLD_LDAP_DOMAIN <!-- END ANSIBLE MANAGED BLOCK -->
- Install freeipa 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
rocky 8 LDAP replica
- Login to Morpheus
- Go to Provisioning → Instances and click '+ADD'
- Select the LDAP replica Instance type
- Select a new name for the VM (e.g. ldap-rocky8) and click 'Next'
- Use the following inputs for the VM and then click 'Next' until the deployment starts:
- version: 8
- plan: eo1.medium
- networks: private
- security group: ldap
Migrate from Rocky 8 to Rocky 9
Creating a new rocky 8 LDAP to migrate toreplica
- Login to Morpheus
- Go to Provisioning → Instances and click '+ADD'
- Select the LDAP replica Instance type
- Select a new name for the VM
- From Morpheus, deploy a new machine with
- image: rocky 9
- security group: ldap security group
- plan: eo1.medium
- name: different from existing ldap machine
- SSH to the new machine and become root
- 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 (OLD_LDAP_IP is the private IP of your current LDAP and OLD_LDAP_DOMAIN is the domain from your current LDAP (e.g. ldap.eumetsat.sandbox.ewc) )
Code Block [test234@test-podman2 ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> 10.0.0.133 test-podman2.eumetsat.sandbox.ewc (this is an example, you will see the private IP of your machine and the domain from your machine here) OLD_LDAP_IP OLD_LDAP_DOMAIN <!-- END ANSIBLE MANAGED BLOCK -->
- Install freeipa 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), 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
- -rocky8) and click 'Next'
- Use the following inputs for the VM and then click 'Next' until the deployment starts:
- version: 9
- plan: eo1.medium
- networks: private
- security group: ldap
Switch IP interfaces between LDAP
- Using Openstack Application credentials (EWC - OpenStack Command-Line client), identify your OLD LDAP machine
Code Block openstack server list
- SSH to the VM with Openstack client installed and run the following commands:
- Show information about the OLD LDAP machine (SERVER_NAME usually is ldap in the tenancies by default):
Code Block openstack server show SERVER_NAME
- Show information about the OLD LDAP machine (SERVER_NAME usually is ldap in the tenancies by default):
- Detach the interface from the OLD LDAP machine (SERVER_NAME is the name of the OLD LDAP 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
- !)
Code Block openstack server remove fixed ip SERVER_NAME IP_ADDRESS
- SSH In the NEW LDAP machine ,(LDAP replica)
- Update the IP of the NEW LDAP machine in the /etc/hosts (IP_ADDRESS ) with the IP of the OLD LDAP machine and remove the line relative to the OLD LDAP ( 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 name:
You can find this information loggning in Morpheus → Tools → Cypher and check the following secret → secret/ldap_domain
Use ipa command
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 and remove the line relative to the OLD LDAP ( The one you saved before in your notes!)
- SSH to the VM with Openstack client installed and run the following commands:
- Switch off the 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 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 LDAP security group to new LDAP machine (SERVER_NAME is the name of the NEW LDAP VM)
Code Block openstack server add security group SERVER_NAME ldap
- Restart NEW LDAP machine (SERVER_NAME is the name of the new LDAP VM)
Code Block openstack server restart SERVER_NAME
- Switch off the NEW LDAP machine (SERVER_NAME is the name of the VM, you can find it with openstack server list )
- Go Login to Morpheus and change the value in of the hostname for LDAP, going to Tools → Cypher:
- Delete the secret/ldap_hostname
-
- Use the '+ADD' to create a new secret
- Add KEY: secret/ldap_hostname
- and VALUE: new LDAP hostname (e.g. ldap.eumetsat.sandbox.ewc)
Tests
- login with DNS from ssh to ssh-proxy
- ssh using DNS to the new LDAP machine
- Run sudo ipactl status → verify the services are all up and running
- Deploy From Morpheus go to Provisioning → Instances and deploy a new machine and enrollto test the enrolment to LDAP DNS is working correctly.
Post Installation (optional in case of similar errors)
...