We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How can I recover Control Panel?
Environment
CentOS 64bit
Answer
This guide presumes availability of off-server/site backups of the following directories, so that the files of those directories could be copied back to the server being recovered:
- /onapp/interface/config/
- /root/
- /onapp/backups/db/dump
- /etc/my.cnf
- /home/onapp
If you have any SSL certificates on the server, take a copy of the necessary files.
To recover your Control Panel, follow the next steps:
-
To prepare for Control Panel recovery:
-
Install a clean installation of CentOS 64bit
-
Configure networking to match the previous configuration
-
Ensure you can ping comput resources and backup server over the management network
Ensure that you can access MySQL without a password before continuing if it is already installed. - Remove any client mysql configuration in /root/.my.cnf
-
-
Update CentOS components to the latest yum update.
-
Download and install OnApp YUM repository file
rpm -Uvh http://rpm.repo.onapp.com/repo/onapp-repo.noarch.rpm
-
Install OnApp Control Panel installer package. Please, reboot if requested by the installer due to SELINUX, and then continue:
bash#> yum install -y onapp-cp-install
-
Run the Control Panel installer to install the latest OnApp release:
/onapp/onapp-cp-install/onapp-cp-install.sh
If required, indicate the build number of the release version you want to install:
/onapp/onapp-cp-install/onapp-cp-install.sh -v <ONAPP_VERSION>
To avoid any issues, make sure you reinstall the same release which was previously installed on CP server. -
Import the OnApp config from backup
/onapp/interface/config/on_app.yml
-
To ensure the SSH keys are correct, import the following from the backup:
/home/onapp/.ssh/id_rsa /onapp/interface/config/keys/private /home/onapp/.ssh/id_rsa.pub /onapp/interface/config/keys/public /root/.ssh/authorized_keys /home/onapp/.ssh/known_hosts /root/.ssh/known_hosts
Make sure you can access each HV and Backup Server from the OnApp user. To verify the keys are working correctly run the following commands:
su onapp
ssh root@<HV_IP_ADDRESS> -
Install OnApp Storage packages
yum -y install onapp-store-install /onapp/onapp-store-install/onapp-store-install.sh
-
Locate and restore the latest MySQL dump
Copy from backup the latest gzipped dump into the /root directory on CP. I.e.:scp 1397788801.localhost.onapp.sql.gz <CP_IP_ADDRESS>:/root/ gunzip /root/1397788801.localhost.onapp.sql.gz mysql -p onapp < /root/1397788801.localhost.onapp.sql
-
Restore MySQL optimizations from backup (if changed from defaults)
/etc/my.cnf
-
If required, run the OnApp installer to update the DB scheme
This may be required if you have reinstalled a newer version of OnApp than was installed previously, or you are not sure what version was installed previously.
/onapp/onapp-cp-install/onapp-cp-install.sh
-
Regenerate Cloudboot information
Option 1su onapp cd /onapp/interface/ && rails c Hypervisor.all.map { |hv| OnApp::CloudBoot::Config::Hypervisor.new(hv).update if hv.mac.present? }
In OnApp WebUI go to Settings > Configuration and click Save at the bottom of the page.
Option 2
If you have an up to date backup of /tftpboot you can restore the whole directory to replace the default /tftpboot files
-
Regenerate new dhcpd.conf by adding and removing a placeholder IP
-
Go to Settings > Hypervisors > Cloudboot IPs
-
Add a single placeholder IP; e.g:
-
IP Address - 10.10.10.2
-
Netmask - 255.255.255.0
-
Gateway - 10.10.10.1
-
-
After adding the above IP, please delete it using the "trash" icon
-
-
Restart services for changes to take effect
service httpd stop service onapp stop service mysqld stop service mysqld start service onapp start service httpd start
You may need to wait around 15 minutes for the license to become active, once it has become active this process should be complete.
Post Actions
If you have an empty Cloudboot server, it is recommended to reboot it at this stage in order to ensure the DHCP/TFTP services are working as expected.
Provision a test virtual server, smart server and baremetal server where the capacity allows to ensure the end-to-end process for each provisioning process is working normally.