If you work with HyperV there will come a time when you need to run some basic PowerShell commands to find out how health your HyperV Virtual Machines really are.
In a POWERSHELL as an ADMINISTRATOR use:
get-vm
Note this command does not work in a CMD window… it must be POWERSHELL
If you want detailed report on a specific virtual machine, this command will provide you with the operational status and status which generally can be inferred as the VM’s health.
There are two things to note before you run this command:
Get-WmiObject -Namespace root\virtualization -Compu...
Get-WmiObject -Namespace root\virtualization\v2 -ComputerName "<your host server name>" -Query "Select * From Msvm_ComputerSystem Where ElementName='<vm name you want to check>'"
The HyperV Operational Status codes are as follows:
0: Ok
1: Degraded
2: PredictiveFailure
3: InService
4: Dormant
5: SupportingEntityInError
6: ApplyingSnapshot
7: CreatingSnapshot
8: DeletingSnapshot
9: WaitingToStart
10: MergingDisks
11: ExportingVirtualMachine
12: MigratingVirtualMachine
13: BackingUpVirtualMachine
14: ModifyingUpVirtualMachine
15: StorageMigrationPhaseOne
16: StorageMigrationPhaseTwo
17: MigratingPlannedVm
18: CheckingCompatibility
19: ApplicationCriticalState
20: CommunicationTimedOut
21: CommunicationFailed
22: NoIommu
23: NoIovSupportInNic
24: SwitchNotInIovMode
25: IovBlockedByPolicy
26: IovNoAvailResources
27: IovGuestDriversNeeded
28: CriticalIoError
If you have a HyperV cluster the simple command to find out its status is
Get-ClusterNode
Get-ClusterNode -Cluster cluster1
Get-ClusterNode -Name node1 | Get-ClusterResource
For more details on cluster PowerShell commands see THIS Microsoft article.
This website uses cookies.