diff --git a/config/schema.go b/config/schema.go index 5d0bd2b5..a1bf255c 100644 --- a/config/schema.go +++ b/config/schema.go @@ -54,6 +54,7 @@ var schema = `{ "resize_device": {"type": "string"}, "sysctl": {"type": "object"}, "restart_services": {"type": "array"} + "hypervisor_service": {"type": "boolean"} } }, diff --git a/config/types.go b/config/types.go index 9b7c41cb..c463136f 100755 --- a/config/types.go +++ b/config/types.go @@ -130,6 +130,7 @@ type RancherConfig struct { ResizeDevice string `yaml:"resize_device,omitempty"` Sysctl map[string]string `yaml:"sysctl,omitempty"` RestartServices []string `yaml:"restart_services,omitempty"` + HypervisorService bool `yaml:"hypervisor_service,omitempty"` } type UpgradeConfig struct { diff --git a/docs/os/configuration/adding-kernel-parameters/index.md b/docs/os/configuration/adding-kernel-parameters/index.md index a3dc3484..980e7c60 100644 --- a/docs/os/configuration/adding-kernel-parameters/index.md +++ b/docs/os/configuration/adding-kernel-parameters/index.md @@ -48,3 +48,7 @@ On desktop systems the Syslinux boot menu can be switched to graphical mode by a #### Autologin console `rancher.autologin=` will automatically log in the sepcified console - common values are `tty1`, `ttyS0` and `ttyAMA0` - depending on your platform. + +#### Enable/Disable hypervisor service auto-enable + +RancherOS v1.1.0 added detetion of Hypervisor, and then will try to download the a service called `-vm-tools`. This may cause boot speed issues, and so can be disabled by setting `rancher.hypervisor_service=false`. diff --git a/init/init.go b/init/init.go index 5e83f2bf..f9af0e33 100755 --- a/init/init.go +++ b/init/init.go @@ -405,7 +405,6 @@ func RunInit() error { return config.LoadConfig(), nil }}, config.CfgFuncData{"hypervisor tools", func(cfg *config.CloudConfig) (*config.CloudConfig, error) { - // Maybe we could set `rancher.hypervisor_service`, and defer this further? enableHypervisorService(cfg, hypervisor) return config.LoadConfig(), nil }}, @@ -461,6 +460,11 @@ func enableHypervisorService(cfg *config.CloudConfig, hypervisorName string) { hypervisorName = "open" } serviceName := hypervisorName + "-vm-tools" + if !cfg.Rancher.HypervisorService { + log.Infof("Skipping %s as `rancher.hypervisor_service` is set to false", serviceName) + return + } + // check quickly to see if there is a yml file available if service.ValidService(serviceName, cfg) { log.Infof("Setting rancher.services_include. %s=true", serviceName) diff --git a/os-config.tpl.yml b/os-config.tpl.yml index 5c7c4a64..0612bcaf 100644 --- a/os-config.tpl.yml +++ b/os-config.tpl.yml @@ -16,6 +16,7 @@ rancher: nameservers: [8.8.8.8, 8.8.4.4] ssh: daemon: true + hypervisor_service: true bootstrap: bootstrap: image: {{.OS_REPO}}/os-bootstrap:{{.VERSION}}{{.SUFFIX}} diff --git a/scripts/run b/scripts/run index 29944846..b3edca3d 100755 --- a/scripts/run +++ b/scripts/run @@ -10,6 +10,9 @@ MEMORY=2048 while [ "$#" -gt 0 ]; do case $1 in + --debug) + DEBUG=1 + ;; --iso) BOOT_ISO=1 QEMU=0 @@ -160,6 +163,9 @@ if [ "$REBUILD" == "1" ] || [ ! -e ${INITRD} ]; then fi KERNEL_ARGS="${DEFAULT_KERNEL_ARGS} ${QEMU_APPEND}" +if [ "$DEBUG" == "1" ]; then + KERNEL_ARGS="${KERNEL_ARGS} rancher.debug=true" +fi if [ "$FORMAT" == "1" ]; then KERNEL_ARGS="${KERNEL_ARGS} rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda]" fi diff --git a/scripts/run-common b/scripts/run-common index 03cc84ad..8cf63336 100755 --- a/scripts/run-common +++ b/scripts/run-common @@ -52,4 +52,4 @@ if [ "$ENGINE_REGISTRY_MIRROR" != "" ]; then REGISTRY_MIRROR="rancher.bootstrap_docker.registry_mirror=${ENGINE_REGISTRY_MIRROR} rancher.system_docker.registry_mirror=${ENGINE_REGISTRY_MIRROR} rancher.docker.registry_mirror=${ENGINE_REGISTRY_MIRROR}" fi -DEFAULT_KERNEL_ARGS="printk.devkmsg=on rancher.debug=true rancher.password=rancher console=tty1 rancher.autologin=tty1 console=${TTYCONS} rancher.autologin=${TTYCONS} ${REGISTRY_MIRROR} " +DEFAULT_KERNEL_ARGS="printk.devkmsg=on rancher.password=rancher console=tty1 rancher.autologin=tty1 console=${TTYCONS} rancher.autologin=${TTYCONS} ${REGISTRY_MIRROR} " diff --git a/scripts/schema.json b/scripts/schema.json index 8f11bb6d..0bb57607 100644 --- a/scripts/schema.json +++ b/scripts/schema.json @@ -51,7 +51,8 @@ "defaults": {"$ref": "#/definitions/defaults_config"}, "resize_device": {"type": "string"}, "sysctl": {"type": "object"}, - "restart_services": {"type": "array"} + "restart_services": {"type": "array"}, + "hypervisor_service": {"type": "boolean"} } },