- This topic has 5 replies, 3 voices, and was last updated September 25, 2020 by
Shane S.
Current Journal Size
-
Does anyone know of an easy way to determine the current journal size for a VM or entire VPG?
I’m trying to somehow report on current usage to be proactive before my journal limit alerts go off.
Gijsbert JFebruary 14, 2019 06:50:39 PMThere are 2 ways to do that:
- Use Zerto Analytics (the recently released storage analytics will show you just that)
- If you are running an older version please use the Resource Report (in the Report section of the ZVM UI).
Hope this helps!
Jose Ignacio DSeptember 17, 2020 08:49:34 AMIs there any way to get journal size without using Analytics? Zerto 8.X
Using api or powershell maybe?Gijsbert JSeptember 18, 2020 11:09:21 AMAbsolutely! You can use the Volumes API to achieve that, please see: http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/zvr_apis/volumes_api.htm?tocpath=ZVR%20RESTful%20APIs%7CZerto%20APIs%7C_____18#statusapis_4057192544_2864010
Shane SSeptember 25, 2020 06:40:58 PMHi Jose,
Here is how I am grabbing the info via the Zerto API. You can throw this in a script (make sure to change the $ZertoServer variable) and then pass in the vm name as a parameter like this:
.\JournalSize.ps1 -vmName ‘name_of_vm’
Here is the actual script:
#================================================================================================# Parameters#================================================================================================[CmdletBinding()]param([Parameter(Mandatory)][string]$vmName)#================================================================================================# Connect to ZVM REST API#================================================================================================$ZertoServer = “FQDN_of_ZVM” #ChangeMe!$vmwareCreds = Get-Credential$ZertoUser = $vmwareCreds.UserName$ZertoPassword = [System.Net.NetworkCredential]::new(”,$vmwareCreds.Password).Password#================================================================================================# Building ZVR API string and invoking REST API#================================================================================================$BaseURL = “https://” + $ZertoServer + “:9669/v1/”$ZertoSessionURL = $BaseURL + “session/add”$Header = @{“Authorization” = “Basic “+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($ZertoUser+”:”+$ZertoPassword))}$Type = “application/json”$ZertoSessionResponse = Invoke-WebRequest -Method POST -Uri $ZertoSessionURL -Headers $Header -ContentType $Type -SkipCertificateCheck# Extracting the token from the JSON response$ZertoSession = $ZertoSessionResponse.headers.get_item(“x-zerto-session”)$ZertoSessionHeader = @{“Accept”=”application/json”“x-zerto-session”=”$ZertoSession”}#================================================================================================# Grab Journal Info from API#================================================================================================$vmURL = $BaseURL+”vms”$allVMs = Invoke-RestMethod -Method GET -Uri $vmURL -Headers $ZertoSessionHeader -ContentType $Type -SkipCertificateCheck$vmInfo = $allVMs | Where-Object {$_.vpgname -eq $vmName}$journalStorage_GB = [math]::Round($vmInfo.JournalUsedStorageMb/1024)$journalStorage_GBI’m not sure if you need it, but I also grab the journal hard limit and warning threshold like this:
$currentHardLimit = $vmInfo.JournalHardLimit.LimitValue/1024$currentWarningThreshold = $vmInfo.JournalWarningThreshold.LimitValue/1024I got a lot of info for this script from here: https://virtuallysober.com/