def get_vnc_port_for_instance(instance_name):
    virt_dom = self._lookup_by_name(instance_name)
    xml = virt_dom.XMLDesc(0)
    dom = xmlutils.safe_minidom_parse_string(xml)
    for graphic in dom.getElementsByTagName('graphics'):
        if (graphic.getAttribute('type') == 'vnc'):
            return graphic.getAttribute('port')
    raise exception.ConsoleTypeUnavailable(console_type='vnc')
def get_vnc_port_for_instance(instance_name):
    virt_dom = self._lookup_by_name(instance_name)
    xml = virt_dom.XMLDesc(0)
    dom = xmlutils.safe_minidom_parse_string(xml)
    for graphic in dom.getElementsByTagName('graphics'):
        if (graphic.getAttribute('type') == 'vnc'):
            return graphic.getAttribute('port')
    raise exception.ConsoleTypeUnavailable(console_type='vnc')