build 7bbbddf7 | content blog-content@c8490fa · 338 posts | profiles 20 · corpus 267 | 0 skipped | | format
apiVersion: soultec.ch/v1kind: Postmetadata: name: zerto-automating-vpg-journal-limit-changes locale: de labels: author: dario-doerflinger capability/backup-recovery: 2.18 vendor/vmware: 0.88 annotations: source: blog-content/posts/de/zerto-automating-vpg-journal-limit-changes.md route: /de/insights/zerto-automating-vpg-journal-limit-changes/ schema: /nerd/schema/posts.json markdown: /de/insights/zerto-automating-vpg-journal-limit-changes.mdspec: title: Journal-Limits einer VPG automatisch ändern date: 2018-06-06 author: dario-doerflinger locale: de summary: >- Ich habe einem unserer Kunden geholfen, Zerto einzuführen. Ändert man das Journal-Limit einer VPG, gilt das nicht für die VMs, die schon drin sind. capabilities: [backup-recovery] vendors: [vmware] migrated: 2026-08-24 translationReviewed: false draft: false sections: - body: | Ich habe einem unserer Kunden geholfen, Zerto in seiner Umgebung einzuführen. Wenn du Zerto ausrollst und anfängst, deine VMs damit zu schützen, musst du wissen, welche Anwendungen du zu Virtual Protection Groups (VPGs) zusammenfassen willst. Ausserdem legst du vorher fest, wie weit du mit Zerto zurückgehen können willst, und leitest daraus die Journalgrösse deiner VPGs ab. Nun erzeugen manche VMs viele I/Os, während andere praktisch still sind. Genau das entscheidet, wie viel Platz sie in ihrer VPG brauchen. Für die meisten VPGs reicht das anfangs gesetzte Limit also, um die gewünschte Zeitspanne abzudecken, für die I/O-intensivsten Workloads bei Weitem nicht. Und wenn du dann das Journal-Limit dieser VPG änderst, wird die Einstellung bei den VMs, die bereits in dieser VPG sind, **nicht** nachgeführt. Als wir das zum ersten Mal bemerkten, hielten wir es für einen Fehler und eröffneten einen Fall bei Zerto. Der Support Engineer teilte uns mit, das sei kein Fehler, sondern ein Feature. Der Kunde und wir sahen das anders, also haben wir uns die API von Zerto vorgenommen, um diese unbefriedigende Lage zu ändern. Kurz gesagt: Unten steht ein Script, mit dem du das Journal-Limit einer VPG änderst und danach durch alle VMs dieser VPG gehst und dieselben Werte setzt. Für unseren Anwendungsfall ergibt das genau Sinn. Update: Dieses Script liegt inzwischen auf [GitHub](https://github.com/virtualFrog/PowerCLI-Scripts). ```powershell param( [Parameter(Mandatory = $true)][string]$zvm = "zvm.virtualfrog.wordpress.com", [Parameter(Mandatory = $true)][string]$vpgName = "Test", [Parameter(Mandatory = $true)][Int32]$LimitValueInGB = 300, [Parameter(Mandatory = $true)][Int32]$ThresholdValueInGB = 250 ) #----------------------------------------------------------[Declarations]---------------------------------------------------------- # Build Base URL -> for all RestMethods $baseURL = "https://" + $zvm + ":443/v1/" # New Limit Value in MB $LimitValueInMB = $LimitValueInGB * 1024 # New Warning Threshold in MB $ThresholdValueInMB = $ThresholdValueInGB * 1024 # Responsetype $TypeJSON = "application/json" #-----------------------------------------------------------[Functions]------------------------------------------------------------ Function Get-ZertoSession ($ZertoUser, $ZertoPassword) { # Authenticating with Zerto APIs $xZertoSessionURL = $baseURL + "session/add" $authInfo = ("{0}:{1}" -f $ZertoUser, $ZertoPassword) $authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo) $authInfo = [System.Convert]::ToBase64String($authInfo) $headers = @{Authorization = ("Basic {0}" -f $authInfo)} $sessionBody = '{"AuthenticationMethod": "1"}' # Get Zerto Session Response $xZertoSessionResponse = Invoke-WebRequest -Uri $xZertoSessionURL -Headers $headers -Method POST -Body $sessionBody -ContentType $TypeJSON # Extracting x-zerto-session from the response $xZertoSession = $xZertoSessionResponse.headers.get_item("x-zerto-session") # Return Zerto Session Header return @{"Accept" = "application/json"; "x-zerto-session" = $xZertoSession} } #-----------------------------------------------------------[Execution]------------------------------------------------------------ # Get Zerto Session $zertoSessionHeader = Get-ZertoSession -ZertoUser "virtualFrog" -ZertoPassword "Password" # Get VPG $vpgListUrl = $baseURL + "vpgs" $vpg = Invoke-RestMethod -Uri $vpgListUrl -Headers $zertoSessionHeader -ContentType $TypeJSON #Filter the one from the paramater $vpgToEdit = $vpg |Where-Object {$_.VpgName -eq "$vpgName"} Write-Host "Changing Journal Limit and Threshold Settings of: "($vpgToEdit.VpgName) #Get the identifier of this VPG $VPGidentifier = $vpgToEdit.VpgIdentifier $VPGidentifierJSON = '{"VpgIdentifier":"' + $VPGidentifier + '"}' #$VPGidentifier # Get VPG Settings Identifier $VPGSettingsIDURL = $baseURL + "vpgSettings" $VPGSettingsIdentifier = Invoke-RestMethod -Method Post -Uri $VPGSettingsIDURL -Body $VPGidentifierJSON -ContentType $TypeJSON -Headers $zertoSessionHeader # Set VPG Settings URL $VPGSettingsURL = $baseURL + "vpgSettings/" + $VPGSettingsIdentifier $VPGSettingsBasicURL = $VPGSettingsURL + "/basic" $VPGSettingsJournalURL = $VPGSettingsURL + "/journal" $VPGSettingsCommitURL = $VPGSettingsURL + "/commit" $VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms" # Get the actual VPG Settings $VPGSettings = Invoke-RestMethod -Uri $VPGSettingsURL -Headers $zertoSessionHeader -ContentType $TypeJSON $HardLimitGB = $VPGSettings.Journal.Limitation.HardLimitInMB / 1024 $WarningThresholdGB = $VPGSettings.Journal.Limitation.WarningThresholdInMB / 1024 #Write-Host "Hard Limit of this VPG in GB: " $HardLimitGB #Write-Host "Warning Threshold of this VPG in GB: " $WarningThresholdGB #Change Setting of VPG $VPGSettings.Journal.Limitation.HardLimitInMB = $LimitValueInMB $VPGSettings.Journal.Limitation.WarningThresholdInMB = $ThresholdValueInMB $data = @{Limitation = @{ HardLimitInMB = $LimitValueInMB WarningThresholdInMB = $ThresholdValueInMB } } $json = $data | ConvertTo-Json $vmdata = @{Journal = @{ Limitation = @{ HardLimitInMB = $LimitValueInMB WarningThresholdInMB = $ThresholdValueInMB } } } $vmjson = $vmdata |ConvertTo-Json #Write Change to Zerto $ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsJournalURL -Method Put -Body $json -Headers $zertoSessionHeader -ContentType $TypeJSON foreach ($vm in $VPGSettings.VMs) { $vmIdentifier = $vm.VmIdentifier $VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms/" + $vmIdentifier $VMHardLimitGB = $vm.Journal.Limitation.HardLimitInMB / 1024 $VMWarningThreshold = $vm.Journal.Limitation.WarningThresholdInMB / 1024 #Write-Host "VM ("$vm.VmIdentifier") has Limit of "$VMHardLimitGB " GB and Warning of " $VMWarningThreshold "GB" $ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsVMsJournalURL -Method Put -Body $vmjson -Headers $zertoSessionHeader -ContentType $TypeJSON } $VPGCommit = Invoke-RestMethod -Method Post -Uri $VPGSettingsCommitURL -ContentType $TypeJSON -Headers $zertoSessionHeader Write-Host -ForegroundColor Green "Changed the valued successfully!" ```status: corpus: 267 alsoLike: - {ref: posts/how-to-disaster-recovery-mit-vmware-live-cyber-recovery, score: 1.00} - {ref: posts/changing-default-backup-location-for-mssql-database, score: 1.00} - {ref: solutions/vmware/vmware-cloud-foundation/addon/site-recovery-manager, score: 0.73}
{ "apiVersion": "soultec.ch/v1", "kind": "Post", "metadata": { "name": "zerto-automating-vpg-journal-limit-changes", "locale": "de", "labels": { "author": "dario-doerflinger", "capability/backup-recovery": "2.18", "vendor/vmware": "0.88" }, "annotations": { "source": "blog-content/posts/de/zerto-automating-vpg-journal-limit-changes.md", "route": "/de/insights/zerto-automating-vpg-journal-limit-changes/", "schema": "/nerd/schema/posts.json", "markdown": "/de/insights/zerto-automating-vpg-journal-limit-changes.md" } }, "spec": { "title": "Journal-Limits einer VPG automatisch ändern", "date": "2018-06-06", "author": "dario-doerflinger", "locale": "de", "summary": "Ich habe einem unserer Kunden geholfen, Zerto einzuführen. Ändert man das Journal-Limit einer VPG, gilt das nicht für die VMs, die schon drin sind.", "capabilities": [ "backup-recovery" ], "vendors": [ "vmware" ], "migrated": "2026-08-24", "translationReviewed": false, "draft": false }, "sections": [ { "body": "Ich habe einem unserer Kunden geholfen, Zerto in seiner Umgebung einzuführen. Wenn du Zerto ausrollst und anfängst, deine VMs damit zu schützen, musst du wissen, welche Anwendungen du zu Virtual Protection Groups (VPGs) zusammenfassen willst. Ausserdem legst du vorher fest, wie weit du mit Zerto zurückgehen können willst, und leitest daraus die Journalgrösse deiner VPGs ab.\n\nNun erzeugen manche VMs viele I/Os, während andere praktisch still sind. Genau das entscheidet, wie viel Platz sie in ihrer VPG brauchen. Für die meisten VPGs reicht das anfangs gesetzte Limit also, um die gewünschte Zeitspanne abzudecken, für die I/O-intensivsten Workloads bei Weitem nicht.\n\nUnd wenn du dann das Journal-Limit dieser VPG änderst, wird die Einstellung bei den VMs, die bereits in dieser VPG sind, **nicht** nachgeführt. Als wir das zum ersten Mal bemerkten, hielten wir es für einen Fehler und eröffneten einen Fall bei Zerto. Der Support Engineer teilte uns mit, das sei kein Fehler, sondern ein Feature. Der Kunde und wir sahen das anders, also haben wir uns die API von Zerto vorgenommen, um diese unbefriedigende Lage zu ändern.\n\nKurz gesagt: Unten steht ein Script, mit dem du das Journal-Limit einer VPG änderst und danach durch alle VMs dieser VPG gehst und dieselben Werte setzt. Für unseren Anwendungsfall ergibt das genau Sinn.\n\nUpdate: Dieses Script liegt inzwischen auf [GitHub](https://github.com/virtualFrog/PowerCLI-Scripts).\n\n```powershell\n\nparam(\n[Parameter(Mandatory = $true)][string]$zvm = \"zvm.virtualfrog.wordpress.com\",\n[Parameter(Mandatory = $true)][string]$vpgName = \"Test\",\n[Parameter(Mandatory = $true)][Int32]$LimitValueInGB = 300,\n[Parameter(Mandatory = $true)][Int32]$ThresholdValueInGB = 250\n)\n\n#----------------------------------------------------------[Declarations]----------------------------------------------------------\n\n# Build Base URL -> for all RestMethods\n$baseURL = \"https://\" + $zvm + \":443/v1/\"\n\n# New Limit Value in MB\n$LimitValueInMB = $LimitValueInGB * 1024\n\n# New Warning Threshold in MB\n$ThresholdValueInMB = $ThresholdValueInGB * 1024\n\n# Responsetype\n$TypeJSON = \"application/json\"\n\n#-----------------------------------------------------------[Functions]------------------------------------------------------------\n\nFunction Get-ZertoSession ($ZertoUser, $ZertoPassword) {\n# Authenticating with Zerto APIs\n$xZertoSessionURL = $baseURL + \"session/add\"\n$authInfo = (\"{0}:{1}\" -f $ZertoUser, $ZertoPassword)\n$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)\n$authInfo = [System.Convert]::ToBase64String($authInfo)\n$headers = @{Authorization = (\"Basic {0}\" -f $authInfo)}\n$sessionBody = '{\"AuthenticationMethod\": \"1\"}'\n\n# Get Zerto Session Response\n$xZertoSessionResponse = Invoke-WebRequest -Uri $xZertoSessionURL -Headers $headers -Method POST -Body $sessionBody -ContentType $TypeJSON\n\n# Extracting x-zerto-session from the response\n$xZertoSession = $xZertoSessionResponse.headers.get_item(\"x-zerto-session\")\n\n# Return Zerto Session Header\nreturn @{\"Accept\" = \"application/json\"; \"x-zerto-session\" = $xZertoSession}\n}\n\n#-----------------------------------------------------------[Execution]------------------------------------------------------------\n\n# Get Zerto Session\n$zertoSessionHeader = Get-ZertoSession -ZertoUser \"virtualFrog\" -ZertoPassword \"Password\"\n\n# Get VPG\n$vpgListUrl = $baseURL + \"vpgs\"\n$vpg = Invoke-RestMethod -Uri $vpgListUrl -Headers $zertoSessionHeader -ContentType $TypeJSON\n\n#Filter the one from the paramater\n$vpgToEdit = $vpg |Where-Object {$_.VpgName -eq \"$vpgName\"}\nWrite-Host \"Changing Journal Limit and Threshold Settings of: \"($vpgToEdit.VpgName)\n\n#Get the identifier of this VPG\n$VPGidentifier = $vpgToEdit.VpgIdentifier\n$VPGidentifierJSON = '{\"VpgIdentifier\":\"' + $VPGidentifier + '\"}'\n#$VPGidentifier\n\n# Get VPG Settings Identifier\n$VPGSettingsIDURL = $baseURL + \"vpgSettings\"\n$VPGSettingsIdentifier = Invoke-RestMethod -Method Post -Uri $VPGSettingsIDURL -Body $VPGidentifierJSON -ContentType $TypeJSON -Headers $zertoSessionHeader\n\n# Set VPG Settings URL\n$VPGSettingsURL = $baseURL + \"vpgSettings/\" + $VPGSettingsIdentifier\n$VPGSettingsBasicURL = $VPGSettingsURL + \"/basic\"\n$VPGSettingsJournalURL = $VPGSettingsURL + \"/journal\"\n$VPGSettingsCommitURL = $VPGSettingsURL + \"/commit\"\n$VPGSettingsVMsJournalURL = $VPGSettingsURL + \"/vms\"\n\n# Get the actual VPG Settings\n$VPGSettings = Invoke-RestMethod -Uri $VPGSettingsURL -Headers $zertoSessionHeader -ContentType $TypeJSON\n\n$HardLimitGB = $VPGSettings.Journal.Limitation.HardLimitInMB / 1024\n$WarningThresholdGB = $VPGSettings.Journal.Limitation.WarningThresholdInMB / 1024\n#Write-Host \"Hard Limit of this VPG in GB: \" $HardLimitGB\n#Write-Host \"Warning Threshold of this VPG in GB: \" $WarningThresholdGB\n\n#Change Setting of VPG\n$VPGSettings.Journal.Limitation.HardLimitInMB = $LimitValueInMB\n$VPGSettings.Journal.Limitation.WarningThresholdInMB = $ThresholdValueInMB\n\n$data = @{Limitation = @{\nHardLimitInMB = $LimitValueInMB\nWarningThresholdInMB = $ThresholdValueInMB\n}\n}\n$json = $data | ConvertTo-Json\n\n$vmdata = @{Journal = @{\nLimitation = @{\nHardLimitInMB = $LimitValueInMB\nWarningThresholdInMB = $ThresholdValueInMB\n}\n}\n}\n$vmjson = $vmdata |ConvertTo-Json\n#Write Change to Zerto\n$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsJournalURL -Method Put -Body $json -Headers $zertoSessionHeader -ContentType $TypeJSON\n\nforeach ($vm in $VPGSettings.VMs) {\n$vmIdentifier = $vm.VmIdentifier\n$VPGSettingsVMsJournalURL = $VPGSettingsURL + \"/vms/\" + $vmIdentifier\n$VMHardLimitGB = $vm.Journal.Limitation.HardLimitInMB / 1024\n$VMWarningThreshold = $vm.Journal.Limitation.WarningThresholdInMB / 1024\n\n#Write-Host \"VM (\"$vm.VmIdentifier\") has Limit of \"$VMHardLimitGB \" GB and Warning of \" $VMWarningThreshold \"GB\"\n$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsVMsJournalURL -Method Put -Body $vmjson -Headers $zertoSessionHeader -ContentType $TypeJSON\n\n}\n\n$VPGCommit = Invoke-RestMethod -Method Post -Uri $VPGSettingsCommitURL -ContentType $TypeJSON -Headers $zertoSessionHeader\nWrite-Host -ForegroundColor Green \"Changed the valued successfully!\"\n```" } ], "status": { "corpus": 267, "alsoLike": [ { "ref": "posts/how-to-disaster-recovery-mit-vmware-live-cyber-recovery", "score": "1.00" }, { "ref": "posts/changing-default-backup-location-for-mssql-database", "score": "1.00" }, { "ref": "solutions/vmware/vmware-cloud-foundation/addon/site-recovery-manager", "score": "0.73" } ] }}
apiVersion = "soultec.ch/v1"kind = "Post"[metadata]name = "zerto-automating-vpg-journal-limit-changes"locale = "de"[metadata.labels]author = "dario-doerflinger""capability/backup-recovery" = "2.18""vendor/vmware" = "0.88"[metadata.annotations]source = "blog-content/posts/de/zerto-automating-vpg-journal-limit-changes.md"route = "/de/insights/zerto-automating-vpg-journal-limit-changes/"schema = "/nerd/schema/posts.json"markdown = "/de/insights/zerto-automating-vpg-journal-limit-changes.md"[spec]title = "Journal-Limits einer VPG automatisch ändern"date = 2018-06-06author = "dario-doerflinger"locale = "de"summary = "Ich habe einem unserer Kunden geholfen, Zerto einzuführen. Ändert man das Journal-Limit einer VPG, gilt das nicht für die VMs, die schon drin sind."capabilities = ["backup-recovery"]vendors = ["vmware"]migrated = 2026-08-24translationReviewed = falsedraft = false[[sections]]body = '''Ich habe einem unserer Kunden geholfen, Zerto in seiner Umgebung einzuführen. Wenn du Zerto ausrollst und anfängst, deine VMs damit zu schützen, musst du wissen, welche Anwendungen du zu Virtual Protection Groups (VPGs) zusammenfassen willst. Ausserdem legst du vorher fest, wie weit du mit Zerto zurückgehen können willst, und leitest daraus die Journalgrösse deiner VPGs ab.Nun erzeugen manche VMs viele I/Os, während andere praktisch still sind. Genau das entscheidet, wie viel Platz sie in ihrer VPG brauchen. Für die meisten VPGs reicht das anfangs gesetzte Limit also, um die gewünschte Zeitspanne abzudecken, für die I/O-intensivsten Workloads bei Weitem nicht.Und wenn du dann das Journal-Limit dieser VPG änderst, wird die Einstellung bei den VMs, die bereits in dieser VPG sind, **nicht** nachgeführt. Als wir das zum ersten Mal bemerkten, hielten wir es für einen Fehler und eröffneten einen Fall bei Zerto. Der Support Engineer teilte uns mit, das sei kein Fehler, sondern ein Feature. Der Kunde und wir sahen das anders, also haben wir uns die API von Zerto vorgenommen, um diese unbefriedigende Lage zu ändern.Kurz gesagt: Unten steht ein Script, mit dem du das Journal-Limit einer VPG änderst und danach durch alle VMs dieser VPG gehst und dieselben Werte setzt. Für unseren Anwendungsfall ergibt das genau Sinn.Update: Dieses Script liegt inzwischen auf [GitHub](https://github.com/virtualFrog/PowerCLI-Scripts).```powershellparam([Parameter(Mandatory = $true)][string]$zvm = "zvm.virtualfrog.wordpress.com",[Parameter(Mandatory = $true)][string]$vpgName = "Test",[Parameter(Mandatory = $true)][Int32]$LimitValueInGB = 300,[Parameter(Mandatory = $true)][Int32]$ThresholdValueInGB = 250)#----------------------------------------------------------[Declarations]----------------------------------------------------------# Build Base URL -> for all RestMethods$baseURL = "https://" + $zvm + ":443/v1/"# New Limit Value in MB$LimitValueInMB = $LimitValueInGB * 1024# New Warning Threshold in MB$ThresholdValueInMB = $ThresholdValueInGB * 1024# Responsetype$TypeJSON = "application/json"#-----------------------------------------------------------[Functions]------------------------------------------------------------Function Get-ZertoSession ($ZertoUser, $ZertoPassword) {# Authenticating with Zerto APIs$xZertoSessionURL = $baseURL + "session/add"$authInfo = ("{0}:{1}" -f $ZertoUser, $ZertoPassword)$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)$authInfo = [System.Convert]::ToBase64String($authInfo)$headers = @{Authorization = ("Basic {0}" -f $authInfo)}$sessionBody = '{"AuthenticationMethod": "1"}'# Get Zerto Session Response$xZertoSessionResponse = Invoke-WebRequest -Uri $xZertoSessionURL -Headers $headers -Method POST -Body $sessionBody -ContentType $TypeJSON# Extracting x-zerto-session from the response$xZertoSession = $xZertoSessionResponse.headers.get_item("x-zerto-session")# Return Zerto Session Headerreturn @{"Accept" = "application/json"; "x-zerto-session" = $xZertoSession}}#-----------------------------------------------------------[Execution]------------------------------------------------------------# Get Zerto Session$zertoSessionHeader = Get-ZertoSession -ZertoUser "virtualFrog" -ZertoPassword "Password"# Get VPG$vpgListUrl = $baseURL + "vpgs"$vpg = Invoke-RestMethod -Uri $vpgListUrl -Headers $zertoSessionHeader -ContentType $TypeJSON#Filter the one from the paramater$vpgToEdit = $vpg |Where-Object {$_.VpgName -eq "$vpgName"}Write-Host "Changing Journal Limit and Threshold Settings of: "($vpgToEdit.VpgName)#Get the identifier of this VPG$VPGidentifier = $vpgToEdit.VpgIdentifier$VPGidentifierJSON = '{"VpgIdentifier":"' + $VPGidentifier + '"}'#$VPGidentifier# Get VPG Settings Identifier$VPGSettingsIDURL = $baseURL + "vpgSettings"$VPGSettingsIdentifier = Invoke-RestMethod -Method Post -Uri $VPGSettingsIDURL -Body $VPGidentifierJSON -ContentType $TypeJSON -Headers $zertoSessionHeader# Set VPG Settings URL$VPGSettingsURL = $baseURL + "vpgSettings/" + $VPGSettingsIdentifier$VPGSettingsBasicURL = $VPGSettingsURL + "/basic"$VPGSettingsJournalURL = $VPGSettingsURL + "/journal"$VPGSettingsCommitURL = $VPGSettingsURL + "/commit"$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms"# Get the actual VPG Settings$VPGSettings = Invoke-RestMethod -Uri $VPGSettingsURL -Headers $zertoSessionHeader -ContentType $TypeJSON$HardLimitGB = $VPGSettings.Journal.Limitation.HardLimitInMB / 1024$WarningThresholdGB = $VPGSettings.Journal.Limitation.WarningThresholdInMB / 1024#Write-Host "Hard Limit of this VPG in GB: " $HardLimitGB#Write-Host "Warning Threshold of this VPG in GB: " $WarningThresholdGB#Change Setting of VPG$VPGSettings.Journal.Limitation.HardLimitInMB = $LimitValueInMB$VPGSettings.Journal.Limitation.WarningThresholdInMB = $ThresholdValueInMB$data = @{Limitation = @{HardLimitInMB = $LimitValueInMBWarningThresholdInMB = $ThresholdValueInMB}}$json = $data | ConvertTo-Json$vmdata = @{Journal = @{Limitation = @{HardLimitInMB = $LimitValueInMBWarningThresholdInMB = $ThresholdValueInMB}}}$vmjson = $vmdata |ConvertTo-Json#Write Change to Zerto$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsJournalURL -Method Put -Body $json -Headers $zertoSessionHeader -ContentType $TypeJSONforeach ($vm in $VPGSettings.VMs) {$vmIdentifier = $vm.VmIdentifier$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms/" + $vmIdentifier$VMHardLimitGB = $vm.Journal.Limitation.HardLimitInMB / 1024$VMWarningThreshold = $vm.Journal.Limitation.WarningThresholdInMB / 1024#Write-Host "VM ("$vm.VmIdentifier") has Limit of "$VMHardLimitGB " GB and Warning of " $VMWarningThreshold "GB"$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsVMsJournalURL -Method Put -Body $vmjson -Headers $zertoSessionHeader -ContentType $TypeJSON}$VPGCommit = Invoke-RestMethod -Method Post -Uri $VPGSettingsCommitURL -ContentType $TypeJSON -Headers $zertoSessionHeaderWrite-Host -ForegroundColor Green "Changed the valued successfully!"```'''[status]corpus = 267[[status.alsoLike]]ref = "posts/how-to-disaster-recovery-mit-vmware-live-cyber-recovery"score = "1.00"[[status.alsoLike]]ref = "posts/changing-default-backup-location-for-mssql-database"score = "1.00"[[status.alsoLike]]ref = "solutions/vmware/vmware-cloud-foundation/addon/site-recovery-manager"score = "0.73"
<?xml version="1.0" encoding="UTF-8"?><manifest kind="Post"> <apiVersion>soultec.ch/v1</apiVersion> <metadata> <name>zerto-automating-vpg-journal-limit-changes</name> <locale>de</locale> <labels> <author>dario-doerflinger</author> <entry key="capability/backup-recovery">2.18</entry> <entry key="vendor/vmware">0.88</entry> </labels> <annotations> <source>blog-content/posts/de/zerto-automating-vpg-journal-limit-changes.md</source> <route>/de/insights/zerto-automating-vpg-journal-limit-changes/</route> <schema>/nerd/schema/posts.json</schema> <markdown>/de/insights/zerto-automating-vpg-journal-limit-changes.md</markdown> </annotations> </metadata> <spec> <title>Journal-Limits einer VPG automatisch ändern</title> <date>2018-06-06</date> <author>dario-doerflinger</author> <locale>de</locale> <summary>Ich habe einem unserer Kunden geholfen, Zerto einzuführen. Ändert man das Journal-Limit einer VPG, gilt das nicht für die VMs, die schon drin sind.</summary> <capabilities> <item>backup-recovery</item> </capabilities> <vendors> <item>vmware</item> </vendors> <migrated>2026-08-24</migrated> <translationReviewed>false</translationReviewed> <draft>false</draft> </spec> <sections> <section> <body>Ich habe einem unserer Kunden geholfen, Zerto in seiner Umgebung einzuführen. Wenn du Zerto ausrollst und anfängst, deine VMs damit zu schützen, musst du wissen, welche Anwendungen du zu Virtual Protection Groups (VPGs) zusammenfassen willst. Ausserdem legst du vorher fest, wie weit du mit Zerto zurückgehen können willst, und leitest daraus die Journalgrösse deiner VPGs ab.Nun erzeugen manche VMs viele I/Os, während andere praktisch still sind. Genau das entscheidet, wie viel Platz sie in ihrer VPG brauchen. Für die meisten VPGs reicht das anfangs gesetzte Limit also, um die gewünschte Zeitspanne abzudecken, für die I/O-intensivsten Workloads bei Weitem nicht.Und wenn du dann das Journal-Limit dieser VPG änderst, wird die Einstellung bei den VMs, die bereits in dieser VPG sind, **nicht** nachgeführt. Als wir das zum ersten Mal bemerkten, hielten wir es für einen Fehler und eröffneten einen Fall bei Zerto. Der Support Engineer teilte uns mit, das sei kein Fehler, sondern ein Feature. Der Kunde und wir sahen das anders, also haben wir uns die API von Zerto vorgenommen, um diese unbefriedigende Lage zu ändern.Kurz gesagt: Unten steht ein Script, mit dem du das Journal-Limit einer VPG änderst und danach durch alle VMs dieser VPG gehst und dieselben Werte setzt. Für unseren Anwendungsfall ergibt das genau Sinn.Update: Dieses Script liegt inzwischen auf [GitHub](https://github.com/virtualFrog/PowerCLI-Scripts).```powershellparam([Parameter(Mandatory = $true)][string]$zvm = "zvm.virtualfrog.wordpress.com",[Parameter(Mandatory = $true)][string]$vpgName = "Test",[Parameter(Mandatory = $true)][Int32]$LimitValueInGB = 300,[Parameter(Mandatory = $true)][Int32]$ThresholdValueInGB = 250)#----------------------------------------------------------[Declarations]----------------------------------------------------------# Build Base URL -&gt; for all RestMethods$baseURL = "https://" + $zvm + ":443/v1/"# New Limit Value in MB$LimitValueInMB = $LimitValueInGB * 1024# New Warning Threshold in MB$ThresholdValueInMB = $ThresholdValueInGB * 1024# Responsetype$TypeJSON = "application/json"#-----------------------------------------------------------[Functions]------------------------------------------------------------Function Get-ZertoSession ($ZertoUser, $ZertoPassword) {# Authenticating with Zerto APIs$xZertoSessionURL = $baseURL + "session/add"$authInfo = ("{0}:{1}" -f $ZertoUser, $ZertoPassword)$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)$authInfo = [System.Convert]::ToBase64String($authInfo)$headers = @{Authorization = ("Basic {0}" -f $authInfo)}$sessionBody = '{"AuthenticationMethod": "1"}'# Get Zerto Session Response$xZertoSessionResponse = Invoke-WebRequest -Uri $xZertoSessionURL -Headers $headers -Method POST -Body $sessionBody -ContentType $TypeJSON# Extracting x-zerto-session from the response$xZertoSession = $xZertoSessionResponse.headers.get_item("x-zerto-session")# Return Zerto Session Headerreturn @{"Accept" = "application/json"; "x-zerto-session" = $xZertoSession}}#-----------------------------------------------------------[Execution]------------------------------------------------------------# Get Zerto Session$zertoSessionHeader = Get-ZertoSession -ZertoUser "virtualFrog" -ZertoPassword "Password"# Get VPG$vpgListUrl = $baseURL + "vpgs"$vpg = Invoke-RestMethod -Uri $vpgListUrl -Headers $zertoSessionHeader -ContentType $TypeJSON#Filter the one from the paramater$vpgToEdit = $vpg |Where-Object {$_.VpgName -eq "$vpgName"}Write-Host "Changing Journal Limit and Threshold Settings of: "($vpgToEdit.VpgName)#Get the identifier of this VPG$VPGidentifier = $vpgToEdit.VpgIdentifier$VPGidentifierJSON = '{"VpgIdentifier":"' + $VPGidentifier + '"}'#$VPGidentifier# Get VPG Settings Identifier$VPGSettingsIDURL = $baseURL + "vpgSettings"$VPGSettingsIdentifier = Invoke-RestMethod -Method Post -Uri $VPGSettingsIDURL -Body $VPGidentifierJSON -ContentType $TypeJSON -Headers $zertoSessionHeader# Set VPG Settings URL$VPGSettingsURL = $baseURL + "vpgSettings/" + $VPGSettingsIdentifier$VPGSettingsBasicURL = $VPGSettingsURL + "/basic"$VPGSettingsJournalURL = $VPGSettingsURL + "/journal"$VPGSettingsCommitURL = $VPGSettingsURL + "/commit"$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms"# Get the actual VPG Settings$VPGSettings = Invoke-RestMethod -Uri $VPGSettingsURL -Headers $zertoSessionHeader -ContentType $TypeJSON$HardLimitGB = $VPGSettings.Journal.Limitation.HardLimitInMB / 1024$WarningThresholdGB = $VPGSettings.Journal.Limitation.WarningThresholdInMB / 1024#Write-Host "Hard Limit of this VPG in GB: " $HardLimitGB#Write-Host "Warning Threshold of this VPG in GB: " $WarningThresholdGB#Change Setting of VPG$VPGSettings.Journal.Limitation.HardLimitInMB = $LimitValueInMB$VPGSettings.Journal.Limitation.WarningThresholdInMB = $ThresholdValueInMB$data = @{Limitation = @{HardLimitInMB = $LimitValueInMBWarningThresholdInMB = $ThresholdValueInMB}}$json = $data | ConvertTo-Json$vmdata = @{Journal = @{Limitation = @{HardLimitInMB = $LimitValueInMBWarningThresholdInMB = $ThresholdValueInMB}}}$vmjson = $vmdata |ConvertTo-Json#Write Change to Zerto$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsJournalURL -Method Put -Body $json -Headers $zertoSessionHeader -ContentType $TypeJSONforeach ($vm in $VPGSettings.VMs) {$vmIdentifier = $vm.VmIdentifier$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms/" + $vmIdentifier$VMHardLimitGB = $vm.Journal.Limitation.HardLimitInMB / 1024$VMWarningThreshold = $vm.Journal.Limitation.WarningThresholdInMB / 1024#Write-Host "VM ("$vm.VmIdentifier") has Limit of "$VMHardLimitGB " GB and Warning of " $VMWarningThreshold "GB"$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsVMsJournalURL -Method Put -Body $vmjson -Headers $zertoSessionHeader -ContentType $TypeJSON}$VPGCommit = Invoke-RestMethod -Method Post -Uri $VPGSettingsCommitURL -ContentType $TypeJSON -Headers $zertoSessionHeaderWrite-Host -ForegroundColor Green "Changed the valued successfully!"``` </body> </section> </sections> <status> <corpus>267</corpus> <alsoLike> <item> <ref>posts/how-to-disaster-recovery-mit-vmware-live-cyber-recovery</ref> <score>1.00</score> </item> <item> <ref>posts/changing-default-backup-location-for-mssql-database</ref> <score>1.00</score> </item> <item> <ref>solutions/vmware/vmware-cloud-foundation/addon/site-recovery-manager</ref> <score>0.73</score> </item> </alsoLike> </status></manifest>
Beitrag · 2018-06-06

Journal-Limits einer VPG automatisch ändern

Ich habe einem unserer Kunden geholfen, Zerto einzuführen. Ändert man das Journal-Limit einer VPG, gilt das nicht für die VMs, die schon drin sind.

2018-06-06Datum
Dario DörflingerAutor
3Min. Lesezeit
Themen Backup und Recovery 2.18
Hersteller VMware 0.88

Dieser Beitrag ist von 2018. Er bleibt online, weil er nach wie vor nachgefragt wird, beschreibt aber einen Produktstand von damals.

Ich habe einem unserer Kunden geholfen, Zerto in seiner Umgebung einzuführen. Wenn du Zerto ausrollst und anfängst, deine VMs damit zu schützen, musst du wissen, welche Anwendungen du zu Virtual Protection Groups (VPGs) zusammenfassen willst. Ausserdem legst du vorher fest, wie weit du mit Zerto zurückgehen können willst, und leitest daraus die Journalgrösse deiner VPGs ab.

Nun erzeugen manche VMs viele I/Os, während andere praktisch still sind. Genau das entscheidet, wie viel Platz sie in ihrer VPG brauchen. Für die meisten VPGs reicht das anfangs gesetzte Limit also, um die gewünschte Zeitspanne abzudecken, für die I/O-intensivsten Workloads bei Weitem nicht.

Und wenn du dann das Journal-Limit dieser VPG änderst, wird die Einstellung bei den VMs, die bereits in dieser VPG sind, nicht nachgeführt. Als wir das zum ersten Mal bemerkten, hielten wir es für einen Fehler und eröffneten einen Fall bei Zerto. Der Support Engineer teilte uns mit, das sei kein Fehler, sondern ein Feature. Der Kunde und wir sahen das anders, also haben wir uns die API von Zerto vorgenommen, um diese unbefriedigende Lage zu ändern.

Kurz gesagt: Unten steht ein Script, mit dem du das Journal-Limit einer VPG änderst und danach durch alle VMs dieser VPG gehst und dieselben Werte setzt. Für unseren Anwendungsfall ergibt das genau Sinn.

Update: Dieses Script liegt inzwischen auf GitHub.


param(
[Parameter(Mandatory = $true)][string]$zvm = "zvm.virtualfrog.wordpress.com",
[Parameter(Mandatory = $true)][string]$vpgName = "Test",
[Parameter(Mandatory = $true)][Int32]$LimitValueInGB = 300,
[Parameter(Mandatory = $true)][Int32]$ThresholdValueInGB = 250
)

#----------------------------------------------------------[Declarations]----------------------------------------------------------

# Build Base URL -> for all RestMethods
$baseURL = "https://" + $zvm + ":443/v1/"

# New Limit Value in MB
$LimitValueInMB = $LimitValueInGB * 1024

# New Warning Threshold in MB
$ThresholdValueInMB = $ThresholdValueInGB * 1024

# Responsetype
$TypeJSON = "application/json"

#-----------------------------------------------------------[Functions]------------------------------------------------------------

Function Get-ZertoSession ($ZertoUser, $ZertoPassword) {
# Authenticating with Zerto APIs
$xZertoSessionURL = $baseURL + "session/add"
$authInfo = ("{0}:{1}" -f $ZertoUser, $ZertoPassword)
$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)
$authInfo = [System.Convert]::ToBase64String($authInfo)
$headers = @{Authorization = ("Basic {0}" -f $authInfo)}
$sessionBody = '{"AuthenticationMethod": "1"}'

# Get Zerto Session Response
$xZertoSessionResponse = Invoke-WebRequest -Uri $xZertoSessionURL -Headers $headers -Method POST -Body $sessionBody -ContentType $TypeJSON

# Extracting x-zerto-session from the response
$xZertoSession = $xZertoSessionResponse.headers.get_item("x-zerto-session")

# Return Zerto Session Header
return @{"Accept" = "application/json"; "x-zerto-session" = $xZertoSession}
}

#-----------------------------------------------------------[Execution]------------------------------------------------------------

# Get Zerto Session
$zertoSessionHeader = Get-ZertoSession -ZertoUser "virtualFrog" -ZertoPassword "Password"

# Get VPG
$vpgListUrl = $baseURL + "vpgs"
$vpg = Invoke-RestMethod -Uri $vpgListUrl -Headers $zertoSessionHeader -ContentType $TypeJSON

#Filter the one from the paramater
$vpgToEdit = $vpg |Where-Object {$_.VpgName -eq "$vpgName"}
Write-Host "Changing Journal Limit and Threshold Settings of: "($vpgToEdit.VpgName)

#Get the identifier of this VPG
$VPGidentifier = $vpgToEdit.VpgIdentifier
$VPGidentifierJSON = '{"VpgIdentifier":"' + $VPGidentifier + '"}'
#$VPGidentifier

# Get VPG Settings Identifier
$VPGSettingsIDURL = $baseURL + "vpgSettings"
$VPGSettingsIdentifier = Invoke-RestMethod -Method Post -Uri $VPGSettingsIDURL -Body $VPGidentifierJSON -ContentType $TypeJSON -Headers $zertoSessionHeader

# Set VPG Settings URL
$VPGSettingsURL = $baseURL + "vpgSettings/" + $VPGSettingsIdentifier
$VPGSettingsBasicURL = $VPGSettingsURL + "/basic"
$VPGSettingsJournalURL = $VPGSettingsURL + "/journal"
$VPGSettingsCommitURL = $VPGSettingsURL + "/commit"
$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms"

# Get the actual VPG Settings
$VPGSettings = Invoke-RestMethod -Uri $VPGSettingsURL -Headers $zertoSessionHeader -ContentType $TypeJSON

$HardLimitGB = $VPGSettings.Journal.Limitation.HardLimitInMB / 1024
$WarningThresholdGB = $VPGSettings.Journal.Limitation.WarningThresholdInMB / 1024
#Write-Host "Hard Limit of this VPG in GB: " $HardLimitGB
#Write-Host "Warning Threshold of this VPG in GB: " $WarningThresholdGB

#Change Setting of VPG
$VPGSettings.Journal.Limitation.HardLimitInMB = $LimitValueInMB
$VPGSettings.Journal.Limitation.WarningThresholdInMB = $ThresholdValueInMB

$data = @{Limitation = @{
HardLimitInMB = $LimitValueInMB
WarningThresholdInMB = $ThresholdValueInMB
}
}
$json = $data | ConvertTo-Json

$vmdata = @{Journal = @{
Limitation = @{
HardLimitInMB = $LimitValueInMB
WarningThresholdInMB = $ThresholdValueInMB
}
}
}
$vmjson = $vmdata |ConvertTo-Json
#Write Change to Zerto
$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsJournalURL -Method Put -Body $json -Headers $zertoSessionHeader -ContentType $TypeJSON

foreach ($vm in $VPGSettings.VMs) {
$vmIdentifier = $vm.VmIdentifier
$VPGSettingsVMsJournalURL = $VPGSettingsURL + "/vms/" + $vmIdentifier
$VMHardLimitGB = $vm.Journal.Limitation.HardLimitInMB / 1024
$VMWarningThreshold = $vm.Journal.Limitation.WarningThresholdInMB / 1024

#Write-Host "VM ("$vm.VmIdentifier") has Limit of "$VMHardLimitGB " GB and Warning of " $VMWarningThreshold "GB"
$ChangedVPG = Invoke-RestMethod -Uri $VPGSettingsVMsJournalURL -Method Put -Body $vmjson -Headers $zertoSessionHeader -ContentType $TypeJSON

}

$VPGCommit = Invoke-RestMethod -Method Post -Uri $VPGSettingsCommitURL -ContentType $TypeJSON -Headers $zertoSessionHeader
Write-Host -ForegroundColor Green "Changed the valued successfully!"

Passt ausserdem