When openning a folder using remote ssh in Visual Studio code with Python extension of Microsoft, the "discovering python interpreters" goes on forever. On the remote (ubuntu), it can be observed that vscode-server is taking 100% of the CPU. Also, the Python extension functionality is not available.
In the opened directory there is a sub directory that contains many files (millions). This is for a good reason. Still, the VS Code server keeps searching through these files for potential Python environments, and this takes forever.
Moving this sub directory to a different location solved the problem.