Skip to content

Commit

Permalink
Add hyperv support
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed Aug 9, 2016
1 parent cc95add commit 52ab263
Show file tree
Hide file tree
Showing 10 changed files with 660 additions and 1 deletion.
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 @@ -24,7 +24,7 @@ minikube start
--kubernetes-version="v1.3.4": The kubernetes version that the minikube VM will (ex: v1.2.3)
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
--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 @@ -380,6 +380,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")
}
32 changes: 32 additions & 0 deletions pkg/minikube/cluster/cluster_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
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)
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

0 comments on commit 52ab263

Please sign in to comment.