On provisioning boot _get_data() is called once in init-local.
On subsequent boots it is called twice when datasource update is considered for "boot-new-instance" and 'boot".
grep -e Cloud-init -e get_data -e Update /var/log/cloud-init.log 2022-09-15 04:04:44,981 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'init-local' at Thu, 15 Sep 2022 04:04:44 +0000. Up 16.54 seconds. 2022-09-15 04:04:45,155 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot-new-instance 2022-09-15 04:04:45,156 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data 2022-09-15 04:04:45,930 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data 2022-09-15 04:04:48,030 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'init' at Thu, 15 Sep 2022 04:04:48 +0000. Up 19.59 seconds. 2022-09-15 04:04:57,975 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'modules:config' at Thu, 15 Sep 2022 04:04:57 +0000. Up 29.49 seconds. 2022-09-15 04:04:59,856 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'modules:final' at Thu, 15 Sep 2022 04:04:59 +0000. Up 31.38 seconds. 2022-09-15 04:05:00,036 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 finished at Thu, 15 Sep 2022 04:05:00 +0000. Datasource DataSourceAzure [seed=/dev/sr0]. Up 31.62 seconds
<reboot>
2022-09-15 04:06:11,100 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'init-local' at Thu, 15 Sep 2022 04:06:11 +0000. Up 6.98 seconds. 2022-09-15 04:06:11,128 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot-new-instance 2022-09-15 04:06:11,128 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data 2022-09-15 04:06:12,062 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data 2022-09-15 04:06:12,111 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot 2022-09-15 04:06:12,111 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data 2022-09-15 04:06:12,415 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data 2022-09-15 04:06:14,700 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'init' at Thu, 15 Sep 2022 04:06:14 +0000. Up 10.58 seconds. 2022-09-15 04:06:16,934 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'modules:config' at Thu, 15 Sep 2022 04:06:16 +0000. Up 12.73 seconds. 2022-09-15 04:06:17,774 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 running 'modules:final' at Thu, 15 Sep 2022 04:06:17 +0000. Up 13.57 seconds. 2022-09-15 04:06:17,858 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~18.04.3 finished at Thu, 15 Sep 2022 04:06:17 +0000. Datasource DataSourceAzure [seed=/var/lib/waagent]. Up 13.76 seconds
On provisioning boot _get_data() is called once in init-local.
On subsequent boots it is called twice when datasource update is considered for "boot-new-instance" and 'boot".
grep -e Cloud-init -e get_data -e Update /var/log/ cloud-init. log 18.04.3 running 'init-local' at Thu, 15 Sep 2022 04:04:44 +0000. Up 16.54 seconds. 18.04.3 running 'init' at Thu, 15 Sep 2022 04:04:48 +0000. Up 19.59 seconds. 18.04.3 running 'modules:config' at Thu, 15 Sep 2022 04:04:57 +0000. Up 29.49 seconds. 18.04.3 running 'modules:final' at Thu, 15 Sep 2022 04:04:59 +0000. Up 31.38 seconds. 18.04.3 finished at Thu, 15 Sep 2022 04:05:00 +0000. Datasource DataSourceAzure [seed=/dev/sr0]. Up 31.62 seconds
2022-09-15 04:04:44,981 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:04:45,155 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot-new-instance
2022-09-15 04:04:45,156 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data
2022-09-15 04:04:45,930 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data
2022-09-15 04:04:48,030 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:04:57,975 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:04:59,856 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:05:00,036 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
<reboot>
2022-09-15 04:06:11,100 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~ 18.04.3 running 'init-local' at Thu, 15 Sep 2022 04:06:11 +0000. Up 6.98 seconds. 18.04.3 running 'init' at Thu, 15 Sep 2022 04:06:14 +0000. Up 10.58 seconds. 18.04.3 running 'modules:config' at Thu, 15 Sep 2022 04:06:16 +0000. Up 12.73 seconds. 18.04.3 running 'modules:final' at Thu, 15 Sep 2022 04:06:17 +0000. Up 13.57 seconds. 18.04.3 finished at Thu, 15 Sep 2022 04:06:17 +0000. Datasource DataSourceAzure [seed=/ var/lib/ waagent] . Up 13.76 seconds
2022-09-15 04:06:11,128 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot-new-instance
2022-09-15 04:06:11,128 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data
2022-09-15 04:06:12,062 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data
2022-09-15 04:06:12,111 - __init__.py[DEBUG]: Update datasource metadata and network config due to events: boot
2022-09-15 04:06:12,111 - handlers.py[DEBUG]: start: azure-ds/_get_data: _get_data
2022-09-15 04:06:12,415 - handlers.py[DEBUG]: finish: azure-ds/_get_data: SUCCESS: _get_data
2022-09-15 04:06:14,700 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:06:16,934 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:06:17,774 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~
2022-09-15 04:06:17,858 - util.py[DEBUG]: Cloud-init v. 22.2-0ubuntu1~