Solved Broken Host Consoles in fresh xcp-ng 8 installation. VM consoles work.
I don't know how this thing might be stuck in your config. At worst you can edit XAPI DB manually and change the value.
- Stop XAPI service on all hosts of the pool
/var/xapi/state.dbsomewhere else in case
- Edit it, and find the bad IP, replace it with the right one
- Start XAPI on all hosts, master first
The /var/lib/xcp/state.db is basically a single line of xml with a half-million characters.
The old egrep or sed or vi searching did not seem to narrow things down likely they normally do. Used xmllint to put the db in a pretty format with line breaks and indentation. Then vi to edit. Of course, as soon as i start xapi, those changes are lost. I assume there must be a massive speedup in lookups when all on a single line.
[23:59 xen-B xcp]# pushd /var/lib/xcp/ [23:59 xen-B xcp]# systemctl stop xapi [23:59 xen-B xcp]# cp state.db ./state-YYYYMMDD-HHMM.db [23:59 xen-B xcp]# egrep '(192.168.2.141)' ./state.db | wc 1 11757 454034 [23:59 xen-B xcp]# echo " :( 1 line with over 11,000 words :(" [23:59 xen-B xcp]# xmllint --format state.db >> state.xmllint--pretty.db [23:59 xen-B xcp]# egrep '(192.168.2.141)' ./state.db | wc 10 193 13526 [23:59 xen-B xcp]# echo "i can deal with 193 words :) and edited with vi" [23:59 xen-B xcp]# mv state.xmllint--pretty.db ./state.db [23:59 xen-B xcp]# systemctl start xapi
xe console-list indicates the the proper IP addresses:
[23:59 xen-B xcp]# xe console-list vm-name-label=Control\ domain\ on\ host:\ xen-B uuid ( RO) : d5039d1a-64ad-c8a9-a309-51e568ba2926 vm-uuid ( RO): 1593da28-8e85-4252-878e-778eb414c549 vm-name-label ( RO): Control domain on host: xen-B protocol ( RO): VT100 location ( RO): https://192.168.10.192/console?ref=OpaqueRef:7be93ca1-76cf-4649-8276-74891eac0a06 uuid ( RO) : 7bcf725e-ae83-cf6f-7997-7dd63469929f vm-uuid ( RO): 1593da28-8e85-4252-878e-778eb414c549 vm-name-label ( RO): Control domain on host: xen-B protocol ( RO): RFB location ( RO): https://192.168.10.192/console?ref=OpaqueRef:1361b935-2d25-4929-9b27-4b0483cbb0f7 [00:00 xen-B xcp]# ip a show dev xenbr0 | egrep inet inet 192.168.10.192/16 brd 192.168.255.255 scope global dynamic xenbr0
But there is still a blank host console in both XOA and xcp center. Suppose those OpaqueRefs have to be fixed up as well. EFI starting crashing on this r720, so having many other severe issues to deal with.
Anybody have an idea of what to do to get our consoles back?
Do a recursive grep in /etc to find all files that have the old IP address
Like grep -R 'IP-Address' /etc
@borzel i had tried that but found grep did not work like i am used. egrep worked better, but still not like how i am used to..
egrep -R '(10\.40\.|192\.168\.)' /etc
I've seen that before where when you initially set the management IP via DHCP it breaks the console when the IP changes. XCP-ng does seem to register that the IP has changed and so it does not update the console URI.
We were able to resolve the issue by setting the IP statically on the XCP-ng node(I believe a reboot was also required). That updated the console's URI and it was working again in XCP-ng Center and XO.
@DreDay yes, statically leased DHCP addresses that used to work on spinning platters of rust no longer work on Solid State Drives.
However, setting static IP address did not work to fix it. Had to reinstall, setting a static IP at re-installation time.
@olivierlambert , i have the same problem, but only under NAT. In same subnet, both host and VM consoles work properly.
There's any special configuration to work under NAT?
When XO will ask to access host console, XCP-ng XAPI will return the local host console IP (in the same network).
So if you XO can't reach this IP, console connection can't work.
@olivierlambert, all right! Thanks for your explanation!
@olivierlambert, just one more question for the XCP-Ng development team:
Would it be possible for XCP-ng XAPI to read and return, for example, the addresses contained in the [/etc/hosts] file? In this case, if we put both the local IP and the external address used to access NAT on /etc/hosts and do a careful reading and interpretation of its content, it would act analogously to a DNS to translate both the local address and the external to XAPI.
Could it be that when implementing a change like this in XCP-Ng, would XAPI work under NAT?
Short answer: no.
Long answer: I'm not sure on the "how" we could do that. You should probably ask a XAPI developer about this. I'll try to get one or two here