VMware and FlashArray PowerShell GUI tool v2.7

Quick post. I updated my PowerShell GUI tool I maintain for VMware and FlashArray management and added some new features. This time mainly around protection group management. Download it from my GitHub page here:

https://github.com/codyhosterman/powercli/blob/master/PureStorageVMwareStorageTool.ps1

In version 2.5, the tool had features like:

  1. VMFS management (create, snapshot, delete, etc)
  2. VM management (recover from snapshot, restore)
  3. RDM management (recover from snapshot, restore)
  4. Host setup (configure iSCSI, multipathing, host group creation)

I have added support for protection group management in the 2.7.0 release.

A protection group on the FlashArray is a consistency group with a local snapshot policy and/or a replication policy applied. When a pgroup snapshot is created (either manually or via the policy) all of the volumes in the group are snapshotted in a write-consistent fashion (and replicated to one or more FlashArrays if configured). This snapshot group can be recovered from, or cloned from or whatever. My tool now support automating this recovery.

The “recover” process is the following:

  1. Choose a FlashArray
  2. Choose a protection group
  3. Choose a snapshot group (AKA point-in-time)
  4. Then choose, one, some of all of the volumes in the pgroup
  5. Choose a VMware cluster to recover to
  6. Choose for it to find all of the VMs on the recovered datastores and register them and also optionally power them on

The process will take the selected volume snapshots in the group point-in-time and copy them to new volumes, and then connect it to the host group for the respective VMware cluster.

Then, it will rescan the cluster (I put some parallelism into the script so it will rescan all hosts at once, instead of one at a time). It will then look for the unresolved VMFS volumes (info on what that means can be found here).

If it cannot find all of the ones you specified the process will fail and the copied volumes will be cleaned up. So, basically they need to all be VMFS volumes.

The volumes will then be resignatured and made available to end-users.

If you have chosen to register the VMs, it will search all recovered datastores and register the VMs to random hosts in the cluster (this is also parallelized). If the VM comes up with a MAC conflict, it will be unregistered and registered back to clean up the alarm and reset the MAC.

If the VMs are registered where the original VMs are, it will rename them slightly according to VMware’s standards (adding a (1) etc.).

If you chose to have it power them on it will power them all on too. This works on local snapshots or replicated snapshots.

See a demo here:

Other features in 2.7.0

I also added the ability to delete and create new pgroup snapshot Point-In-Times.

Also to add datastores to pgroups:

When you choose a pgroup, in the right box a checkbox list of datastores in that vCenter (that are on the same array as the pgroup) will appear. You can then check the ones you want and click add. That will add the volumes hosting the VMFS datastores to that pgroup.

Beyond that, just some bug fixes here and there. Our official vSphere Web Client Plugin for the FlashArray has most of these features (and a few extras). But this does sometimes serve as a preview to new plugin features for us to trial. Though do stay tuned, a new plugin with some cool features will be coming out soon!

 

 

13 Replies to “VMware and FlashArray PowerShell GUI tool v2.7”

  1. When selecting a point in time under protection group recovery I get [{“pure_err_key”: “err.friendly”, “code”: 6, “ctx”: “*”, “pure_err_code”: 1, “msg”: “Volume does not exist.”}]

    1. Interesting. Looking into this, I send in an asterisk to get all of the snapshots and sort by snapshot group name. Seems your array doesnt like the wild card. Stay tuned.

      1. I have tested this against many REST versions and it seems to work for all. The issue (I believe) is when i run get-pfavolumesnapshots and have the parameter of -volumename as *. For some reason I think your array doesn’t like that. Can you open a ticket with [email protected] and mention our discussion?

      2. I am seeing the same issue with this tool. Haven’t figured it out yet but know everything else is ok, I can run a script I wrote to get most recent snapshot and create the volume.

        1. I haven’t been able to reproduce this yet. Andy–do you mind opening a support ticket with Pure support, and mentioning this conversation/me? We can get on a web meeting along support to figure out what is going on.

          1. So it seems that this problem is due to old Purity versions (4.7 and earlier). We don’t support wildcards prior to Purity 4.8, which is the root of the problem. So to use this feature you need to make sure your array is on 4.8 or later.

    1. Your support TSE reached out to me on this as well. Let me look into this today–generally I am trying to encourage people to look at using the module these days as it is much more flexible and simpler to support/use. Stay tuned.

  2. I get the following errors when trying to use this:

    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:677 char:125
    + … mdevice.Backing.fileName) ($($vmdevice.CapacityInKB/1024/1024) GB)”))
    + ~~
    Unexpected token ‘GB’ in expression or statement.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:677 char:124
    + … mdevice.Backing.fileName) ($($vmdevice.CapacityInKB/1024/1024) GB)”))
    + ~
    Missing closing ‘)’ in expression.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:38 char:9
    + {
    + ~
    Missing closing ‘}’ in statement block or type definition.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:36 char:5
    + {
    + ~
    Missing closing ‘}’ in statement block or type definition.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:26 char:142
    + … ntinue)) -and (!(get-Module -Name VMware.PowerCLI -ListAvailable))) {
    + ~
    Missing closing ‘}’ in statement block or type definition.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:677 char:127
    + … mdevice.Backing.fileName) ($($vmdevice.CapacityInKB/1024/1024) GB)”))
    + ~
    Unexpected token ‘)’ in expression or statement.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:688 char:49
    + $VMDKDropDownBox.Items.Add(“No virtual disks foun …
    + ~~
    Unexpected token ‘No’ in expression or statement.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:711 char:132
    + … viceName.substring(14,32)) ($($vmdevice.CapacityInKB/1024/1024) GB)”)
    + ~~
    Unexpected token ‘GB’ in expression or statement.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:711 char:131
    + … viceName.substring(14,32)) ($($vmdevice.CapacityInKB/1024/1024) GB)”)
    + ~
    Missing closing ‘)’ in expression.
    At C:\Users\mihucks.HTCITS\Desktop\vmrestore.ps1:711 char:134
    + … viceName.substring(14,32)) ($($vmdevice.CapacityInKB/1024/1024) GB)”)
    + ~
    Unexpected token ‘)’ in expression or statement.
    Not all parse errors were reported. Correct the reported errors and try again.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.