Migrating Ansible Content Collections

Learn how to perform an Ansible migration from one FlashArray to another with live IO.

Ansible Collection Migration

4 minutes
image_pdfimage_print

In this second blog post in the series, I describe how to perform a frequently used process using the Pure Storage® Ansible Collections for FlashArray™ and the modules available in the collection. The first blog post in the series discussed Ansible Collections and how to use them.

Over the years, I have been involved in many, many data migration projects. Believe me, I never want to go through those overnight and weekend marathons again, with all the associated application outages, rollbacks, complexity, and more.

If you had told me back then there would be a simple, push-button way to migrate from one storage array to another, while the application was still running, and there was little or no impact to the application users, I would have told you that you were insane. Well, fast-forward to today: migration nirvana is within your grasp if you are migrating from a one Pure Storage FlashArray to another when you use the FlashArray Ansible Collections.

The rest of this blog post will show how to use Ansible to perform a volume migration from one FlashArray to another, with live IO being performed to the filesystem by the underlying volume. This allows applications to remain active during the whole migration process with little or no impact on their users, and depending on the application there may be a slight increase in response times.

The process has been recorded in this short video, and the playbooks that are used in the video are detailed later in this blog post.

Notice the timestamps in the video. There are no smoke and mirrors here. This is all real-time.

The video shows the creation of a simple volume on a host connected to a single FlashArray running an application that is writing data to the volume. This volume is then migrated, whilst the application is still running, to another FlashArray.

The steps to perform the migration are:

  • Create an ActiveCluster between the two arrays
  • Create an ActiveCluster pod
  • Move the volume to the pod
  • Stretch the pod and let the data synchronise
  • Move the volume out of the pod onto the second array
  • Break the ActiveCluster connection
  • Cleanup the first array.

As I stated above, the first part of this video creates a simple volume, then formats it and mounts it to be ready for an application to write data. The playbook to do this is:

You can also find this in the Pure Storage GitHub account.

The application I use to write data to the volume is a very simple random text generator, which ensures data is continually being written to the volume during the live migration.

The main Ansible playbook performs the actions listed earlier:

  • First, start by creating an ActiveCluster link between the source and target FlashArrays.
Ansible Content Collection Migration

  • Next, create a pod and move the volume into the pod.
Create ActiveCluster Pod for migration

  • Stretch the pod to the target array, which allows the pod to synchronize the volume across the two FlashArrays.
Stretched ActiveCluster Pod for Ansible Migration

At this point, the playbook uses a loop process to wait for the pod to fully synchronize. This is the core part of the migration, and you can see that data is still being written to the volume all the way. Imagine your production database being migrated with zero downtime.

  • After the volume has synchronized, it is connected to the second host and the host sees connections for the volume from both arrays.

  • The volume is disconnected from the source array in the active cluster pod construct. The pod is unstretched and the volume is removed from the pod.

  • Finally, all references to the ActiveCluster are removed, and the source array connections to the host are removed.

The playbook used to perform this migration is:

You can also download from GitHub.

You wouldn’t do this next step in a production environment, but the video continues and uses a playbook to clean up the demonstration environment. This unmounts the file system from the host, deletes the volume on the target array, and removes all references to the target array from the host. The playbook used for this is:

This is also available on the Pure Storage GitHub account.

Each of these playbooks calls a variable file that holds environmental information that allows the migration to occur. An example variable file is available.

If you download these playbooks, please ensure you update the variables file with your settings.

This example only uses iSCSI for the host-volume connection, but I’m sure you could adapt it to support Fibre Channel connectivity. If you do, please upload a copy to the Pure Storage Ansible playbooks examples repository.

flash array test drive