Example #1
0
def run_vnc(request,id,vnc,uuid):
    '''
        Call the VNC proxy for remote control
    '''
    vServer = VmServer.objects.get(id=id)
    tokenStr = uuid + ': ' + vServer.server_ip + ':' + str(vnc)
    TokenUntils.writeVncToken(filename=uuid,token=tokenStr) 
    return render(request, 'vnc/vnc_auto.html',{"vnc_port":settings.VNC_PROXY_PORT,
                                                    "vnc_token":uuid,
                                                    })
Example #2
0
def run_vnc(request):
    '''
        Call the VNC proxy for remote control
    '''
    token = request.GET.get('token', 'false')
    server_id = request.GET.get('vs', 'false')
    vm_name = request.GET.get('vm', 'false')
    vnc = request.GET.get('vnc', 'false')
    if server_id:
        vMserver = VMServer.selectOneHost(id=server_id)
        token_file = vMserver.server_ip + '.' + str(vm_name)
        tokenStr = token + ': ' + vMserver.server_ip + ':' + str(vnc)
        TokenUntils.writeVncToken(filename=token_file, token=tokenStr)
        return render(request, 'vnc/vnc_auto.html', {
            "vnc_port": settings.VNC_PROXY_PORT,
            "vnc_token": token,
        })