Furthermore I tried to check this in VMWare Workstation player 16
First of all as I'd expect systemd-detect-virt identified vmware already.
$ systemd-detect-virt
vmware
The code affected by this issue here is in "ovf_vmware_guest_customization".
That is only used in dscheck_OVF.
Therefore to streamline the run reduce config to just detect OVF in ds-identify.
$ echo "datasource_list: [NoCloud, OVF]" < sudo tee /etc/cloud/cloud.cfg.d/99_test.cfg
Running ds-identify in verbose more to check behavior.
As expected I see it pass the steps before and reach ovf_vmware_guest_customization.
And indeed it fails to detect the pluging and does an early exit.
Here with a bit of additional debug inside of ovf_vmware_guest_customization:
$ sudo DEBUG_LEVEL=5 DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force
[up 2345.15s] ds-identify --force
policy loaded: mode=search report=false found=all maybe=all notfound=disabled
/etc/cloud/cloud.cfg.d/90_dpkg.cfg set datasource_list: [NoCloud, OVF]
DMI_PRODUCT_NAME=VMware Virtual Platform
DMI_SYS_VENDOR=VMware, Inc.
DMI_PRODUCT_SERIAL=VMware-56 4d 5c 48 27 3b 66 c7-18 31 7d 99 e7 30 40 7e
DMI_PRODUCT_UUID=485c4d56-3b27-c766-1831-7d99e730407e
PID_1_PRODUCT_NAME=unavailable
DMI_CHASSIS_ASSET_TAG=No Asset Tag
FS_LABELS=
ISO9660_DEVS=
KERNEL_CMDLINE=BOOT_IMAGE=/boot/vmlinuz-5.11.0-20-generic root=UUID=e6b98230-678e-4963-88a1-673f9e943acd ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
VIRT=vmware
UNAME_KERNEL_NAME=Linux
UNAME_KERNEL_RELEASE=5.11.0-20-generic
UNAME_KERNEL_VERSION=#21+21.10.1-Ubuntu SMP Wed Jun 9 15:08:14 UTC 2021
UNAME_MACHINE=x86_64
UNAME_NODENAME=ubuntu
UNAME_OPERATING_SYSTEM=GNU/Linux
DSNAME=
DSLIST=NoCloud OVF
MODE=search
ON_FOUND=all
ON_MAYBE=all
ON_NOTFOUND=disabled
pid=54738 ppid=54737
is_container=false
Checking for datasource 'NoCloud' via 'dscheck_NoCloud'
check for 'NoCloud' returned not-found[1]
Checking for datasource 'OVF' via 'dscheck_OVF'
DEBUG: dscheck_OVF: Check seed
DEBUG: dscheck_OVF: DI_VIRT
DEBUG: dscheck_OVF: is_azure_chassis
DEBUG: dscheck_OVF: ovf_vmware_transport_guestinfo
Running on vmware but rpctool query returned 1: No value found
DEBUG: dscheck_OVF: has_ovf_cdrom
DEBUG: dscheck_OVF: ovf_vmware_guest_customization
DEBUG: ovf_vmware_guest_customization: start check
DEBUG: scan plugin
check for 'OVF' returned not-found[1]
found= maybe=
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 2345.23s] returning 1
We want to also force vmware customization itself for this test which isn't the default.
$ echo "disable_vmware_customization: false" | sudo tee -a /etc/cloud/cloud.cfg.d/99_test.cfg
And then the result is in /etc/cloud-init/cloud.cfg
We will see the check say:
...
Checking for datasource 'OVF' via 'dscheck_OVF'
Running on vmware but rpctool query returned 1: No value found
/etc/cloud/cloud.cfg.d/99_test.cfg set disable_vmware_customization to false
check for 'OVF' returned found
found=OVF maybe=
Found single datasource: OVF
[up 3357.93s] returning 0
And the result is:
$ cat /run/cloud-init/cloud.cfg
datasource_list: [ OVF, None ]
In comparison the bad case has:
...
Checking for datasource 'OVF' via 'dscheck_OVF'
Running on vmware but rpctool query returned 1: No value found
check for 'OVF' returned not-found[1]
found= maybe=
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 3554.80s] returning 1
And the result is:
$ cat /run/cloud-init/cloud.cfg
di_report:
datasource_list: [ ]
# reporting not found result. notfound=disabled.
That is enough to construct a testcase for the SRU template ...
Furthermore I tried to check this in VMWare Workstation player 16
First of all as I'd expect systemd-detect-virt identified vmware already.
$ systemd-detect-virt
vmware
The code affected by this issue here is in "ovf_vmware_ guest_customiza tion".
That is only used in dscheck_OVF.
Therefore to streamline the run reduce config to just detect OVF in ds-identify.
$ echo "datasource_list: [NoCloud, OVF]" < sudo tee /etc/cloud/ cloud.cfg. d/99_test. cfg
Running ds-identify in verbose more to check behavior.
As expected I see it pass the steps before and reach ovf_vmware_ guest_customiza tion.
And indeed it fails to detect the pluging and does an early exit.
Here with a bit of additional debug inside of ovf_vmware_ guest_customiza tion: cloud-init/ ds-identify --force cloud.cfg. d/90_dpkg. cfg set datasource_list: [NoCloud, OVF] NAME=VMware Virtual Platform VENDOR= VMware, Inc. SERIAL= VMware- 56 4d 5c 48 27 3b 66 c7-18 31 7d 99 e7 30 40 7e UUID=485c4d56- 3b27-c766- 1831-7d99e73040 7e NAME=unavailabl e ASSET_TAG= No Asset Tag CMDLINE= BOOT_IMAGE= /boot/vmlinuz- 5.11.0- 20-generic root=UUID= e6b98230- 678e-4963- 88a1-673f9e943a cd ro find_preseed= /preseed. cfg auto noprompt priority=critical locale=en_US quiet NAME=Linux RELEASE= 5.11.0- 20-generic VERSION= #21+21. 10.1-Ubuntu SMP Wed Jun 9 15:08:14 UTC 2021 x86_64 ubuntu _SYSTEM= GNU/Linux disabled transport_ guestinfo guest_customiza tion guest_customiza tion: start check
$ sudo DEBUG_LEVEL=5 DI_LOG=stderr /usr/lib/
[up 2345.15s] ds-identify --force
policy loaded: mode=search report=false found=all maybe=all notfound=disabled
/etc/cloud/
DMI_PRODUCT_
DMI_SYS_
DMI_PRODUCT_
DMI_PRODUCT_
PID_1_PRODUCT_
DMI_CHASSIS_
FS_LABELS=
ISO9660_DEVS=
KERNEL_
VIRT=vmware
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_MACHINE=
UNAME_NODENAME=
UNAME_OPERATING
DSNAME=
DSLIST=NoCloud OVF
MODE=search
ON_FOUND=all
ON_MAYBE=all
ON_NOTFOUND=
pid=54738 ppid=54737
is_container=false
Checking for datasource 'NoCloud' via 'dscheck_NoCloud'
check for 'NoCloud' returned not-found[1]
Checking for datasource 'OVF' via 'dscheck_OVF'
DEBUG: dscheck_OVF: Check seed
DEBUG: dscheck_OVF: DI_VIRT
DEBUG: dscheck_OVF: is_azure_chassis
DEBUG: dscheck_OVF: ovf_vmware_
Running on vmware but rpctool query returned 1: No value found
DEBUG: dscheck_OVF: has_ovf_cdrom
DEBUG: dscheck_OVF: ovf_vmware_
DEBUG: ovf_vmware_
DEBUG: scan plugin
check for 'OVF' returned not-found[1]
found= maybe=
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 2345.23s] returning 1
With the fix (from PPA https:/ /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 4673) in place it finds the plugin as expected.
We want to also force vmware customization itself for this test which isn't the default.
$ echo "disable_ vmware_ customization: false" | sudo tee -a /etc/cloud/ cloud.cfg. d/99_test. cfg
And then the result is in /etc/cloud- init/cloud. cfg
We will see the check say: cloud.cfg. d/99_test. cfg set disable_ vmware_ customization to false
...
Checking for datasource 'OVF' via 'dscheck_OVF'
Running on vmware but rpctool query returned 1: No value found
/etc/cloud/
check for 'OVF' returned found
found=OVF maybe=
Found single datasource: OVF
[up 3357.93s] returning 0
And the result is: init/cloud. cfg
$ cat /run/cloud-
datasource_list: [ OVF, None ]
In comparison the bad case has:
...
Checking for datasource 'OVF' via 'dscheck_OVF'
Running on vmware but rpctool query returned 1: No value found
check for 'OVF' returned not-found[1]
found= maybe=
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 3554.80s] returning 1
And the result is: init/cloud. cfg
$ cat /run/cloud-
di_report:
datasource_list: [ ]
# reporting not found result. notfound=disabled.
That is enough to construct a testcase for the SRU template ...