- This topic has 5 replies, 4 voices, and was last updated March 24, 2017 by Tarandeep S.
Getting IP and Subnet
-
Erez PMarch 17, 2017 02:54:18 PM
Hi,
I am writing a script to query Zerto for VM Source IP/Segment and also Target in DR after Fail Over same VM IP/Segment (since it might change). We didn’t find any way to do it with Zerto CLI. Can you help?
Thanks
Erez
Harry SMarch 18, 2017 01:30:33 AMHi Erez,
I’m checking into this and will get back to you shortly.
~Harry
Follow me: www.twitter.com/HarrySiiiErez PMarch 22, 2017 06:24:56 AMHi, any update?
Thanks
Harry SMarch 23, 2017 05:24:27 PMHi Erez, sorry for the delay.
You should use the VC API or vSphere PowerCLI to get the source IPs.
As for the destination configs, you can get this through the VPGManagement API (there is reference for ZVM for vSphere VPGManagement API reference from the online help).
Thanks!
Harry
Follow me: www.twitter.com/HarrySiiiDrew AMarch 23, 2017 11:17:47 PMThere’s a script in the Zerto White Paper Automating Zerto Replication with PowerShell and REST APIs v2.0.pdf that does what you’re looking to do. I’ve used it to pull these settings and modify them in bulk.
Tarandeep SMarch 24, 2017 01:28:28 PMHI Drew,
I am using this api “<span class=”CodeInLine”>https://</span><span class=”CodeInLine”>zvm_ip</span><span class=”CodeInLine”>:</span><span class=”CodeInLine”>port</span><span class=”CodeInLine”>/v1/vpgSettings/{</span><span class=”Italic”>vpgSettingsIdentifier</span><span class=”CodeInLine”>}/vms/{</span><span class=”Italic”>vmIdentifier</span><span class=”CodeInLine”>}/nics/{</span><span class=”Italic”>nicIdentifier}” </span>
And I get the following information.It contains the nic setting for failover and failovertest NIC of the VM. But not the current IP and subnet of VM.
<table class=”Table” summary=”” cellspacing=”0″>
<tbody>
<tr>
<td>PARAMETER</td>
<td>DESCRIPTION</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Failover</span></td>
<td>Information about the networks used for failover by this virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Hypervisor</span></td>
<td></td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>DnsSuffix</span></td>
<td>The DNS name excluding the host.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>IpConfig</span></td>
<td>Information about the IP configuration of the recovery site used for failovers.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Gateway</span></td>
<td>The mask for the network.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>IsDhcp</span></td>
<td><span class=”Arial9ptBold”>true</span> – DHCP is used for the virtual machine on the recovery site.<span class=”Arial9ptBold”>false</span> – A static IP address is used for the virtual machine on the recovery site.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>PrimaryDns</span></td>
<td>The IP address of the primary DNS server that handles Internet protocol mapping.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>SecondaryDns</span></td>
<td>The IP address of the alternate, secondary, DNS server that handles Internet protocol mapping.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>StaticIp</span></td>
<td>The IP of the restored virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>SubnetMask</span></td>
<td>The subnet mask for the network.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>NetworkIdentifier</span></td>
<td>The network identifier of the network used for failover or move by this virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>ShouldReplaceMacAddress</span></td>
<td><span class=”Arial9ptBold”>true</span> – The Media Access Control (MAC) address used on the protected site is copied to the recovery site.<span class=”Arial9ptBold”>false</span> – The Media Access Control (MAC) address used on the protected site is not copied to the recovery site.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>FailoverTest</span></td>
<td>Information about the networks used for testing failover by this virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Hypervisor</span></td>
<td></td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>DnsSuffix</span></td>
<td>The DNS name excluding the host.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>IpConfig</span></td>
<td>Information about the IP configuration of the recovery site used for testing failovers.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Gateway</span></td>
<td>The mask for the network.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>IsDhcp</span></td>
<td><span class=”Arial9ptBold”>true</span> – DHCP is used for the virtual machine on the recovery site.<span class=”Arial9ptBold”>false</span> – A static IP address is used for the virtual machine on the recovery site.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>PrimaryDns</span></td>
<td>The IP address of the primary DNS server that handles Internet protocol mapping.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>SecondaryDns</span></td>
<td>The IP address of the alternate, secondary, DNS server that handles Internet protocol mapping.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>StaticIp</span></td>
<td>The IP of the restored virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>SubnetMask</span></td>
<td>The subnet mask for the network.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>NetworkIdentifier</span></td>
<td>The network identifier of the network used for testing failover by this virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>ShouldReplaceMacAddress</span></td>
<td><span class=”Arial9ptBold”>true</span> – Copy the Media Access Control (MAC) address used on the protected site to the recovery site.<span class=”Arial9ptBold”>false</span> – Do <span class=”Italic”>not </span>copy the MAC address from the protected site to the recovery site.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>NicIdentifier</span></td>
<td>The identifier of the NIC for which settings are returned.</td>
</tr>
</tbody>
</table>Virtual machine volumesResponse values for <span class=”CodeInLine”>https://</span><span class=”CodeInLine”>zvm_ip</span><span class=”CodeInLine”>:</span><span class=”CodeInLine”>port</span><span class=”CodeInLine”>/v1/vpgSettings/{</span><span class=”Italic”>vpgSettingsIdentifier</span><span class=”CodeInLine”>}/vms/{</span><span class=”Italic”>vmIdentifier</span><span class=”CodeInLine”>}/volumes</span> and.<table class=”Table” summary=”” cellspacing=”0″>
<tbody>
<tr>
<td>PARAMETER</td>
<td>DESCRIPTION</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>Datastore</span></td>
<td>Information about the datastore used by the virtual machine.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>DatastoreIdentifier</span></td>
<td>The identifier of the storage. The identifier comprises the server identifier and the storage moref, with the format, <span class=”Italic”>serverid.moref</span>.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>IsThin</span></td>
<td><span class=”Arial9ptBold”>true</span> – The recovery volumes are thin-provisioned.<span class=”Arial9ptBold”>false</span> – The recovery volumes are <span class=”Italic”>not </span>thin-provisioned.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>ExistingVolume</span></td>
<td>For future use.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>DatastoreIdentifier</span></td>
<td>For future use.</td>
</tr>
<tr>
<td><span class=”Arial9ptBold”>ExistedVmIdentifier</span></td>
<td>For future use.</td>
</tr>
</tbody>
</table>