This is a request to make a change in the hv-kvp-daemon systemd service which is part of the linux-cloud-tools-common package to ensure the hv-kvp-daemon service starts before the walinuxagent service. The default dependencies make hv-kvp-daemon wait until the whole system is up before it can start.
Currently the /lib/systemd/system/hv-kvp-daemon.service file looks like this:
====================
# On Azure/Hyper-V systems start the hv_kvp_daemon
#
# author "Andy Whitcroft <email address hidden>"
[Unit]
Description=Hyper-V KVP Protocol Daemon
ConditionVirtualization=microsoft
The hv-kvp-daemon service is not currently part of the critical-chain:
$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
The ConditionVirtualization=microsoft line makes it so that this doesn't affect non microsoft virtualization environments (ie. qemu, kvm, vmware, xen, etc.)
This is a request to make a change in the hv-kvp-daemon systemd service which is part of the linux-cloud- tools-common package to ensure the hv-kvp-daemon service starts before the walinuxagent service. The default dependencies make hv-kvp-daemon wait until the whole system is up before it can start.
Currently the /lib/systemd/ system/ hv-kvp- daemon. service file looks like this:
======= ======= ====== lization= microsoft
# On Azure/Hyper-V systems start the hv_kvp_daemon
#
# author "Andy Whitcroft <email address hidden>"
[Unit]
Description=Hyper-V KVP Protocol Daemon
ConditionVirtua
[Service] /usr/sbin/ hv_kvp_ daemon -n
ExecStart=
[Install] multi-user. target ======= ======
WantedBy=
=======
The suggested modification is to make the [Unit] section look like this:
[Unit] lization= microsoft cies=no remount- fs.service shutdown. target cloud-init- local.service walinuxagent. service shutdown. target or=/var/ lib/hyperv
Description=Hyper-V KVP Protocol Daemon
ConditionVirtua
DefaultDependen
After=systemd-
Before=
Conflicts=
RequiresMountsF
The hv-kvp-daemon service is not currently part of the critical-chain:
$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
graphical.target @10.809s disk-warning. service @10.538s +31ms config. service @8.249s +2.252s init.service @5.803s +842ms service @5.137s +612ms pre.target @5.074s init-local. service @2.257s +2.783s remount- fs.service @1.368s +656ms journald. socket @1.218s
└─multi-user.target @10.723s
└─ephemeral-
└─cloud-
└─basic.target @8.044s
└─sockets.target @8.019s
└─snapd.socket @7.692s +264ms
└─sysinit.target @6.719s
└─cloud-
└─networking.
└─network-
└─cloud-
└─systemd-
└─systemd-
└─-.mount @649ms
└─system.slice @653ms
└─-.slice @649ms
In an Azure VM, the current startup time of my test is:
$ systemd-analyze
Startup finished in 10.375s (kernel) + 12.352s (userspace) = 22.728s
After making the suggested change, the startup time is similar:
$ systemd-analyze
Startup finished in 9.759s (kernel) + 11.867s (userspace) = 21.627s
And the service is now in the critical-chain:
$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
graphical.target @10.666s disk-warning. service @10.556s +36ms config. service @8.423s +2.095s init.service @5.814s +908ms service @5.111s +651ms pre.target @5.087s init-local. service @2.345s +2.707s daemon. service @2.316s remount- fs.service @1.253s +680ms
└─multi-user.target @10.636s
└─ephemeral-
└─cloud-
└─basic.target @8.124s
└─sockets.target @8.101s
└─lxd.socket @7.677s +326ms
└─sysinit.target @6.755s
└─cloud-
└─networking.
└─network-
└─cloud-
└─hv-kvp-
└─systemd-
└─system.slice @1.225s
└─-.slice @650ms
The ConditionVirtua lization= microsoft line makes it so that this doesn't affect non microsoft virtualization environments (ie. qemu, kvm, vmware, xen, etc.)