PowerFlex Volume migrations for the lazy admin

Don’t you just hate it when you have hundreds of Volumes to move between your Storage Pools? But at the same time, massively enjoy it since you can do this 100% non-disruptively to your users 👍

Currently through the legacy Java GUI, or the new HTML5 UI, there seems (to me) no easy way to set the migration for all of these Volumes in one fell swoop. It is one…. by….. one…

What you will need:

  1. Notepad++
  2. Access to your Master MDM
  3. A coffee? (Don’t bother, this will be over quickly).

Step 1 — Log into your MDM:

scli --login --username admin

Step 2 — Query all your Volumes

scli --query_all_volumes
Protection Domain fc4ac2e500000000 Name: PD-1
Storage Pool e7195f6500000000 Name: SP-SSD-1
Volume ID: 169b8e0600000016 Name: SDC2-7 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned
Volume ID: 169b8e0700000017 Name: SDC2-8 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned
Volume ID: 169b8e0800000018 Name: SDC3-1 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned
Protection Domain fc4ae9f500000001 Name: PD-2-HCI
Storage Pool e719867500000001 Name: SP-1-HCI
Volume ID: 169b8df800000002 Name: SDC1-1 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned
Volume ID: 169b8df900000003 Name: SDC1-2 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned
Volume ID: 169b8dfa00000004 Name: SDC1-3 Size: 8.0 GB (8192 MB) Mapped to 1 SDC Thick-provisioned

Step 3 — Paste this into Notepad++ (I can guarantee there is a much smarter way to do this step with whatever unix tool of your preference, but for me this was the laziest way).

Notepad++ the lazy admin’s friend

Step 4 — Hold down the Alt key, while simultaneously moving your mouse key to select everything except Volume ID’s — and then delete it!

Before…
And after.

You now have everything you need, the Volume ID’s, the Destination Protection Domain ID and the Destination Storage Pool ID.

Step 5 – Use a neat little Regex to transpose your rows into a single space delimited line:

  • Open your file in Notepad++
  • Open the Replace dialog ( Ctrl + H )
  • Check the Wrap around option
  • Choose the Regular expression search mode
  • Fill in the regex (\h*\R)+ in the Find what: zone
  • Fill in the regex \x20 in the Replace with: zone
  • Click on the Replace All button

Source: https://community.notepad-plus-plus.org/topic/14791/how-to-make-all-data-in-one-line/2

Ta-da!

Step 6 — Put the output into your cool little single line bash script:

[root@svm-poflex-1-esxi ~]# for i in 169b8e0600000016 169b8e0700000017 169b8e0800000018; do scli --migrate_vtree --volume_id $i --destination_protection_domain_id fc4ae9f500000001 --destination_storage_pool_id e719867500000001; done

And that’s it! Now go and make that coffee while your wait for your Volumes to migrate over seamlessly and successfully. You’ve earned it you lazy admin!

If you have an even lazier way, please let me know in the comments.