-
Language:
English
-
Language:
English
Migrating to Red Hat CloudForms 5.0
Upgrading your system from an earlier version of Red Hat CloudForms Management Engine
Red Hat CloudForms Documentation Team
cloudforms-docs@redhat.com
Abstract
Preface
This document describes the process of migrating an older Red Hat CloudForms environment to Red Hat CloudForms 5.0 (CFME 5.11). Chapter 4, Updating CloudForms also provides instructions for applying minor updates (errata) to your CloudForms appliances.
You can migrate directly to Red Hat CloudForms 5.0 (CFME 5.11) from the following version:
- Red Hat CloudForms 4.7.x (CFME 5.10.x)
If you want to migrate from a version prior to CloudForms 4.7 (CFME 5.10), you must first migrate to CloudForms 4.7 (CFME 5.10) and then follow the instructions in this document.
Chapter 1. Ordering Migrations
You must perform all migrations of the databases before configuring replication and high availability. This is because you will deploy new appliances for migrating to CFME 5.11.
Do not run evmserverd
if a database is in a partially migrated state.
Chapter 2. Modifying the Postgresql Configuration
This procedure modifies the strategy used for making changes to the PostgreSQL configuration. Previously, changes were made directly to the postgresql.conf
file in the data directory. After switching to the new configuration, changes will be made by editing a separate file in the /etc/manageiq/postgresql.conf.d
directory. This modification allows future PostgreSQL configuration changes to be made more easily.
The 01_miq_overrides.conf
file in the /etc/manageiq/postgresql.conf.d
directory is reserved for application overrides and will be recreated on application updates; this file should not be edited. Additional files will be read by the PostgreSQL server process according to the documentation here: https://www.postgresql.org/docs/9.5/config-setting.html#CONFIG-INCLUDES.
Back up the
postgresql.conf
file so that you have any configuration changes:# cp $APPLIANCE_PG_DATA/postgresql.conf <file_location>
Copy the updated
postgresql.conf
file to thepg_data
directory:# cp $APPLIANCE_SOURCE_DIRECTORY/TEMPLATE/var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf $APPLIANCE_PG_DATA/postgresql.conf
Optional: If you have made changes to the
postgresql.conf
file prior to following this procedure, create a new02_user_overrides.conf
file, and add any modifications you have from the originalpostgresql.conf
file. Example layout of the02_user_overrides.conf
file:#---------------------------------------------- # WRITE AHEAD LOG #---------------------------------------------- wal_level = 'logical' wal_log_hints = on wal_buffers = 16MB min_wal_size = 1GB max_wal_size = 2GB checkpoint_completion_target = 0.9
Once the
02_user_overrides.conf
file has been modified and saved, restart thepostgresql
service:# systemctl restart $APPLIANCE_PG_SERVICE
All postgresql.conf
customizations will now be made to files in the /etc/manageiq/postgresql.conf.d
directory due to the following include_dir
line in the default configuration. The settings in these new files will override ones in the postgresql.conf
file.
include_dir = '/etc/manageiq/postgresql.conf.d`
Chapter 3. Migrating from CloudForms 4.7 (CFME 5.10) to CloudForms 5.0 (CFME 5.11)
3.1. Overview
This procedure describes the process of migrating Red Hat CloudForms 4.7x (CFME 5.10.x) to Red Hat CloudForms 5.0 (CFME 5.11). This procedure does not necessarily include migration of all possible customer modifications, so it is recommended that you fully test any modifications before migrating your environment.
- Read through all of the steps in this procedure before beginning the migration process.
- CloudForms 5.0 appliances require 12 GB memory which is the same as the previous version. However, before migrating your appliances, adjust resources in your environment to avoid performance issues. See Migration Considerations in the Release Notes for more information.
You can classify the migration into three groups of appliances:
- VMDB appliance - An appliance with workers running, which also hosts its own database that other appliances can also connect to.
- Non-VMDB appliance - An appliance with workers running which does not host a database. The appliance is connected to an external database.
- Dedicated database appliance - A CloudForms appliance or non-CloudForms virtual machine with no workers running on it: the appliance contains only a database for other appliances to connect to.
Migration Workflow Summary
In summary, the migration process from CFME 5.10 to CFME 5.11 follows this workflow:
Prepare appliances:
NoteThis step only applies for a multi-region CloudForms environment.
- Remove all the subscriptions from the global region before migrating the global database since the subscriptions will have to be dropped and recreated.
- Back up the database of your 5.10 appliance.
Migrate appliances:
- Provision new appliances to replace each 5.10 appliance.
- On the VMDB and non-VMDB appliances, copy the GUID file from the 5.10 version of the same appliance to the same location.
- On the VMDB and non-VMDB appliances, use the appliance console menu to configure the database and fetch the v2_key from a 5.10 appliance.
- Copy the 5.10 appliance database backup file and restore the database on each VMDB and dedicated database appliance.
Load the new version of the pglogical library on the VMDB and dedicated database appliances.
NoteThis step only applies for a multi-region CloudForms environment.
- Migrate the VMDB appliance databases and update the Automate Model.
-
Restart
evmserverd
on the VMDB appliances.
- Configure replication after the migration process is complete and appliances are running once again.
3.2. Preparing the Appliances for Migration
In a multi-region environment, on all database appliances in the global region:
Disable the CloudForms 4.7 (CFME 5.10) repositories:
# subscription-manager repos --disable=cf-me-5.10-for-rhel-7-rpms
NoteSee Enabling Supplementary and Optional Repositories in Using and Configuring Red Hat Subscription Manager for more information.
3.3. Backing Up Current Appliances
These steps will not affect the operations of your CloudForms infrastructure. However, they will help ensure that you are able to roll back if required and replicate the network settings.
Find the size of the databases by using the following command. Then, ensure that your volume has enough space for the backup file.
psql -d vmdb_production -c "SELECT pg_size_pretty(pg_database_size('vmdb_production'));"
- If it’s a multi-region environment, ensure you have removed all subscriptions from the global database appliance.
Stop the
evmserverd
process.# systemctl stop evmserverd
Back up the databases of your CFME 5.10 appliances in the root directory. Take a snapshot if possible.
pg_dumpall -c --if-exists | gzip > vmdb-5.10.pg.gz
Note-
This will create a compressed text-based backup.
pg_dumpall
is a utility for writing out (“dumping”) all PostgreSQL databases of a cluster into one script file. For more information, see the pg_dumpall documentation. -
When doing a
pg_dumpall
thepg_replication_slots
will not get copied over causing the slots to become inactive. This will also reduce the size of the global database appliance allowing for quicker backup and restore.
-
This will create a compressed text-based backup.
Back up the following files noting which appliance each comes from. This is to replace the old appliances in the database and for disaster recovery.
-
/var/www/miq/vmdb/GUID
-
/var/www/miq/vmdb/REGION
-
During the upgrade, the iptables configuration file (
/etc/sysconfig/iptables
) is removed. If you have changed the iptables configuration from the default (runiptables --list -n
to see the current configuration), use the following command to back up the iptables configuration:# iptables-save > /etc/iptables.conf
You can restore your iptables configuration file with the following command:
# iptables-restore < /etc/iptables.conf
Alternatively, add this command to
/etc/rc.local
to reload the rules at every reboot.
3.4. Steps to Follow on Newly Deployed CFME 5.11 Appliances
Perform the following steps on your CloudForms appliances as specified to migrate to CFME 5.11.
Some steps are run on certain appliances. Ensure you wait for each command to finish before going to the next step.
- Provision and start the new appliances. For VMDB appliances, add a new disk for the database.
On the VMDB and non-VMDB appliances, run the following commands as the root user:
Copy the GUID file from the CFME 5.10 appliances.
# scp root@$IP_of_5.10_appliance:/var/www/miq/vmdb/GUID /var/www/miq/vmdb/
Note- Perform these steps on VMDB appliances first. The non-VMDB appliances won’t have a database to connect to if they’re done first.
- Perform this step only if you want to keep the same appliance/miq_servers records in the database and inherit that appliance’s existing settings. If you plan on deploying new appliances with new IP addresses and host name and not inherit the settings, you may prefer creating new records by not copying the GUID.
-
On VMDB and dedicated appliances only, select the option to configure a new internal database using the appliance console menu. For non-VMDB appliances, connect to an external database, then join region in external database. Note that as part of the database configuration step, fetch the
v2_key
from one of the CFME 5.10 appliances. -
Select the same region number and database password as the old installation. You can find the region number used for an installation listed as Database/Region: in the
appliance_console
summary information. - Allow the appliance to start.
On the new VMDB and new dedicated database appliances:
Stop the
evmserverd
process.# systemctl stop evmserverd
Drop the default database.
# dropdb vmdb_production
Copy the database dump from the 5.10 appliance.
# scp root@$IP_of_5.10_appliance:~/vmdb-5.10.pg.gz ~/
Decompress and restore the database dump backup file.
gunzip < vmdb-5.10.pg.gz | psql postgres
Change to the
vmdb
directory.# cd /var/www/miq/vmdb/
Run the below command appropriate to your environment to migrate everything in the database to work with the latest 5.11 configuration. If you run into an error, contact Red Hat Support.
# rake db:migrate
Update the Automate Model to the latest version. This resets the ManageIQ and Red Hat domains (base domains) to a new and upgraded version. Run the command appropriate to your environment to update the Automate Model:
In a single (standalone database) or replicated environment, run this command on each VMDB appliance.
# rake evm:automate:reset
Start the
evmserverd
process.In a single (standalone database) or replicated environment, run this command on each VMDB appliance:
# systemctl start evmserverd
The migration process is now complete. Once appliances are running again, you can configure database replication in your environment; see Configuring Database Replication and Centralized Administration in the General Configuration guide for more information.
Chapter 4. Updating CloudForms
This chapter details applying software package minor updates (referred to as errata) to CloudForms 5.0 (CFME 5.11) appliances.
Appliances must be registered to Red Hat Subscription Manager and subscribed to the update channels required by CloudForms in order to access updates. See Registering Red Hat CloudForms in General Configuration to register and subscribe the appliance.
Note the default repository names when subscribing your CloudForms 5.0 (CFME 5.11) appliances for software updates:
- cfme-5.11-for-rhel-8-x86_64-rpms
- ansible-2.9-for-rhel-8-x86_64-rpms
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
4.1. Updating the CloudForms Application
An important part of securing CloudForms is to ensure your appliances use the latest software packages.
The Red Hat Updates tab in the CloudForms user interface enables you to check for updates and update registered appliances. Any services requiring a restart to apply updates are automatically restarted as part of the Red Hat Updates process.
Using the Red Hat Updates tab only applies software updates for the CloudForms application. To run the update from the command line, run yum update cfme*
. See Section 4.2, “Updating All Packages on the Appliance” for instructions on applying Red Hat errata.
To apply updates to the CloudForms application:
- From the settings menu, select Configuration.
- Select Region in the accordion menu and click the Red Hat Updates tab.
- Click Check For Updates to search the Content Delivery Network (CDN) for any updated CloudForms packages. If an appliance update is available, it will be listed with the available version.
- Click Apply CFME Update to install and update CloudForms packages. The CloudForms service will be automatically restarted as needed.
If the appliance is registered to Red Hat Satellite, you can use content views to manage updates for CloudForms. For more information, see Creating Content Views in the Red Hat Satellite 6 Content Management Guide.
The following options are available in the Appliance Updates section of Red Hat Updates:
Table 4.1. Options Available in Appliance Updates
Option | Use |
---|---|
Refresh List | Refreshes the list of appliances. |
Check for Updates |
Checks for all available CloudForms updates using |
Register |
Attempts to register the appliance if it is not already registered. CloudForms subscribes to the |
Apply CFME Update |
Applies updates to CloudForms packages only. Specifically, this option runs the |
4.2. Updating All Packages on the Appliance
You can apply updates to the appliance using the yum command or Red Hat Satellite. This updates all RPMs on the appliance, not just the CloudForms packages. Yum can be used at any time to update any single package or the entire appliance to any new or updated packages available on the subscription.
Updates to the operating system, CloudForms application or dependent packages may introduce incompatibilities in customized environments. Before applying updates to the appliance, back up the appliance or take a snapshot so that changes can be reverted in production environments if needed.
Scheduled downtime is required while updating system packages for the following reasons:
- Some updates may interrupt CloudForms operations.
- Updates for the PostgreSQL database server suspend CloudForms operations.
- System updates may require a reboot of the CloudForms appliance.
To update all packages on the appliance using yum
, follow the procedure below. To update packages on the appliance using Red Hat Satellite, see Viewing and Applying Errata and Configuring and Running Remote Commands in the Red Hat Satellite 6 documentation for more information.
Log into each appliance console as the root user and perform the following steps:
Stop the CloudForms application (the evmserverd process) with the following command:
# systemctl stop evmserverd
Apply the software updates:
# yum update
ImportantDo not reboot or restart yet.
Log into each server containing an internal database and perform the following steps:
Stop the database with the following command:
# systemctl stop $APPLIANCE_PG_SERVICE
Apply the software updates:
# yum update
Reboot the server unless the errata or the command
needs-restarting
advises a restart is safe:# systemctl restart $APPLIANCE_PG_SERVICE
Log into the appliance console on each appliance as the root user and perform the following steps:
Reboot the server unless the errata or the command
needs-restarting
advises a restart is safe:# reboot