Extract common method for fetching network interface id for instance