1 Reply Latest reply on Sep 11, 2018 10:35 PM by DaleCoghlan

    IP Set - Power NSX

    vmguy009 Lurker

      I have an existing IP Set ( say 5 IP address are there)


      IPset A -,,,,


      I will be extracting IP Address from other security group.

      I want to compare these 2 IP addresses. If there is any difference then I want to replace the new IP addresses extracted from the security group to the IPSet A


      EX 1 - IP Address extracted from Security group -,,,,

      There is difference in IP & I need to replace the IP Set with these IP ",,,,"


      EX 2 - IP Address extracted from Security group -,,,,

      No diff - so no action


      If there is no diff I need not do any action.

      Let me know if this is possible using power NSX

        • 1. Re: IP Set - Power NSX
          DaleCoghlan Enthusiast
          VMware Employees

          PowerNSX does not have this capability built-in. You will have to fall back on using PowerShell for the logic to do the comparison.


          A word of warning though. The "value" that is returned by the NSX-v API that contains the IP Addresses, is a single string. The IP Addresses are returned as comma separated values within that single string, but are returned in a random order each and every time you query it. So to do any comparisons, you will need to split them into an array first, then sort them, and then do some form of comparison operation.