def ip_port_hostname_from_svname(svname):
    """This parses the haproxy svname that smartstack creates, which is in the form ip:port_hostname.

    :param svname: A string in the format ip:port_hostname
    :returns ip_port_hostname: A tuple of ip, port, hostname.
    """
    ip, port_hostname = svname.split(':', 1)
    port, hostname = port_hostname.split('_', 1)
    return ip, int(port), hostname