Comment 0 for bug 1784685

Revision history for this message
Chad Smith (chad.smith) wrote :

cloud-init 18.3 cannot detect OpenStack datasource on Oracle cloud across reboots.

18.2 properly detects DataSourceOpenstack, but 18.3 added a detect_openstack helper function which fails to detect openstack datasource from the environment or DMI data matching a limit set of conditions:

  - DMI system-product_name in ['OpenStack Nova', 'OpenStack Compute']
      OracleCloud product-name is 'Standard PC (i440FX + PIIX, 1996)'
  - DMI chassis_asset_tag in ['OpenTelekomCloud']
         Oracle's chassis asset tag is 'OracleCloud.com'

  - proc/1/environ:product_name == 'OpenStack Nova'
        return True # Non-Intel cpus don't properly report dmi product names
    product_name = util.read_dmi_data('system-product-name')
    if product_name in VALID_DMI_PRODUCT_NAMES:
        return True
    elif util.read_dmi_data('chassis-asset-tag') in VALID_DMI_ASSET_TAGS:
        return True
    elif util.get_proc_env(1).get('product_name') == DMI_PRODUCT_NOVA:
       Oracle's /proc/1/environ has no product_name key:
$ sudo cat /proc/1/environ
HOME=/init=/sbin/initrecovery=TERM=linuxdrop_caps=BOOT_IMAGE=/boot/vmlinuz-4.15.0-29-genericPATH=/sbin:/usr/sbin:/bin:/usr/binPWD=/rootmnt=/root

We need a more permissive detect_openstack function to allow for detecting Oracle during cloud-init's get_data() method.