Revision 71099804 logic/backend.py
b/logic/backend.py | ||
---|---|---|
214 | 214 |
|
215 | 215 |
|
216 | 216 |
def get_instance_console(vm): |
217 |
return rapi.GetInstanceConsole(vm.backend_id) |
|
218 |
|
|
217 |
# RAPI GetInstanceConsole() returns endpoints to the vnc_bind_address, |
|
218 |
# which is a cluster-wide setting, either 0.0.0.0 or 127.0.0.1, and pretty |
|
219 |
# useless (see #783). |
|
220 |
# |
|
221 |
# Until this is fixed on the Ganeti side, construct a console info reply |
|
222 |
# directly. |
|
223 |
# |
|
224 |
# WARNING: This assumes that VNC runs on port network_port on |
|
225 |
# the instance's primary node, and is probably |
|
226 |
# hypervisor-specific. |
|
227 |
# |
|
228 |
console = {} |
|
229 |
console['kind'] = 'vnc' |
|
230 |
i = rapi.GetInstance(vm.backend_id) |
|
231 |
if i['hvparams']['serial_console']: |
|
232 |
raise Exception("hv parameter serial_console cannot be true") |
|
233 |
console['host'] = i['pnode'] |
|
234 |
console['port'] = i['network_port'] |
|
235 |
|
|
236 |
return console |
|
237 |
# return rapi.GetInstanceConsole(vm.backend_id) |
|
219 | 238 |
|
220 | 239 |
def request_status_update(vm): |
221 | 240 |
return rapi.GetInstanceInfo(vm.backend_id) |
Also available in: Unified diff