code: public static String getPrivateIp(InstanceInfo instanceInfo) {
          String defaultPrivateIp = null;
          if (instanceInfo.getDataCenterInfo() instanceof AmazonInfo) {
              defaultPrivateIp = ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.localIpv4);
          }
  
          if (isNullOrEmpty(defaultPrivateIp)) {
              // no other information, best effort
              defaultPrivateIp = instanceInfo.getIPAddr();
          }
  
          return defaultPrivateIp;
      }
docs: return the privateIp address of the given InstanceInfo record. The record could be for the local server
  or a remote server.
  
  @param instanceInfo
  @return the private Ip (also known as localIpv4 in ec2)