Project

General

Profile

Feature #28465

Provide an API call for the next available VNC port

Added by Vaibhav Chauhan over 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
Important
Assignee:
Marcelo Araujo
Category:
Middleware
Target version:
Estimated time:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Description

I think at present middleware happens to provide a default port number which is a sum of 5900+vm id, this makes sense when we are attaching a VNC device to an existing device, however when we are creating a VM and devices at once (say a vm wizard :D) we would like to be able to do that.


Related issues

Related to FreeNAS - Feature #28475: implement vm suggestions during the demo meeting. Done2018-02-13

Associated revisions

Revision b26b85da (diff)
Added by Marcelo Araujo over 1 year ago

- Provide an API call for the next available VNC port.

Ticket: #28465

Revision cabba065 (diff)
Added by Marcelo Araujo over 1 year ago

[MASTER] - Provide an API call for the next available VNC port. (#898)

  • - Provide an API call for the next available VNC port.

Ticket: #28465

  • - Fix misspelling.

Spotted by: skarekrow

History

#1 Updated by Vaibhav Chauhan over 1 year ago

  • Related to Feature #28475: implement vm suggestions during the demo meeting. added

#2 Updated by Dru Lavigne over 1 year ago

  • Target version changed from Master - FreeNAS Nightlies to 11.2-BETA1

#3 Updated by Vaibhav Chauhan over 1 year ago

14449

stated port number and actual VNC port number are off by 100

[2018/02/20 19:36:04] (DEBUG) VMService.run():253 - Champion-linux: 20/02/2018 11:36:04 Listening for VNC connections on TCP port 6372

[2018/02/20 19:36:04] (DEBUG) VMService.run():253 - Champion-linux: 20/02/2018 11:36:04 Listening for VNC connections on TCP6 port 6372

please take look at the webaddress in the browser in attached screenshot.

I can provide you multiple instances, on several VM's where the stated VNC port and actual port number is off by 100

[2018/02/20 19:36:01] (DEBUG) VMService.run():253 - Champion-BSD: 20/02/2018 11:36:01 Listening for VNC connections on TCP port 5587

[2018/02/20 19:36:01] (DEBUG) VMService.run():253 - Champion-BSD: 20/02/2018 11:36:01 Listening for VNC connections on TCP6 port 5587

[2018/02/20 19:36:06] (DEBUG) VMService.run():253 - Champion-Windows: 20/02/2018 11:36:06 Listening for VNC connections on TCP port 6377

[2018/02/20 19:36:06] (DEBUG) VMService.run():253 - Champion-Windows: 20/02/2018 11:36:06 Listening for VNC connections on TCP6 port 6377

#6 Updated by Marcelo Araujo over 1 year ago

You have two different VNC ports, first is the one you specify via GUI and that is the true VNC PORT used when you connect from a VNC CLIENT, the second is the WEB VNC port, where you use a webapp to connect on it.

Here is how the VNC ports are generated:
1) True VNC PORT:
vnc_port = 5900 + vm_id

2) Web VNC PORT:
split_port = int(str(vnc_port)[:2]) - 1
vnc_web_port = str(split_port) + str(vnc_port)[2:]

Example:
If VNC port is 6030, the WEB VNC PORT will be 5930.

I hope it clarifies why and how these 2 ports are generated.

#7 Updated by Marcelo Araujo over 1 year ago

  • Status changed from Not Started to In Progress

#8 Updated by Marcelo Araujo over 1 year ago

Hi,

As soon as it is merged you can call the websocket like this:


root@fn02:/ # midclt call vm.vnc_port_wizard
{"vnc_port": 5909, "vnc_web": 5809}

PR: https://github.com/freenas/freenas/pull/898

The method will try to predict and generate the next VNC port.
Br,

#9 Updated by Marcelo Araujo over 1 year ago

  • Status changed from In Progress to Done

#10 Updated by Dru Lavigne over 1 year ago

  • Subject changed from please provide an API call for next available VNC port, which can be be specified BEFORE vm is created. to Provide an API call for the next available VNC port
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#11 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#12 Updated by Bonnie Follweiler about 1 year ago

19993
19998

#13 Updated by Dru Lavigne about 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF