1
0
mirror of https://github.com/rancher/os.git synced 2025-08-01 06:59:05 +00:00

Make the auto enable hypervisor_service optional

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-07-17 21:14:45 +10:00
parent 4fcc3a880c
commit 75d384bbe8
8 changed files with 21 additions and 3 deletions

View File

@ -54,6 +54,7 @@ var schema = `{
"resize_device": {"type": "string"},
"sysctl": {"type": "object"},
"restart_services": {"type": "array"}
"hypervisor_service": {"type": "boolean"}
}
},

View File

@ -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 {

View File

@ -48,3 +48,7 @@ On desktop systems the Syslinux boot menu can be switched to graphical mode by a
#### Autologin console
`rancher.autologin=<tty...>` 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 `<hypervisor>-vm-tools`. This may cause boot speed issues, and so can be disabled by setting `rancher.hypervisor_service=false`.

View File

@ -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)

View File

@ -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}}

View File

@ -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

View File

@ -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} "

View File

@ -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"}
}
},