After the openstack virtual machine is deployed, the console of the virtual machine cannot be accessed

After the openstack virtual machine is deployed, the console of the virtual machine cannot be accessed, and the error is as follows:

2023-07-17 17:48:22.115 7512 INFO nova.console.websocketproxy [-] In exit
2023-07-17 17:48:22.115 7512 INFO nova.console.websocketproxy [-] Terminating child 9332
2023-07-17 17:48:22.139 9332 INFO nova.console.websocketproxy [-] In exit
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] WebSocket server settings:
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] - Listen on 0.0.0.0:6080
2023-07-17 17:48:23.892 10510 INFO nova.console.websocketproxy [-] - Flash security policy server
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - Web server (no directory listings). Web root: /usr/share/novnc
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - No SSL/TLS support (no cert file)
2023-07-17 17:48:23.893 10510 INFO nova.console.websocketproxy [-] - proxying from 0.0.0.0:6080 to None:None
2023-07-17 17:48:46.269 10798 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:48:46] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:49:04.609 10993 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:49:04] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:55:35.506 12630 INFO nova.console.websocketproxy [-] 172.16.10.11 - - [17/Jul/2023 17:55:35] code 400, message Client must support ‘binary’ or ‘base64’ protocol
2023-07-17 17:56:01.033 12853 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [17/Jul/2023 17:56:01] code 400, message Client must support ‘binary’ or ‘base64’ protocol

2023-07-18 10:35:03.345 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Plain non-SSL (ws://) WebSocket connection
2023-07-18 10:35:03.345 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Version hybi-13, base64: ‘False’
2023-07-18 10:35:03.346 11833 INFO nova.console.websocketproxy [-] 172.16.10.87 - - [18/Jul/2023 10:35:03] 172.16.10.87: Path: ‘/?token=232d99f1-97fd-4922-9e56-441bdace05af’
2023-07-18 10:35:03.553 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] 2: 连接信息:ConsoleAuthToken(access_url_base=‘http://172.16.10.12:6080/vnc_auto.html’,console_type=‘novnc’,created_at=2023-07-18T02:35:01Z,host=‘nova01.localdomain’,id=39,instance_uuid=7d7f62f9-71ae-4567-9403-2f3466a4e5ec,internal_access_path=None,port=5901,token=‘***’,updated_at=None)
2023-07-18 10:35:03.553 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] 2: 连接到:nova01.localdomain:5901
2023-07-18 10:35:08.605 11833 INFO nova.console.websocketproxy [req-cfafe07c-56f3-4146-8cc8-74d02f52601c - - - - -] handler exception: [Errno 111] ECONNREFUSE


Solution:

vim /usr/share/novnc/core/websock.js

Find the following line:

this.attach(new WebSocket(uri, protocols));

About line 231, modify it to the following:

this.attach(new WebSocket(uri, ['binary', 'base64']));

Some versions contain the following line:

this._websocket = new WebSocket(uri, protocols);

Modify it to the following:

this._websocket = new WebSocket(uri, ['binary', 'base64']); // protocols);

Restart the corresponding service:

systemctl restart openstack-nova-novncproxy

or

systemctl restart openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-scheduler.service

It is very important to pay attention to the hostname of the control node and the computing node, as well as the contents of the hosts file; for example, the above error can be solved by adding the IP mapping relationship of the computing node:

172.16.10.13 	nova01
172.16.10.13 	nova01.localdomain

Guess you like

Origin blog.csdn.net/u014374009/article/details/131780035