How to migrate the vFunction Server from a Linux Host to an OpenShift Cluster



Overview

The steps below are written for a vFunction Server installed as a root / sudo user running on a VM via Docker. Adjust the steps accordingly.


Upgrade the Existing Server to the newest version

  1. Download the newest Docker Host Server version and move the package to the VF Server VM
  2. Unpack the Server version
### Replace VERSION with the actual Server version
sudo tar -Pxvf vfunction-server-installation.vVERSION.tgz
  1. Upgrade the server
sudo bash /opt/vfunction/server-installation/upgrade.sh

Backup the existing environment

If reusing the existing environment’s Volumes, skip these Backup steps and simply grab the existing server-installation.yaml for use in the new environment.

  1. Backup the Measurements Volume
cd /var/lib/docker/volumes/vfapi_measurements_storage_vol/_data/data
sudo tar -cvzf /tmp/measurements.tgz .
  1. Gather the Database Backup
### Find the largest, most recent TGZ that is listed here
sudo ls -laS /var/lib/docker/volumes/mysql_vol/_data/backups/

### Replace TIMESTAMP and VERSION with the actual values
sudo cp /var/lib/docker/volumes/mysql_vol/_data/backups/dump-TIMESTAMP-VERSION.sql.tgz /tmp
  1. Gather the Generated values from the server-installation.yaml
grep -A4 'generated' /etc/sysconfig/vfunction/installation/server-installation.yaml

Set up the new OpenShift Cluster

  1. Create the OpenShift Cluster using the desired Instance Types. For example, if using Red Hat OpenShift Service on AWS (ROSA):
Node Type
Node Replicas
Node Label
t3a.large 5 workload=vfunction-small
c7i-flex.xlarge 1 workload=vfunction-mysql
c7i-flex.4xlarge 2 workload=vfunction-measurements
  1. Log into the OpenShift Console
  2. Select Operators > OperatorHub from the left-hand sidebar
  3. Search for vfunction in the center pane’s search bar
  4. Select the vFunction Operator. If two options are presented, select the Certified version
  5. A dialog box will be displayed with an introduction to the vFunction platform as well as an overview of the configurable settings
  6. On the left-hand side of the dialog box, use the dropdowns to select Channel: stable and select the newest available Version. Then click the blue Install button
  7. On the next page, define the Installed Namespace and set Update approval to Manual. Then click the blue Install button
  8. Once the Operator has finished installing, you will be taken to a page for the installed vFunction Operator under Operators > Installed Operators
  9. In the center pane, click Create instance below where it says “VS vFunction Represents an instance of vFunction running on your cluster.”
  10. On the Create VfunctionServer page, start in the Form View and fill in the Required Configuration Settings
  11. If migrating from a Linux Host to an OpenShift Cluster, it may be due to the size of the Application. If so, you may potentially want to set up Node Selectors or Node Labels:
  1. Switch to the YAML view
  2. Find the spec section of the YAML
  3. Add the generated section (retrieved during the Backup process) as a subsection within spec like in the example below:
spec:
    generated:
        client_id: f66a0000-0000-0000-0000-220010520000
        client_secret: 916e0000-0000-0000-0000-8b2808650000
        app_client_id: 3c860000-0000-0000-0000-400f53200000
        app_client_secret: 36900000-0000-0000-0000-7512230f0000
  1. Click the blue Create button
  2. The Installed Operators screen will display that the vfunction-server (the Operand) is in Status = State: Installing
  3. Go to the Workloads > Pods and filter the search results by Name: vfunction
  4. 13 Pods should come up as Ready with 1/1 before the installation has completed
  5. The vfunction-route should be created under the Networking > Routes and the vFunction Server should be accessible for first-login at the Server FQDN using the Admin credentials defined in Step #11
  6. Check the vFunction ConfigMaps to ensure that the generated values. For example, client_id in the new ConfigMap needs to match the client_id or app_client_id from the generated section. And, client_secret in the ConfigMaps needs to match client_secret or app_client_secret from the generated section

Restore the Database and Measurements Details

  1. Move the MySQL DB Dump TGZ and the Measurements Backup TGZ from the Linux Host to a machine that can OC into the OpenShift Cluster
  2. Copy the MySQL DB Dump TGZ to the MySQL Pod
oc cp ./dump-TIMESTAMP-VERSION.sql.tgz vfunction-mysql-POD_ID:/opt/vfunction/backups/
  1. Exec to the vfunction-mysql Pod
  2. Restore the MySQL DB from the Dump TGZ
/usr/local/bin/backup.sh restore dump-TIMESTAMP-VERSION.sql.tgz
  1. Copy the Measurements Backup TGZ to the Storage Pod
oc cp ./measurements.tgz vfunction-storage-POD_ID:/home/storage/storage/
  1. Exec to the vfunction-storage Pod
  2. Extract the Measurements TGZ
cd /home/storage/storage
tar -xvzf measurements.tgz
  1. Delete the vFunction Pods so they can be restarted by the Operator without any caching preventing problems accessing the restored environment
  • vfunction-mysql
  • vfunction-vfapi-parser
  • vfunction-vfapi-IDP
  • vfunction-vfapi-mcp
  • vfunction-vfapi-organizations
  • vfunction-vfapi-users
  • vfunction-vfapi-measurements (#1)
  • vfunction-vfapi-measurements (#2)
  • vfunction-vfapi-otlp
  • vfunction-vfapi-dm
  • vfunction-storage
  • vfunction-nginx
  1. Access the vFunction UI in a browser to confirm that (a) You can see the old Apps and Measurements in the UI to confirm the DB restored properly and (b) You can download a Measurement to confirm that the Measurements Backup restored properly