8000 Add check for `vmcompute` service (Hyper-V) · Issue #4725 · crc-org/crc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add check for vmcompute service (Hyper-V) #4725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gbraad opened this issue Apr 11, 2025 · 1 comment
Open

Add check for vmcompute service (Hyper-V) #4725

gbraad opened this issue Apr 11, 2025 · 1 comment

Comments

@gbraad
Copy link
Contributor
gbraad commented Apr 11, 2025

We might want to add

 	checkComputeServiceRunning := `@(Get-Service vmcompute).Status` 
 	stdOut, _, err := powershell.Execute(checkComputeServiceRunning) 

to the function:

func checkHyperVInstalled() error {
// check to see if a hypervisor is present. if hyper-v is installed and enabled,
checkHypervisorPresent := `@(Get-Wmiobject Win32_ComputerSystem).HypervisorPresent`
stdOut, _, err := powershell.Execute(checkHypervisorPresent)
if err != nil {
logging.Debug(err.Error())
return fmt.Errorf("Failed checking if Hyper-V is installed")
}
if !strings.Contains(stdOut, "True") {
return fmt.Errorf("Hyper-V not installed")
}
checkVmmsExists := `@(Get-Service vmms).Status`
_, stdErr, err := powershell.Execute(checkVmmsExists)
if err != nil {
logging.Debug(err.Error())
return fmt.Errorf("Failed checking if Hyper-V management service exists")
}
if strings.Contains(stdErr, "Get-Service") {
return fmt.Errorf("Hyper-V management service not available")
}
return nil
}

to verify if the actual compute service is running.

@anjannath
Copy link
Member

If we stop the service with Stop-Service vmcompute and run crc start the service is automatically started, in a similar way the HvHost service doesn't seem to affect the VM, if we stop the HvHost service and run crc start everything works and the service remains in Stopped state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0