def get_preferred_private_ip(instance):
    """
    The following preference is used:
     * the *second* network interface's private ip address (normally the static ip), if present
     * the first network interface's private ip
    """
    interfaces = instance.interfaces
    if len(interfaces) == 1:
        return interfaces[0].private_ip_address
    else:
        return interfaces[1].private_ip_address