Problem description
Unable to discover Hyper-V VM on Phoenix Management Console for Hyper-V host with non-English language.
Cause
The English language pack is not installed on the Hyper-V host.
Traceback
Navigate to C:\ProgramData\Phoenix folder
Open the main_service.log and verify if the following traceback is present in the logs.
[2020-06-08 13:42:58,407] [ERROR] WMI connection failed with error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, u'SWbemLocator', u'Espacio de nombres no v\xe1lido ', None, 0, -2147217394), None)
[2020-06-08 13:42:58,407] [INFO] Retrying wmi connection without username/password.
[2020-06-08 13:42:58,407] [ERROR] SyncError: Failed to connect to HyperV Management Service
[2020-06-08 13:42:58,407] [ERROR] Error <class 'pywintypes.com_error'>:(-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, u'SWbemLocator', u'Espacio de nombres no v\xe1lido ', None, 0, -2147217394), None). Traceback -Traceback (most recent call last):
File "agents\hyperv\hypervapi\hypervWmi.pyc", line 54, in __init__
File "wmi.pyc", line 1397, in connect_server
File "<COMObject WbemScripting.SWbemLocator>", line 5, in ConnectServer
File "win32com\client\dynamic.pyc", line 276, in _ApplyTypes_
com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, u'SWbemLocator', u'Espacio de nombres no v\xe1lido ', None, 0, -2147217394), None
Resolution
Install the English language pack on the Hyper-V host. Procedure to install the language pack is as follows-
Search for ‘Language settings’ on Windows
Click on “Add a language” button to install the preferred language.
Select the language
Select the preferences and click on install
Powershell commands to install the English Language Pack-
$UserLanguageList = New-WinUserLanguageList -Language "en-US" $UserLanguageList.Add("en-US") Set-WinUserLanguageList -LanguageList $UserLanguageList
Reboot the Hyper-V host.
Verification
On the Hyper-V host 2008 / 2008 R2 please run the following command in PowerShell.
Get-WmiObject -Namespace "root\virtualization" -Local "MS_409" -Query "Select * From Msvm_ComputerSystem where Caption='Virtual Machine'"
The expected output is the listing of the VM present on that host.On the Hyper-V host 2012 please run the following command in powershell.
Get-WmiObject -Namespace "root\virtualization\v2" -Local "MS_409" -Query "Select * From Msvm_ComputerSystem where Caption='Virtual Machine'"
To verify if the English Language pack is installed correctly, run the following command using the powershell.
$OS = Get-WmiObject -Class Win32_OperatingSystem $LangPacks = $OS.MUILanguages $LangPacks
The expected output of this command is EN