Warning |
---|
Pre-requisites:
|
Table of Contents |
---|
User procedure
Start user procedure:
- Edit LDAP Security Group (see EditLDAPsecuritygroup);
- Backup existing LDAP machine using the following documentation: EWC - How to create and restore backups from VMs (VM Images Backup)
- Check the Operating System of your LDAP from Morpheus, Provisioning → Instances → select LDAP machine ;
- If your LDAP is rocky 8 based → jump to step 10.
- If your LDAP is centos7 based → continue to step 4.
- If your LDAP is rocky 8 based → jump to step 10.
Prepare the following information knowing that your OLD_LDAP is centos7 based and NEW_LDAP is rocky8 based:
- DNS_HOSTED_ZONE→ logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_domain
- OLD_LDAP_SERVER_NAME → Name of the server from Openstack → you can find the name from openstack server list command
- OLD_LDAP_PRIVATE_IP → logging in Morpheus → Provisioning → Instances, check your OLD LDAP VM IP address
- OLD_LDAP_HOSTNAME → logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_hostname
- NEW_LDAP_SERVER_NAME → Name of the server from Openstack → you can find the name from openstack server list command
- NEW_LDAP_PRIVATE_IP → logging in Morpheus → Provisioning → Instances, check your new LDAP VM IP address
- NEW_LDAP_HOSTNAME → <name-of-the-machine>.<tenancy-domain> where tenancy-domain → logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_domain (e.g. the result should be something like ldap-test-rocky.eumetsat.sandbox.ewc). Alternatively you can find it in /etc/hosts file in your new LDAP machine
- Create LDAP replica instance type to move from centos7 to rocky 8 (see MigratefromCentos7toRocky8);
- Make new LDAP machine primary (see PreparenewLDAPmachine );
- Switch IP interfaces between LDAPs (see SwitchIPinterfacesbetweenLDAPs);
- Update Morpheus (see UpdateMorpheus );
- Check everything is working fine (see Tests);
Prepare the following information knowing that your OLD_LDAP is rocky8 based and NEW_LDAP is rocky9 based:
- DNS_HOSTED_ZONE→ logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_domain
- OLD_LDAP_SERVER_NAME → Name of the server from Openstack → you can find the name from openstack server list command
- OLD_LDAP_PRIVATE_IP → logging in Morpheus → Provisioning → Instances, check your OLD LDAP VM IP address
- OLD_LDAP_HOSTNAME → logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_hostname
- NEW_LDAP_SERVER_NAME → Name of the server from Openstack → you can find the name from openstack server list command
- NEW_LDAP_PRIVATE_IP → logging in Morpheus → Provisioning → Instances, check your new LDAP VM IP address
- NEW_LDAP_HOSTNAME → <name-of-the-machine>.<tenancy-domain> where tenancy-domain → logging in Morpheus → Tools → Cypher and check the following secret → secret/ldap_domain (e.g. the result should be something like ldap-test-rocky.eumetsat.sandbox.ewc). Alternatively you can find it in /etc/hosts file in your new LDAP machine
- Create LDAP replica instance type to move from rocky 8 to rocky 9 (see MigratefromRocky8toRocky9)
- Make new LDAP machine primary (see PreparenewLDAPmachine );
- Switch IP interfaces between LDAPs (see SwitchIPinterfacesbetweenLDAPs);
- Update Morpheus (see UpdateMorpheus );
- Check everything is working fine (see Tests);
- Delete old LDAP machine/s to free resources (see Delete a VM from Morpheus).
Tasks
Edit LDAP security group
- ssh to the VM with Openstack Client and run the following commands (see 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
- List ldap security group rule
Migrate from Centos7 to Rocky 8
Creating a new 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 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: 9
- plan: eo1.medium
- networks: private
- security group: ldap
Prepare new LDAP machine
- SSH In the NEW LDAP machine (LDAP replica) and become root
- Edit the /etc/hosts file and make sure it is as follow:
Code Block [murdaca@ipa ~]$ cat /etc/hosts <!-- BEGIN ANSIBLE MANAGED BLOCK --> OLD_LDAP_PRIVATE_IP NEW_LDAP_HOSTNAME <!-- END ANSIBLE MANAGED BLOCK -->
- Delete OLD LDAP machine DNS records
Code Block ipa-replica-manage del OLD_LDAP_HOSTNAME --force
- Replace the NEW LDAP machine IP DNS records with the IP of the interface of the OLD LDAP machine
Code Block ipa dnsrecord-mod DNS_HOSTED_ZONE ipa-ca --a-rec OLD_LDAP_PRIVATE_IP ipa dnsrecord-mod DNS_HOSTED_ZONE NEW_LDAP_HOSTNAME --a-rec OLD_LDAP_PRIVATE_IP
Switch IP interfaces between LDAPs
Now you can start the procedure to switch interfaces between two VMs:
- 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 OLD_LDAP_SERVER_NAME
- 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 OLD_LDAP_SERVER_NAME OLD_LDAP_PRIVATE_IP
- 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 OLD_LDAP_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 NEW_LDAP_SERVER_NAME NEW_LDAP_PRIVATE_IP
- 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 NEW_LDAP_SERVER_NAME OLD_LDAP_PRIVATE_IP
- 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 NEW_LDAP_SERVER_NAME ldap
- Restart NEW LDAP machine (SERVER_NAME is the name of the new LDAP VM)
Code Block openstack server restart NEW_LDAP_SERVER_NAME
- Show information about the OLD LDAP machine (SERVER_NAME usually is ldap in the tenancies by default):
Update Morpheus
- Login to Morpheus and change the value 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
- Delete the secret/ldap_hostname
Tests
- ssh to ssh-proxy in your tenancy
- ssh using DNS to the new LDAP machine
- Run sudo ipactl status → verify the services are all up and running
- From Morpheus go to Provisioning → Instances and deploy a new machine to test the enrollment to LDAP DNS is working correctly with the new LDAP machine.
Known possible errors
After the IPA Migration, especially from Centos7 to Rocky9, there might be still some possible errors, like the one below:
ipa: ERROR: Operations error: Allocation of a new value for range cn=posix ids,cn=distributed numeric assignment plugin,cn=plugins,cn=config failed! Unable to proceed.
There is a FreeIPA doc site related to this: https://www.freeipa.org/page/V3/Recover_DNA_Ranges.html
The fix for that error is the following command:
- Identify min and max range of IDs
Code Block ipa idrange-find
- Set the lower boundary to exclude every existing account (as of
ipa user-find | grep 'UID'
) - Assign the DNS range using ${min}-${max} identified in the previous steps
Code Block ipa-replica-manage dnarange-set $ldap_server ${min}-${max}
- Check the range that is used
Code Block |
---|
ipa-replica-manage dnarange-show |