- This topic has 8 replies, 3 voices, and was last updated June 29, 2021 by Joseph L.
VM Journal Used report
-
Nick MJune 25, 2021 10:15:45 AM
Hi,
I’m trying to report on used journal for a VM while it’s in a recovery test but I’m seeing a mismatch between what the ZVM believes is used and what the Zerto API and vcenter believes is used.
I’m seeing the Zerto API and vcenter reporting a higher figure for journal used (almost 100% used) but the ZVM isn’t alerting. The warning threshold is set to much lower than the figure that is being reported by the API and vcenter.
I believe the issue is that the API is reporting on the storage space used and not the journal space being used within the allocated storage space.
The powershell script that I’m using the pull information from the API is below:
########################
#================================================================================================
# Connect to ZVM REST API
#================================================================================================
$ZertoServer = “ZVM IP”
$Credentials = Get-Credential
#================================================================================================
# 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($Credentials.UserName+”:”+$Credentials.GetNetworkCredential().Password))}
$Type = “application/json”add-type @”
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
“@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]’Ssl3,Tls,Tls11,Tls12′$ZertoSessionResponse = Invoke-WebRequest -Method POST -Uri $ZertoSessionURL -Headers $Header -ContentType $Type
# 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
#================================================================================================$volumesURL = $BaseURL+”volumes”
$allvolumes = Invoke-RestMethod -Method GET -Uri $volumesURL -Headers $ZertoSessionHeader -ContentType $Type$VMName = “VM Name”
(($allvolumes | Where-Object {($_.ProtectedVm.Name -eq $VMName) -and ($_.VolumeType -eq “Journal”)}).Size.UsedInBytes | measure -Sum).Sum / 1Mb########################
For the VM in question, this gives me a figure of 4094715 Mb. The warning threshold is set to 4044800 Mb. The ZVM should be alerting but it isn’t. Any ideas?
Thanks in advance, and let me know if you need any more context or would rather speak about this over the phone.
Kalsang DJune 25, 2021 05:04:38 PMHi,
This is Kalsang from Zerto.
Did you check under the VMsettings and verify the hard limit and threshold size, please?
Best,
Nick MJune 28, 2021 07:08:35 AMHi, yep I’ve checked that. For reference they’re:
Hard limit: 4000 GB
Warning threshold: 3950 GBNick MJune 28, 2021 09:50:42 AMI think a more concise way to phrase my query is:
The values that I’m getting from the API are the journal sizes as seen at a storage/hypervisor level. I’d like to know how I can see the journal sizes as seen in the software/ZVM level.
Joseph LJune 28, 2021 01:57:44 PMHello Nick,
You can look at the journal sizes in your analytics for the affected VPGs\VMs. Hope this is helpful.
Thank you,
Joe
Nick MJune 28, 2021 02:21:48 PMHi,
We operate a dark site, is there another way to view this information? Is it accessible through the API?
Joseph LJune 28, 2021 06:42:18 PMHello Nick,
The following is a link to the API guide:
http://s3.amazonaws.com/zertodownload_docs/Marketing_Material/White%20Paper%20-%20Automating%20Zerto%20Virtual%20Replication%20with%20PowerShell%20and%20REST%20APIs.pdf?cb=1624905478
In reviewing the document I see we do have the ability to report on VMs by top journal and recovery storage usage. Hope you find this helpful.
Thank you,
Joe
Nick MJune 29, 2021 07:22:01 AMHi,
Thank you for the link. I tried to use the script however I got a 404 not found. Has this been changed since the document was written?
The URL that it built is below:
https://[zvm ip]:[zvm port]/ZvmService/ResourcesReport/getSamples?fromTimeString=2021-06-29&toTimeString=2021-06-30&startIndex=0&count=500
Could it have been replaced by the below?
https://[zvm ip]:[zvm port]/v1/reports/resources
Joseph LJune 29, 2021 03:11:05 PMHello Nick,
My apologies if the link providing outdated material. Try using the following:
https://docs.api.zerto.com/?_ga=2.68475794.201276582.1624885097-74876513.1578420625
There is a section regarding journal reports, hopefully that can provide you with the desired information.
Thank you,
Joe
The forum ‘Support Q & A’ is closed to new topics and replies.