Add live VNC information to domain output
Sets in the node daemon, returns via the API, and shows in the CLI, information about the live VNC listen address and port for VNC-enabled VMs. Closes #115
This commit is contained in:
@ -267,6 +267,13 @@ def getInformationFromXML(zk_conn, uuid):
|
||||
except Exception:
|
||||
domain_profile = None
|
||||
|
||||
try:
|
||||
domain_vnc = zkhandler.readdata(zk_conn, '/domains/{}/vnc'.format(uuid))
|
||||
domain_vnc_listen, domain_vnc_port = domain_vnc.split(':')
|
||||
except Exception:
|
||||
domain_vnc_listen = 'None'
|
||||
domain_vnc_port = 'None'
|
||||
|
||||
parsed_xml = getDomainXML(zk_conn, uuid)
|
||||
|
||||
try:
|
||||
@ -312,6 +319,10 @@ def getInformationFromXML(zk_conn, uuid):
|
||||
'arch': domain_arch,
|
||||
'machine': domain_machine,
|
||||
'console': domain_console,
|
||||
'vnc': {
|
||||
'listen': domain_vnc_listen,
|
||||
'port': domain_vnc_port
|
||||
},
|
||||
'emulator': domain_emulator,
|
||||
'features': domain_features,
|
||||
'disks': domain_disks,
|
||||
|
@ -207,6 +207,7 @@ def define_vm(zk_conn, config_data, target_node, node_limit, node_selector, node
|
||||
'/domains/{}/consolelog'.format(dom_uuid): '',
|
||||
'/domains/{}/rbdlist'.format(dom_uuid): formatted_rbd_list,
|
||||
'/domains/{}/profile'.format(dom_uuid): profile,
|
||||
'/domains/{}/vnc'.format(dom_uuid): '',
|
||||
'/domains/{}/xml'.format(dom_uuid): config_data
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user