RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1660713 - [ESXi][RHEL8.0]Enable cloud-init by default to change the systemd unit file vmtoolsd.service
Summary: [ESXi][RHEL8.0]Enable cloud-init by default to change the systemd unit file v...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: open-vm-tools
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.0
Assignee: Cathy Avery
QA Contact: ldu
URL:
Whiteboard:
Depends On: 1644335
Blocks: 1662278
TreeView+ depends on / blocked
 
Reported: 2018-12-19 03:31 UTC by ldu
Modified: 2019-12-30 02:39 UTC (History)
17 users (show)

Fixed In Version: open-vm-tools-10.3.0-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1662278 (view as bug list)
Environment:
Last Closed: 2019-06-14 01:00:13 UTC
Type: Bug
Target Upstream Version:
Embargoed:
rule-engine: mirror+


Attachments (Terms of Use)

Description ldu 2018-12-19 03:31:28 UTC
Description of problem:
Please change the default image customization to use cloud-init by default and disable VMware's legacy perl-based customization mechanism. 
Add "before=cloud-init-local.service" to file /lib/systemd/system/vmtoolsd.service by default

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1.Install RHEL8 
2.start it and check /lib/systemd/system/vmtoolsd.service


Actual results:
no configure line before=cloud-init-local.service

Expected results:
Add line before=cloud-init-local.service  by default.

Additional info:

Comment 1 Cathy Avery 2018-12-20 18:49:08 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!

Comment 2 ldu 2018-12-21 06:12:01 UTC
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

Comment 6 Cathy Avery 2019-01-03 14:36:18 UTC
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).

Comment 7 Cathy Avery 2019-01-03 14:40:08 UTC
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".

Comment 9 ldu 2019-01-04 02:51:25 UTC
(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

Comment 10 Cathy Avery 2019-01-04 14:58:00 UTC
@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

Comment 11 Pengpeng Sun 2019-01-04 16:00:16 UTC
@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

Comment 12 Miroslav Rezanina 2019-01-08 14:22:34 UTC
Fix included in open-vm-tools-10.3.0-2.el8

Comment 14 ldu 2019-01-16 09:52:15 UTC
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 ~]#

Comment 15 Daniel Berrangé 2019-03-08 15:17:01 UTC
(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.

Comment 16 Pengpeng Sun 2019-03-11 03:06:48 UTC
(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


Note You need to log in before you can comment on or make changes to this bug.