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.

    There are 2 ways to do that:

    1. Use Zerto Analytics (the recently released storage analytics will show you just that)
    2. If you are running an older version please use the Resource Report (in the Report section of the ZVM UI).

    Hope this helps!

    Looks like that did the trick.  Thanks for your quick response!

    Is there any way to get journal size without using Analytics?  Zerto 8.X
    Using api or powershell maybe?

    Hi 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_GB

    I’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/1024

     

    I got a lot of info for this script from here: https://virtuallysober.com/

The forum ‘VMware’ is closed to new topics and replies.