OpenStack datasource detection fails during init on Hyper-V compute nodes

Bug #1881814 reported by Steven De Kock
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned
cloud-init
Invalid
Undecided
Unassigned

Bug Description

The OpenStack datasource detection fails on an Hyper-V compute (Nova) node (running on-premises, no cloud provider). It does not try to attempt to use the metdata endpoint and the instance fails to initialize properly unless another datasource is used (like ConfigDrive or EC2, the latter which gives a warning).

The issue is in cloudinit/sources/DataSourceOpenStack.py, in the detect_openstack function. The DMI data does not match anything expected.

In Hyper-V the following info is returned from DMI:

grep "" /sys/class/dmi/id/*

/sys/class/dmi/id/bios_date:05/23/2012
/sys/class/dmi/id/bios_vendor:American Megatrends Inc.
/sys/class/dmi/id/bios_version:090006
/sys/class/dmi/id/board_name:Virtual Machine
/sys/class/dmi/id/board_serial:8096-7783-9998-*snip*
/sys/class/dmi/id/board_vendor:Microsoft Corporation
/sys/class/dmi/id/board_version:7.0
/sys/class/dmi/id/chassis_asset_tag:8096-7783-9998-*snip*
/sys/class/dmi/id/chassis_serial:8096-7783-9998-*snip*
/sys/class/dmi/id/chassis_type:3
/sys/class/dmi/id/chassis_vendor:Microsoft Corporation
/sys/class/dmi/id/chassis_version:7.0
/sys/class/dmi/id/modalias:dmi:bvnAmericanMegatrendsInc.:bvr090006:bd05/23/2012:svnMicrosoftCorporation:pnVirtualMachine:pvr7.0:rvnMicrosoftCorporation:rnVirtualMachine:rvr7.0:cvnMicrosoftCorporation:ct3:cvr7.0:
grep: /sys/class/dmi/id/power: Is a directory
/sys/class/dmi/id/product_name:Virtual Machine
/sys/class/dmi/id/product_serial:8096-7783-9998-*snip*
/sys/class/dmi/id/product_uuid:f41d9e0e-c208-*snip*
/sys/class/dmi/id/product_version:7.0
grep: /sys/class/dmi/id/subsystem: Is a directory
/sys/class/dmi/id/sys_vendor:Microsoft Corporation
/sys/class/dmi/id/uevent:MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvr090006:bd05/23/2012:svnMicrosoftCorporation:pnVirtualMachine:pvr7.0:rvnMicrosoftCorporation:rnVirtualMachine:rvr7.0:cvnMicrosoftCorporation:ct3:cvr7.0:

cat /proc/1/environ

HOME=/ init=/sbin/init NETWORK_SKIP_ENSLAVED= TERM=linux BOOT_IMAGE=/boot/vmlinuz-5.4.0-33-generic drop_caps= PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/ rootmnt=/root

Tags: dsid dsid-nova
Steven De Kock (sdekock)
summary: - OpenStack init fails on Hyper-V compute nodes
+ OpenStack datasource detection fails during init on Hyper-V compute
+ nodes
Steven De Kock (sdekock)
description: updated
description: updated
description: updated
Revision history for this message
Ryan Harper (raharper) wrote :

cloud-init detects OpenStack via DMI 'product_name' field. Upstream OpenStack sets this value to 'OpenStack Nova' or 'OpenStack Compute' and the HyperV compute driver should use these values.

From your output, the HyperV compute driver is setting your DMI 'product_name' field to:

/sys/class/dmi/id/product_name:Virtual Machine

which is why cloud-init does not detect that it's running on OpenStack.

Revision history for this message
Ryan Harper (raharper) wrote :

Can you confirm what OpenStack release you're using?

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Steven De Kock (sdekock) wrote :

I'm using OpenStack Train 20.0.0. With the OpenStack Compute driver from https://cloudbase.it/openstack-hyperv-driver/.

I'm running it on Windows Server 2012 R2.

Revision history for this message
Steven De Kock (sdekock) wrote :

Apparently the OpenStack Nova version is 20.0.1

Scott Moser (smoser)
tags: added: dsid
Changed in nova:
status: New → Confirmed
Revision history for this message
Scott Moser (smoser) wrote :

@Steven,

For such things to "just work", the platform needs to identify itself. Without a platform identifying itself, cloud-init (or any other software) cannot take platform-specific behavior.

The workaround is to configure the datasource_list to contain only OpenStack. So
  datasource_list: [OpenStack]
or
  datasource_list: [OpenStack, None]

Also, I marked as a bug against Nova. Other bugs like it: https://bugs.launchpad.net/nova/+bugs?field.tag=dsid

tags: added: dsid-nova
Revision history for this message
Ryan Harper (raharper) wrote :

> I'm using OpenStack Train 20.0.0. With the OpenStack Compute driver
> from https://cloudbase.it/openstack-hyperv-driver/.

You may want to file an issue with them directly. The upstream hyperv driver
for libvirt ensures the product name is configured:

https://bugs.launchpad.net/nova/+bug/1807352

<sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>RDO</entry>
      <entry name='product'>OpenStack Compute</entry>
      <entry name='version'>15.1.3-1.el7</entry>
      <entry name='serial'>9646161a-aa15-4a0a-b20f-f2a984052149</entry>
      <entry name='uuid'>***</entry>
      <entry name='family'>Virtual Machine</entry>
    </system>

Revision history for this message
Ryan Harper (raharper) wrote :

I'm marking the cloud-init task invalid; if you believe there is still a bug in cloud-init, please re-open this task along with new information explaining the bug.

Changed in cloud-init:
status: Incomplete → Invalid
Revision history for this message
Adrian Vladu (avladu) wrote :

As this bug was marked as invalid, I have opened another bug for this issue, where we can continue the discussion:
https://bugs.launchpad.net/cloud-init/+bug/1895976

Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.