OVA Migration

This document outlines the process of migrating data from an existing CloudShark Enterprise virtual machine to our new OVA (Open Virtual Appliance) distribution, which includes the latest version of CloudShark Enterprise.

After completing this migration, your persistent data will be stored on a dedicated data disk, separate from the operating system and application files. This architecture simplifies future upgrades, you’ll only need to import the new OVA into your virtualization platform and attach your existing data disk. The consolidated storage of persistent data also streamlines backup procedures, as you can create backups by simply cloning the data disk.

Benefits of migrating to the OVA include:

  • Streamlined installation and maintenance procedures
  • Data stored on a separate disk from the OS and application
  • Simplified backup processes
  • Runs the most up-to-date RHEL-based Linux operating systems

The migration process consists of: importing the CloudShark Enterprise OVA and its included data disk, transferring your existing data to this new disk, and updating your license. This guide will walk you through each step to ensure a successful migration to the new platform.

For additional cloud-provider specific instructions please see:


Watch the video below to learn how to migrate your CloudShark Enterprise virtual machine to our new OVA:


Import OVA

The first step in migrating to the OVA is downloading the latest OVA from the QA Cafe Customer Lounge and importing it into your virtualization platform. After importing the OVA, inspect the two attached disk images and find the 500 GB disk. This is the data disk to which you will migrate the data from your existing VM running CloudShark.

Next, start the OVA. After it has finished booting, login with the default username root and the default password cloudshark, and run the passwd command to update your password. Then, run the following command to show the Host-ID of the system and send this to support@qacafe.com for licensing:

/usr/qacafe/bin/rlmutil rlmhostid ether

This command may return multiple host IDs. In that case, select a host ID that matches the Ethernet address of a network interface that will permanently be configured on your system. For example, an elastic network interface if you are in an Amazon AWS environment. You can display all of the network interfaces by running ip addr.

If your existing VM running CloudShark has more than 500 GB of data, resize the data disk to hold all of the data. You can check the amount of data stored by running the following command on the existing VM:

du -hs /usr/cloudshark/data

Migrate to Data Disk

Next, detach the data disk from the OVA and connect it to the VM you want to migrate from. You may have to shut down both the OVA and the VM to do this. Once the existing VM is running with the data disk attached, execute the following commands to mount the disk:

mkdir /storage
mount /dev/storage/storage /storage

These commands will mount the data disk to the directory /storage. In this directory, three folders will store the configuration, database, and all the pcap files separately from the underlying operating system and CloudShark application:

  • /storage/data: Holds all the PCAP files uploaded to CloudShark.
  • /storage/db: Contains the MariaDB database CloudShark connects to.
  • /storage/etc: Stores the CloudShark configuration.

First, stop CloudShark and MariaDB on the existing VM to migrate these to the folders on the data disk. Then, copy everything to the data disk and set the correct permissions by running the following commands:

systemctl stop cloudshark-full mariadb
cp /usr/cloudshark/etc/cloudshark.conf /storage/etc
cp -r /usr/cloudshark/data/{profiles,private} /storage/etc
cp -r /usr/cloudshark/data/2* /storage/data
/bin/cp -rf /var/lib/mysql/* /storage/db/
chown -R 990:985 /storage/{etc,data}
chown -R 27:27 /storage/db/
umount /storage/

At this point, all data has been successfully migrated to the dedicated storage disk, separate from the operating system disk running CloudShark Enterprise.

Run the OVA

To upgrade to the latest version of CloudShark, attach the data disk to the OVA and start the VM. Next, download the latest license from the QA Cafe Customer Lounge and update the license following these instructions.

SELinux

The SELinux labels may be incorrect or missing depending on how the VM you migrated from was configured. Run the following commands to set the correct labels:

semanage fcontext -a -t mysqld_db_t "/usr/cloudshark/db(/.*)?"
semanage fcontext -a -t mysqld_db_t "/var/lib/mysql"
semanage fcontext -a -t mysqld_db_t "/storage/db"
restorecon -R -v /var/lib/mysql /usr/cloudshark/db /storage/db
systemctl restart mariadb

These commands add the correct SELinux file context for MariaDB database files and apply them to both the symlink locations and actual storage location on the data disk.

Database Upgrade

If you are migrating from a version of CloudShark older than 4.0.0, then you will also need to run the following command on the OVA to update the database:

/usr/cloudshark/bin/database-upgrade

Once your OVA setup is complete, CloudShark will run with its latest version installed, with your database, configuration, and PCAP files stored on a separate data disk. This separation of system and data ensures straightforward version upgrades while keeping all your files in a dedicated storage location. Future updates will be quick and easy, making the maintenance of your CloudShark Enterprise virtual machine a simple process.