diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 2a2edb8ba6..96711373a7 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -46,6 +46,7 @@ const ( cpus = "cpus" humanReadableDiskSize = "disk-size" vmDriver = "vm-driver" + xhyveDiskDriver = "xhyve-disk-driver" kubernetesVersion = "kubernetes-version" hostOnlyCIDR = "host-only-cidr" containerRuntime = "container-runtime" @@ -99,6 +100,7 @@ func runStart(cmd *cobra.Command, args []string) { CPUs: viper.GetInt(cpus), DiskSize: diskSizeMB, VMDriver: viper.GetString(vmDriver), + XhyveDiskDriver: viper.GetString(xhyveDiskDriver), DockerEnv: dockerEnv, DockerOpt: dockerOpt, InsecureRegistry: insecureRegistry, @@ -217,6 +219,7 @@ func init() { startCmd.Flags().String(hostOnlyCIDR, "192.168.99.1/24", "The CIDR to be used for the minikube VM (only supported with Virtualbox driver)") startCmd.Flags().String(hypervVirtualSwitch, "", "The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)") startCmd.Flags().String(kvmNetwork, "default", "The KVM network name. (only supported with KVM driver)") + startCmd.Flags().String(xhyveDiskDriver, "ahci-hd", "The disk driver to use [ahci-hd|virtio-blk] (only supported with xhyve driver)") startCmd.Flags().StringArrayVar(&dockerEnv, "docker-env", nil, "Environment variables to pass to the Docker daemon. (format: key=value)") startCmd.Flags().StringArrayVar(&dockerOpt, "docker-opt", nil, "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)") startCmd.Flags().String(apiServerName, constants.APIServerName, "The apiserver name which is used in the generated certificate for localkube/kubernetes. This can be used if you want to make the apiserver available from outside the machine") diff --git a/pkg/minikube/cluster/cluster_darwin.go b/pkg/minikube/cluster/cluster_darwin.go index a4b7988af7..eab497c257 100644 --- a/pkg/minikube/cluster/cluster_darwin.go +++ b/pkg/minikube/cluster/cluster_darwin.go @@ -51,6 +51,8 @@ type xhyveDriver struct { DiskNumber int Virtio9p bool Virtio9pFolder string + QCow2 bool + RawDisk bool } func createXhyveHost(config MachineConfig) *xhyveDriver { @@ -66,5 +68,7 @@ func createXhyveHost(config MachineConfig) *xhyveDriver { DiskSize: int64(config.DiskSize), Virtio9p: true, Virtio9pFolder: "/Users", + QCow2: false, + RawDisk: config.XhyveDiskDriver == "virtio-blk", } } diff --git a/pkg/minikube/cluster/types.go b/pkg/minikube/cluster/types.go index a02cc08f73..df5f5fab79 100644 --- a/pkg/minikube/cluster/types.go +++ b/pkg/minikube/cluster/types.go @@ -25,6 +25,7 @@ type MachineConfig struct { CPUs int DiskSize int VMDriver string + XhyveDiskDriver string // Only used by the xhyve driver DockerEnv []string // Each entry is formatted as KEY=VALUE. InsecureRegistry []string RegistryMirror []string