Hyper-V troubleshooting
The Hyper-V collector reads a Microsoft Hyper-V host's virtual switches, virtual machines, adapters, VLANs and disks over SSH, and needs the Pro edition.
Before you start
- Protocol and port. SSH to the host's OpenSSH Server, port 22 by default. WinRM is not used.
- Account. A local or domain account in the host's Hyper-V Administrators group. Sign in with a password or an OpenSSH private key.
- Read only. cinqstack sends one PowerShell script over the SSH session and runs only read commands (
Get-VM,Get-VMNetworkAdapter,Get-VHD, CIM reads). Nothing is written to the host's disk. - Time limits. Each part of the read has its own limit (60 seconds by default), and the whole read ends after 240 seconds. A slow or stuck part is reported and skipped; the rest still comes back. Both limits are set on the job.
- Settings screen. Admins add connections on Hyper-V › Connections, with Test and Test and save. Saving pins the host's SSH key.
- NetBox. The
hyperv_idcustom field lets cinqstack follow VM renames. Create it in Settings › NetBox schema if it is missing.
Common problems
| Message you see | What it means | What to do |
|---|---|---|
SSH login to … failed | The host refused the username, password or key. | Check the account. For a domain account, use DOMAIN\name. For a key, check that its public half is in the account's authorized_keys (for an administrator account: C:\ProgramData\ssh\administrators_authorized_keys). |
Cannot connect to …:22: … | No SSH session could be opened: refused connection, timeout or DNS failure. | Check that OpenSSH Server is running on the host, and the firewall between cinqstack and the host. |
The SSH host key of … does not match the key saved with the connection | The host presents a different SSH key than when the connection was saved. | If the host was rebuilt or its SSH keys were renewed, test and save the connection again. Otherwise find out why the key changed before you continue. |
Hyper-V could not be read: … The account is neither a local administrator nor in Hyper-V Administrators. | The account signed in but may not read Hyper-V. | Add the account to the host's Hyper-V Administrators group, then sign out any open sessions of that account. |
The inventory script hit its … s deadline on the host and was stopped | The whole read took longer than the job's time limit. | Raise Time limit for the whole read on the job, narrow VM names, or turn off guest data. |
The host did not answer within … s; the session was closed | No answer at all, even after the host's own deadline. | Check the host's load and the network. cinqstack closes the session; the script on the host ends itself as well. |
<step>: timed out after … s in Some details could not be read from the host | One part of the read was too slow, for example the guest data. The rest of the run is complete. | Raise Time limit per step on the job, or turn off guest data if it is the slow part. |
Get-VHD: … access denied, or the size of … could not be read | The account cannot read the virtual disk files, so disk sizes are unknown. Those disks are left out. | Give the account read access to the folders that hold the disks. |
No guest reported KVP data | No VM reported guest OS, DNS name or addresses. | Check that the Data Exchange integration service is on for the VMs, and that Linux guests run the Hyper-V daemons. Appliances often never report. |
Hyper-V host not in NetBox | A heading in the run report. The host is matched to a NetBox device by serial, then by name. | Add the host as a device in NetBox, or rename the existing device to match. The next run links it. |
Scope rule points at site '…', which does not exist in NetBox. | A scope rule names a site slug that NetBox does not have. | Create the site in NetBox or correct the rule on the job. |
NetBox does not have the custom field hyperv_id … | NetBox lacks the field this module writes. | Run the schema pack under Settings › NetBox schema, then apply again. |
Collect details for support
- Open the job under Hyper-V, use the arrow next to Run now and choose Run with debug log. A debug run also stores the collected snapshot and the time each part of the read took.
- When the run finishes, open the run page (
/hyperv/runs/<run id>) and click Download log. The file is namedhyperv-run-<run id>.log. - Only operators and admins see the debug detail, so download the log with one of those roles.
Send the log file, the cinqstack version, the Windows version shown on the connections page, and the job's VM names pattern and scope rules. The snapshot lists VM and host names, so check with your site before you share it. Never send the password or the private key.