NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

Flexclone list?

DJBAKER123
5,926 Views

Is there an OnTap powershell command (or something someone wrote) that can display Volume Flexclones?  I want to retrieve a list of flexclone volumes with their parent snapshot, similar to what is seem in filerview -> Volumes->flexclone volumes->manage.

Thanks,

Dan

1 ACCEPTED SOLUTION

lobanov
5,927 Views

Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "<parent volume name>"}

Let say my <patent volume name> is Win2K8R2SP1_MASTER, Executing command:

Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "Win2K8R2SP1_MASTER"}

gives me list of all FlexClones created from Win2K8R2SP1_MASTER volume. Also using $_.CloneParent[0].ParentSnapshotName in Where statement can add additional filtering for specific snapshot used for FlexClone.

If you want to display list of Flex Clones with their Parent Volume and Snapshot:

$FlexClones = Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "<parent volume name>"}

ForEach  ($FlexClone in FlexClones)

{

  $FlexClone.Name

  $FlexClone.CloneParent[0].ParentVolumeName

  $FlexClone.CloneParent[0].ParentSnapshotName

}

View solution in original post

2 REPLIES 2

lobanov
5,928 Views

Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "<parent volume name>"}

Let say my <patent volume name> is Win2K8R2SP1_MASTER, Executing command:

Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "Win2K8R2SP1_MASTER"}

gives me list of all FlexClones created from Win2K8R2SP1_MASTER volume. Also using $_.CloneParent[0].ParentSnapshotName in Where statement can add additional filtering for specific snapshot used for FlexClone.

If you want to display list of Flex Clones with their Parent Volume and Snapshot:

$FlexClones = Get-NaVol | Where {$_.CloneParent -ne $null -and $_.CloneParent[0].ParentVolumeName -eq "<parent volume name>"}

ForEach  ($FlexClone in FlexClones)

{

  $FlexClone.Name

  $FlexClone.CloneParent[0].ParentVolumeName

  $FlexClone.CloneParent[0].ParentSnapshotName

}

DJBAKER123
5,927 Views

Awesome, that works, thanks!

Public