Collect Nutanix PD Snapshot | Nutanix Community
Skip to main content
Solved

Collect Nutanix PD Snapshot


Forum|alt.badge.img

Hello everyone, 

After some research i saw that there is no opportunities to collect Total Snapshot Usage (Exclusive Usage) per Protection Domain through the API (i’m on 5.15.3 AOS).

As i have lot of VMs per PD, how can i collect this info through Nutanix Cmdlets and obtain this one per PD ? 

 

Thanks.

 

Best answer by JacksonWrath1607

Follow up:

I installed the cmdlets and it is indeed there! Just a bit hidden. It shows up if you add the “-ExpandedOutput” parameter to the “Get-NTNXProtectionDomain” cmdlet. This will give you the number you want in PowerShell:

(Get-NTNXProtectionDomain -PdName <PD_NAME_HERE>).usageStats["dr.exclusive_snapshot_usage_bytes"]

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

6 replies

Forum|alt.badge.img+16
  • Vanguard
  • 588 replies
  • April 8, 2021

If it’s not possible via API there is even less change to get it by cmdlets. There is a 2 part guide on snapshot here on forum maybe you find something usefull: Part 1 part 2


Forum|alt.badge.img
  • Author
  • Adventurer
  • 3 replies
  • April 8, 2021

Hello ! Thanks for the reply.

 

I have 3 PD and i tried the following script :

$NutanixSnapTotalSize = 0
$NutanixSnapList = Get-NTNXProtectionDomainSnapshot


Foreach($NutanixSnap in $NutanixSnapList) { 
$NutanixSnapTotalSize = $NutanixSnapTotalSize + $NutanixSnap.exclusiveUsageInBytes
}
$NutanixSnapTotalSize

 

If i connect on prism console for all my PD i saw more in average 800 Go on Snapshot Exclusive Usage in Total but by script i saw only 46 Go i don’t understand why...


JacksonWrath1607
Forum|alt.badge.img+1

The Prism Element API (the v2 one) does have this stat, under the /protection-domains/{name} endpoint. There’s a “usage_stats” object towards the bottom of the response that has “dr.exclusive_snapshot_usage_bytes”

https://www.nutanix.dev/reference/prism_element/v2/api/protection-domains/get-protection-domains-name-getprotectiondomainbyname

I’m not sure if the cmdlets have this stat though.

On your second question, you can’t sum up snapshot usage like that. Each snapshot only reports the amount of data it’s exclusively using (i.e. if you deleted only that snapshot, that’s how much space it would free). The catch is that there’s usually data that multiple snapshots are relying on; since that’s not “exclusive” to any one snapshot, none of them will report it, but the total number in the PD will reflect it.


JacksonWrath1607
Forum|alt.badge.img+1

Follow up:

I installed the cmdlets and it is indeed there! Just a bit hidden. It shows up if you add the “-ExpandedOutput” parameter to the “Get-NTNXProtectionDomain” cmdlet. This will give you the number you want in PowerShell:

(Get-NTNXProtectionDomain -PdName <PD_NAME_HERE>).usageStats["dr.exclusive_snapshot_usage_bytes"]

 


Forum|alt.badge.img
  • Author
  • Adventurer
  • 3 replies
  • April 12, 2021
JacksonWrath1607 wrote:

Follow up:

I installed the cmdlets and it is indeed there! Just a bit hidden. It shows up if you add the “-ExpandedOutput” parameter to the “Get-NTNXProtectionDomain” cmdlet. This will give you the number you want in PowerShell:

(Get-NTNXProtectionDomain -PdName <PD_NAME_HERE>).usageStats["dr.exclusive_snapshot_usage_bytes"]

 

Many Thanks !

I’ll check today and reply back for my case :).


Forum|alt.badge.img
  • Author
  • Adventurer
  • 3 replies
  • April 12, 2021

Superb i have it ! :). Many thanks :D.