Invoke a snapshot with the cmdlet
Invoke-PsbSnapshotJob. The first time a snapshot is invoked, the Protection Group to use must be figured out or created. Subsequent snapshots only need to declare the Protection Group.
The first example creates a Protection Group with the name psb-2022prev with the Volumes declared in
Path.
Invoke-PsbSnapshotJob -VCenterAddress $vcenterendpoint -VCenterCredential $vcentercredential -FlashArrayAddress $FADNS -FlashArrayCredential $FlashArrayCredential -VolumeSetName volset136 -VolumeType vVol -ComputerAddress $vmname -ComputerCredential $vmcredential -Path 'H:\,F:\' -CreatePgroup -NewPgroupSuffix volset136 -VmName $vmname -VmPersistentId $VMPID
The second example uses the Protection Group already created in the first example which means that it is not the first time the cmdlet has been executed.
Invoke-PsbSnapshotJob -VCenterAddress $vcenterendpoint -VCenterCredential $vcentercredential -FlashArrayAddress $FADNS -FlashArrayCredential $FlashArrayCredential -VolumeSetName volset136 -VolumeType vVol -ComputerAddress $vmname -ComputerCredential $vmcredential -Path 'H:\,F:\' -Pgroupname psb-volset136 -VmName $vmname -VmPersistentId $VMPID
The third example chooses the Protection Group with the fewest number of additional volumes. It will fail is there is not an existing Protection Group that contains all of the declared volumes with
Path.
Invoke-PsbSnapshotJob -VCenterAddress $vcenterendpoint -VCenterCredential $vcentercredential -FlashArrayAddress $FADNS -FlashArrayCredential $FlashArrayCredential -VolumeSetName volset136 -VolumeType vVol -ComputerAddress $vmname -ComputerCredential $vmcredential -Path 'H:\,F:\' -UseBestPgroupMatch -VmName $vmname -VmPersistentId $VMPID