Skip to content

Add hyperv support #467

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

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/minikube_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ minikube start
OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64)
--memory=1024: Amount of RAM allocated to the minikube VM
--registry-mirror=[]: Registry mirrors to pass to the Docker daemon
--vm-driver="virtualbox": VM driver is one of: [virtualbox vmwarefusion kvm xhyve]
--vm-driver="virtualbox": VM driver is one of: [virtualbox vmwarefusion kvm xhyve hyperv]
```

### Options inherited from parent commands
Expand Down
2 changes: 2 additions & 0 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ func createHost(api libmachine.API, config MachineConfig) (*host.Host, error) {
driver = createKVMHost(config)
case "xhyve":
driver = createXhyveHost(config)
case "hyperv":
driver = createHypervHost(config)
default:
glog.Exitf("Unsupported driver: %s\n", config.VMDriver)
}
Expand Down
25 changes: 25 additions & 0 deletions pkg/minikube/cluster/cluster_non_windows_panic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// +build !windows

/*
Copyright 2016 The Kubernetes Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cluster

import "github.com/docker/machine/libmachine/drivers"

func createHypervHost(config MachineConfig) drivers.Driver {
panic("hyperv not supported")
}
33 changes: 33 additions & 0 deletions pkg/minikube/cluster/cluster_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2016 The Kubernetes Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cluster

import (
"github.com/docker/machine/drivers/hyperv"
"github.com/docker/machine/libmachine/drivers"
"k8s.io/minikube/pkg/minikube/constants"
)

func createHypervHost(config MachineConfig) drivers.Driver {
d := hyperv.NewDriver(constants.MachineName, constants.Minipath)
d.Boot2DockerURL = config.GetISOFileURI()
d.MemSize = config.Memory
d.CPU = config.CPUs
d.DiskSize = int(config.DiskSize)
d.SSHUser = "docker"
return d
}
1 change: 1 addition & 0 deletions pkg/minikube/constants/constants_gendocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ var SupportedVMDrivers = [...]string{
"vmwarefusion",
"kvm",
"xhyve",
"hyperv",
}
1 change: 1 addition & 0 deletions pkg/minikube/constants/constants_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ package constants

var SupportedVMDrivers = [...]string{
"virtualbox",
"hyperv",
}
3 changes: 3 additions & 0 deletions pkg/minikube/machine/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package machine
import (
"os"

"github.com/docker/machine/drivers/hyperv"
"github.com/docker/machine/drivers/virtualbox"
"github.com/docker/machine/drivers/vmwarefusion"
"github.com/docker/machine/libmachine/drivers/plugin"
Expand All @@ -35,6 +36,8 @@ func StartDriver() {
plugin.RegisterDriver(virtualbox.NewDriver("", ""))
case "vmwarefusion":
plugin.RegisterDriver(vmwarefusion.NewDriver("", ""))
case "hyperv":
plugin.RegisterDriver(hyperv.NewDriver("", ""))
default:
glog.Exitf("Unsupported driver: %s\n", driverName)
}
Expand Down
Loading