Skip to content
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

hyperv: If there is no VM , minikube delete should be able to proceed #4459

Closed
blueelvis opened this issue Jun 10, 2019 · 3 comments · Fixed by #4980
Closed

hyperv: If there is no VM , minikube delete should be able to proceed #4459

blueelvis opened this issue Jun 10, 2019 · 3 comments · Fixed by #4980
Assignees
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@blueelvis
Copy link
Contributor

minikube delete should be able to delete the .minikube folder even if the Hyper-V VM does not exist. For some reason if the Hyper V VM Creation fails, the directory is created but then the minikube delete starts failing. Now, deleting the .minikube directory is the only option as minikube start will also not run.

Maybe add a -force flag to the delete command?

The exact command to reproduce the issue:

  1. .\minikube start --vm-driver "hyperv" --hyperv-virtual-switch "Default Switch" --memory 10 -v 9999 (This will fail stating "'minikube' failed to modify device 'Memory'. (Virtual machine ID 3B02F3CF-034C-4E0A-8972-9567905AF923)
    Invalid startup memory amount assigned for 'minikube'. The minimum amount of memory you can assign to this virtual machine is '32' MB.")
  2. minikube delete -v 9999
    The full output of the command that failed:
PS C:\utilities> .\minikube delete -v 9999
[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state
[stdout =====>] :
[stderr =====>] : Hyper-V\Get-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+   ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (minikube:String) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM


* Deleting "minikube" from hyperv ...
[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state
[stdout =====>] :
[stderr =====>] : Hyper-V\Get-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+   ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (minikube:String) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM


[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Hyper-V\Remove-VM minikube -Force
[stdout =====>] :
[stderr =====>] : Hyper-V\Remove-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:1
+ Hyper-V\Remove-VM minikube -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Remove-VM], VirtualizationException
    + FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.RemoveVM



X Failed to delete cluster: exit status 1

* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new
PS C:\utilities>

The output of the minikube logs command:

PS C:\utilities> .\minikube.exe logs

X command runner: getting ssh client for bootstrapper: Error creating new ssh host from driver: Error getting ssh host name for driver: Host is not running

* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new

The operating system version:
Windows 10 Enterprise

@medyagh
Copy link
Member

medyagh commented Jun 15, 2019

That sounds reasonable ! if not deleting the folder properly on windows would block. but I would like to know what other think on this. I am not sure

I think on all platforms minikube delete does not the .minikube folder but deletes the profile data... the problem with hyprv is we need properly kill the VM and delete the switch.

@medyagh medyagh added the triage/discuss Items for discussion label Jun 15, 2019
@medyagh medyagh changed the title If the VM does not exist, minikube delete should be able to proceed hyperv: If the VM does not exist, minikube delete should be able to proceed Jun 15, 2019
@medyagh medyagh changed the title hyperv: If the VM does not exist, minikube delete should be able to proceed hyperv: If there is no VM , minikube delete should be able to proceed Jun 15, 2019
@blueelvis
Copy link
Contributor Author

@medyagh - We should not delete the Hyper-V switch. But yea, if the details given in the profile do not exist, the process should continue. What do you think? Where can I start looking into this?

@tstromberg tstromberg added co/hyperv HyperV related issues priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed triage/discuss Items for discussion labels Jul 17, 2019
@tstromberg
Copy link
Contributor

This seems reasonable. This is how other VM's work.

@tstromberg tstromberg added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 18, 2019
@blueelvis blueelvis self-assigned this Jul 31, 2019
@tstromberg tstromberg added the kind/bug Categorizes issue or PR as related to a bug. label Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants