Thanks a lot for the info, Christian.
Let me answer your questions firstly:
- are your scripts triggered by cloud init
NO.
- if so in which config module/phase as I'm sure I have done cloud-init driven hostname changed?
- OR are your scripts triggered by open-vm-tools directly?
VMware Guest OS Customization works with either pure 'perl' scripts or cloud-init as the customization engine.
For 'perl' scripts customization, scripts are triggered by open-vm-tools.service, the 'hostnamectl' is the cmd in scripts to set hostname. And 'hostnamectl' has dependency on 'dbus.service'.
For 'cloud-init' customization, only 2 config files are copied to a folder by open-vm-tools.service, and then cloud-init-local.service read the config file from that folder to do the customization. This is the reason of "bug 1667831 to have open-vm-tools before cloud-init-local was by Sankar from VMWare".
And AFAIK, cloud-init is not using 'hostnamectl' to set hostname for Ubuntu distro. so when do the 'cloud-init' customization on Ubuntu, there is no dependency on 'dbus.service'.
And Yes, I also noticed the cycle dependency was introduced if add 'After=dbus.service' to 'open-vm-tools.service' when cloud-init*.services are also enabled.(https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1796875/comments/8)
So the 'after=dbus.service' should only be added when using perl scripts as customization engine.
see details in the workaround KB for Ubuntu18.04 Live Server https://kb.vmware.com/s/article/54986
For Set cloud-init as the customization engine:
no need add 'after=dbus.service' to open-vm-tools.service
For Set perl script as the customization engine:
need add 'after=dbus.service' to open-vm-tools.service
and also disable or remove cloud-init
Thanks a lot for the info, Christian. tools.service, the 'hostnamectl' is the cmd in scripts to set hostname. And 'hostnamectl' has dependency on 'dbus.service'. tools.service, and then cloud-init- local.service read the config file from that folder to do the customization. This is the reason of "bug 1667831 to have open-vm-tools before cloud-init-local was by Sankar from VMWare".
Let me answer your questions firstly:
- are your scripts triggered by cloud init
NO.
- if so in which config module/phase as I'm sure I have done cloud-init driven hostname changed?
- OR are your scripts triggered by open-vm-tools directly?
VMware Guest OS Customization works with either pure 'perl' scripts or cloud-init as the customization engine.
For 'perl' scripts customization, scripts are triggered by open-vm-
For 'cloud-init' customization, only 2 config files are copied to a folder by open-vm-
And AFAIK, cloud-init is not using 'hostnamectl' to set hostname for Ubuntu distro. so when do the 'cloud-init' customization on Ubuntu, there is no dependency on 'dbus.service'.
And Yes, I also noticed the cycle dependency was introduced if add 'After= dbus.service' to 'open-vm- tools.service' when cloud-init* .services are also enabled.(https:/ /bugs.launchpad .net/ubuntu/ +source/ cloud-init/ +bug/1796875/ comments/ 8) dbus.service' should only be added when using perl scripts as customization engine.
So the 'after=
see details in the workaround KB for Ubuntu18.04 Live Server https:/ /kb.vmware. com/s/article/ 54986 dbus.service' to open-vm- tools.service dbus.service' to open-vm- tools.service
For Set cloud-init as the customization engine:
no need add 'after=
For Set perl script as the customization engine:
need add 'after=
and also disable or remove cloud-init