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
- Download the newest Docker Host Server version and move the package to the VF Server VM
- Unpack the Server version
### Replace VERSION with the actual Server version
sudo tar -Pxvf vfunction-server-installation.vVERSION.tgz
- 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.
- Backup the Measurements Volume
cd /var/lib/docker/volumes/vfapi_measurements_storage_vol/_data/data
sudo tar -cvzf /tmp/measurements.tgz .
- 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
- 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
- Create the OpenShift Cluster using the desired Instance Types. For example, if using Red Hat OpenShift Service on AWS (ROSA):
| t3a.large | 5 | workload=vfunction-small |
| c7i-flex.xlarge | 1 | workload=vfunction-mysql |
| c7i-flex.4xlarge | 2 | workload=vfunction-measurements |
- Log into the OpenShift Console
- Select Operators > OperatorHub from the left-hand sidebar
- Search for vfunction in the center pane’s search bar
- Select the vFunction Operator. If two options are presented, select the Certified version
- A dialog box will be displayed with an introduction to the vFunction platform as well as an overview of the configurable settings
- 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
- On the next page, define the Installed Namespace and set Update approval to Manual. Then click the blue Install button
- Once the Operator has finished installing, you will be taken to a page for the installed vFunction Operator under Operators > Installed Operators
- In the center pane, click Create instance below where it says “VS vFunction Represents an instance of vFunction running on your cluster.”
- On the Create VfunctionServer page, start in the Form View and fill in the Required Configuration Settings
- 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:
- Switch to the YAML view
- Find the spec section of the YAML
- 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
- Click the blue Create button
- The Installed Operators screen will display that the vfunction-server (the Operand) is in Status = State: Installing
- Go to the Workloads > Pods and filter the search results by Name: vfunction
- 13 Pods should come up as Ready with 1/1 before the installation has completed
- 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
- 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
- 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
- Copy the MySQL DB Dump TGZ to the MySQL Pod
oc cp ./dump-TIMESTAMP-VERSION.sql.tgz vfunction-mysql-POD_ID:/opt/vfunction/backups/
- Exec to the vfunction-mysql Pod
- Restore the MySQL DB from the Dump TGZ
/usr/local/bin/backup.sh restore dump-TIMESTAMP-VERSION.sql.tgz
- Copy the Measurements Backup TGZ to the Storage Pod
oc cp ./measurements.tgz vfunction-storage-POD_ID:/home/storage/storage/
- Exec to the vfunction-storage Pod
- Extract the Measurements TGZ
cd /home/storage/storage
tar -xvzf measurements.tgz
- 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
- 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