From e3268e2b625f56ca2e394810b0ddfbcd02c42d18 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Tue, 30 May 2017 12:09:17 +1000 Subject: [PATCH] Detect hypervisor and start its driver service Signed-off-by: Sven Dowideit --- init/init.go | 9 +++++++++ trash.conf | 1 + 2 files changed, 10 insertions(+) diff --git a/init/init.go b/init/init.go index 1921dd83..d27541e9 100755 --- a/init/init.go +++ b/init/init.go @@ -18,6 +18,8 @@ import ( "github.com/rancher/os/log" "github.com/rancher/os/util" "github.com/rancher/os/util/network" + + "github.com/SvenDowideit/cpuid" ) const ( @@ -303,6 +305,13 @@ func RunInit() error { log.Error(err) } + log.Infof("Hypervisor vendor: %s", cpuid.CPU.HypervisorName) + if cpuid.CPU.HypervisorName == "vmware" { + if err := config.Set("rancher.services_include.open-vm-tools", "true"); err != nil { + log.Error(err) + } + } + log.Debug("init, runCloudInitServices()") if err := runCloudInitServices(cfg); err != nil { log.Error(err) diff --git a/trash.conf b/trash.conf index b195b949..3ec2e2c5 100644 --- a/trash.conf +++ b/trash.conf @@ -53,6 +53,7 @@ github.com/vishvananda/netns 54f0e4339ce73702a0607f49922aaa1e749b418d github.com/xeipuuv/gojsonpointer e0fe6f68307607d540ed8eac07a342c33fa1b54a github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45 github.com/xeipuuv/gojsonschema ac452913faa25c08bb78810d3e6f88b8a39f8f25 +github.com/SvenDowideit/cpuid 96209a5b78b1c60a696fab3833d9ac02c74cbd39 golang.org/x/crypto 2f3083f6163ef51179ad42ed523a18c9a1141467 golang.org/x/net 991d3e32f76f19ee6d9caadb3a22eae8d23315f7 https://github.com/golang/net.git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git