- This topic has 2 replies, 2 voices, and was last updated May 17, 2017 by Ted B.
Specify Resource Pools during VPG creation
-
Ted BMay 13, 2017 12:38:32 AM
Hi all!
I’m am trying to figure out how to specify a Resource Pools when creating the VPG using the script from the Automating Zerto whitepaper v2.0. All I am able to do is pick the parent cluster, but not anything underneath it.
As an example, the options presented via $VISiteInfoCMD2 from the script (run after a successful VPG setup via the script) only shows the top level options. I do see options in the script for:
""ResourcePoolIdentifier"":null
However, I do not see where I can pull that information from or specify it in the CSV.
Any help pointing me in the right direction would be great.
Thanks!
Ted
Shashidhar KMay 16, 2017 10:06:27 AMHi Ted,
Have you tried to retrieve the Resource Pool information via the examples on page 21 in the whitepaper?
<code class=”EnlighterJSRAW” data-enlighter-language=”shell”>Getting resource pool info
$VIResourcePoolsURL = $baseURL+”virtualizationsites/$VPGRecoverySiteIdentifier/resourcepools”
$VIResourcePoolsCMD = Invoke-RestMethod -Uri $VIResourcePoolsURL -TimeoutSec 100 -Headers $zertoSessionHeader -ContentType $TypeJSONHere is some additional information from page 22 (under “Getting recovery info”):
<code class=”EnlighterJSRAW” data-enlighter-language=”shell”>$VPGResourcePoolIdentifier = $VPGSettings.Recovery.ResourcePoolIdentifier
and
<code class=”EnlighterJSRAW” data-enlighter-language=”shell”># Getting resource pool name
$VPGResourcePoolName = $VIResourcePoolsCMD | Where-Object {$_.ResourcePoolIdentifier -eq $VPGResourcePoolIdentifier} | select -ExpandProperty ResourcepoolNameand from page 23 to use the property when adding:
<code class=”EnlighterJSRAW” data-enlighter-language=”shell”>$VPGArrayLine | Add-Member -MemberType NoteProperty -Name “VPGDefaultHostIdentifier” -Value $VPGDefaultHostIdentifier
$VPGArrayLine | Add-Member -MemberType NoteProperty -Name “VPGResourcePoolName” -Value $VPGResourcePoolName
$VPGArrayLine | Add-Member -MemberType NoteProperty -Name “VPGResourcePoolIdentifier” -Value $VPGResourcePoolIdentifierSo, I believe you can continue on with that section to come up with what you’re trying to accomplish. I don’t see those xls samples showing Resource Pools (in the “VPG, VM, VDISK, VNIC & Re-IP Settings Report), but if you can query them and export, you can use those names when creating a VPG (assuming since I haven’t personally tested).
Hopefully this gets your going in the right direction.
Follow me: www.twitter.com/HarrySiiiTed BMay 17, 2017 12:08:24 AMThat’s exactly what I needed!
I hadn’t run that Settings Report (on Page 19) before. That’s exactly what I was looking for. I was kinda expecting it to a property of the ClusterIdentifier; however when it wasn’t there, I wasn’t sure where to go.
In case anyone wants to do the same:
Under the section <span style=”color: #339966;”># Running the creation process by VPG, as a VPG can contain multiple VMs</span>, in the foreach loop I added:
$ResourcePool =$VPG.ResourcePool
Under the section <span style=”color: #339966;”># Getting Identifiers for VPG settings</span>, I added:
$VISiteInfoURL5 = $BaseURL+"virtualizationsites/$TargetSiteIdentifier/resourcepools" $VISiteInfoCMD5 = Invoke-RestMethod -Uri $VISiteInfoURL5 -TimeoutSec 100 -Headers $zertosessionHeader -ContentType $ContentType $ResourcePoolIdentifier = $VISiteInfoCMD5 | Where-Object {$_.ResourcepoolName -eq $ResourcePool} | select ResourcePoolIdentifier -ExpandProperty ResourcePoolIdentifier
Under the section <span style=”color: #339966;”># Building JSON Request for posting VPG settings to API</span>, I removed the null in ResourcePoolIdentifier and added the $ResourcePoolIdentifier variable to look like this:
""ResourcePoolIdentifier"":""$ResourcePoolIdentifier""
You will also need a ResourcePool column added to the VPGs CSV to pull that info from.
Thanks for your help, Harry!
Ted
The forum ‘Scripting and APIs’ is closed to new topics and replies.