Bug 1660713
| Summary: | [ESXi][RHEL8.0]Enable cloud-init by default to change the systemd unit file vmtoolsd.service | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | ldu <ldu> | |
| Component: | open-vm-tools | Assignee: | Cathy Avery <cavery> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | ldu <ldu> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | high | |||
| Version: | 8.0 | CC: | berrange, cavery, jen, jjarvis, jsavanyo, ldu, leiwang, mrezanin, pengpengs, ravindrakumar, ribarry, rjones, vkuznets, vmware-gos-qa, wchadwic, yacao, yanjin | |
| Target Milestone: | rc | Flags: | rule-engine:
mirror+
|
|
| Target Release: | 8.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | open-vm-tools-10.3.0-2.el8 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1662278 (view as bug list) | Environment: | ||
| Last Closed: | 2019-06-14 01:00:13 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | 1644335 | |||
| Bug Blocks: | 1662278 | |||
|
Description
ldu
2018-12-19 03:31:28 UTC
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19593656 Lili please try this out. The changes are in /usr/lib/systemd/system/vmtoolsd.service Thanks! Hi Cathy, I test this build on RHEL8 guest. It work well. After install open-vm-tools-10.3.0-1.el8.root201812201310.x86_64.rpm then check the vmtoolsd.service file,the DefaultDependencies=no Before=cloud-init-local.service had add to this file. [Unit] Description=Service for virtual machines hosted on VMware Documentation=http://github.com/vmware/open-vm-tools ConditionVirtualization=vmware Requires=vgauthd.service After=vgauthd.service DefaultDependencies=no Before=cloud-init-local.service Thanks ldu Lili, Could you edit vmtoolsd.service on your service and get rid of 'DefaultDependencies=no'? Vitaly has asked that QE try this experiment: Thanks! ----------------- Per Vitaly: I'm no expert in systemd units, man page says: " DefaultDependencies= Takes a boolean argument. If true, (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to false." AFAIR, cloud-init-local.service is the last one (of all cloud-init services) so it is not 'early boot' - and thus 'DefaultDependencies=no' may not be needed. Could you please ask QE to try without "DefaultDependencies=no" and see what happens? (I'm just trying to identify the minimal required change we can get away with here). A bit more background Lili:
Vmware says DefaultDependencies=no is needed because:
DefaultDependencies=no is to make sure "vmtoolsd.service" respecting "Before" and "After" clauses.
To use cloud-init to customize a VM, "vmtoolsd.service" must start before "cloud-init-local.service".
(In reply to Cathy Avery from comment #6) > Lili, > > Could you edit vmtoolsd.service on your service and get rid of > 'DefaultDependencies=no'? > > Vitaly has asked that QE try this experiment: > > Thanks! > > ----------------- > Per Vitaly: > > I'm no expert in systemd units, man page says: > > " DefaultDependencies= > Takes a boolean argument. If true, (the default), a few default > dependencies will implicitly be created for the unit. The actual > dependencies created depend on the unit type. For example, for service > units, these dependencies ensure that the service is started only > after basic system initialization is completed and is properly > terminated on system shutdown. See the respective man pages for > details. Generally, only services involved with early boot or late > shutdown should set this option to false." > > AFAIR, cloud-init-local.service is the last one (of all cloud-init > services) so it is not 'early boot' - and thus 'DefaultDependencies=no' > may not be needed. > > Could you please ask QE to try without "DefaultDependencies=no" and see > what happens? (I'm just trying to identify the minimal required change > we can get away with here). Hi Cathy, I retest without "DefaultDependencies=no", the Customize Guest with cloud-init works well, seems no effect. BR, ldu @Pengpeng, Additional peer input and QE test suggests that "DefaultDependencies=no" is not necessary so unless you have any reasons for keeping it that we are as of yet unaware I am going to remove it. Thanks! Cathy @Cathy, I still sugeest keep “DefaultDependencies=no” to vmtoolsd.service file. There is no need this flag in cloud-init-local.service. With this flag and “before=cloud-init-local.service” flag in vmtoolsd.service, they makes sure vmtoolsd service start before cloud-init-local.service, this is necessary for cloud-init based guest os customization. Without it, the test may or may not work since systemd services are randomly starting during boot. Thanks, Pengpeng Fix included in open-vm-tools-10.3.0-2.el8 Verified this bug on RHEL8.0.0 ESXi6.7 kernel-4.18.0-56.el8.x86_64 open-vm-tools-10.3.0-2.el8 After install open-vm-tools-10.3.0-2.el8, check the file, the disable_vmware_customization: false contain in this file. [root@vm-198-115 ~]# cat /usr/lib/systemd/system/vmtoolsd.service [Unit] Description=Service for virtual machines hosted on VMware Documentation=http://github.com/vmware/open-vm-tools ConditionVirtualization=vmware Requires=vgauthd.service After=vgauthd.service DefaultDependencies=no Before=cloud-init-local.service [Service] ExecStart=/usr/bin/vmtoolsd TimeoutStopSec=5 [Install] WantedBy=multi-user.target Also=vgauthd.service [root@vm-198-115 ~]# (In reply to Pengpeng Sun from comment #11) > @Cathy, > > I still sugeest keep “DefaultDependencies=no” to vmtoolsd.service file. > There is no need this flag in cloud-init-local.service. > With this flag and “before=cloud-init-local.service” flag in > vmtoolsd.service, they makes sure vmtoolsd service start before > cloud-init-local.service, this is necessary for cloud-init based guest os > customization. This doesn't really make sense. 'Before=cloud-init-local.service' should be sufficient for vmtoolsd.service to be started before cloud-init-local.service. The effect of the default behaviour (aka DefaultDependancies=yes) is merely to add an After=sysinit.target / Before=shutdown.target - these are very early targets. So this wouldn't invalidate the Before=cloud-init-local.service dependancy [man systemd.service] Default Dependencies The following dependencies are added unless DefaultDependencies=no is set: · Service units will have dependencies of type Requires= and After= on sysinit.target, a dependency of type After= on basic.target as well as dependencies of type Conflicts= and Before= on shutdown.target. These ensure that normal service units pull in basic system initialization, and are terminated cleanly prior to system shutdown. Only services involved with early boot or late system shutdown should disable this option. [/man] So setting DefaultDependencies=no just removes the After=sysinit.target. > Without it, the test may or may not work since systemd services are randomly > starting during boot. services aren't started randomly. They are started according to the declared dependencies. If there is no dependency between 2 units, they can be started in parallel. Since vmtoolsd.service declared Before=cloud-init-local.service, it will be started before cloud-init-local.service. It can be started in parallel with any other services. Setting DefaultDependancies=no will actually *increase* parallelism potentially since it is removing a dependancy which permits (but doesn't guarantee that) vmtoolsd.service be started even earlier. (In reply to Daniel Berrange from comment #15) Hi Daniel, AFAIK, cloud-init-local.service starts very early and I just checked the unit of it. There are "DefaultDependencies=no", "Before=sysinit.target" and "Before=shutdown.target". So if we remove "DefaultDependencies=no" from vmtoolsd.service, and with "Before=cloud-init-local.service", it might introduce cycle dependencies. If there is no blocks for RHEL, still suggest keep "DefaultDependencies=no" to vmtoolsd.service. Thanks, Pengpeng |