Comment 4 for bug 1855458

Revision history for this message
Riccardo Murri (rmurri) wrote :

> Looking at the output provided, all we can tell is that we're on
> VMWare, but no indication that it's OpenStack, so cloud-init can't
> reasonable expect to know that it should enable the OpenStack
> datasource.

Let me mention again that this bug was introduced in Ubuntu 18.04; previous versions do not suffer from the same problem.

Also, if I modify the official cloud image and disable any datasource
*except* Ec2 (i.e., write `datasource_list: [ Ec2 ]` into
`/etc/cloud/cloud.cfg.d/90_dpkg.cfg`), then everything works fine.

So the issue is really `ds-identify` being too picky about when the
`Ec2` datasource is valid; from a cursory look, I can see that it just
checks if `/sys/hypervisor` contains some well-known AWS tag -- but
there are many cloud services which provide EC2-compatible metadata
(OpenNebula being another example), which would be skipped by this
logic!

> In the above dump of DMI data, is VMware Virtual Platform specific
> to VIO? and does VIO always expose metadata service?

This I do not know; I'm just a user, not a developer of the VIO
platform. But I don't see why probing for metadata sources should be
done only by looking at DMI information? EC2 metadata is handed out
by 169.254.169.254, if well-known locations for metadata are
available, then the EC2 datasource should be considered valid. (Other,
more specific, datasources can be probed earlier so they can be used
if found.)

This is a dump of the EC2 metadata that I can see from an instance in
VIO (same VM from whence the above files were extracted):

    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/
    ami-id
    ami-launch-index
    ami-manifest-path
    block-device-mapping/
    hostname
    instance-action
    instance-id
    instance-type
    local-hostname
    local-ipv4
    placement/
    public-hostname
    public-ipv4
    public-keys/
    reservation-id
    security-groups
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/ami-id
    ami-0000012a
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/ami-launch-index
    0
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/ami-manifest-path
    FIXME
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/hostname
    test.novalocal
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/instance-action
    none
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/instance-id
    i-00000793
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/instance-type
    m1.small
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/local-hostname
    test.novalocal
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/local-ipv4
    172.31.33.70
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/public-hostname
    test.novalocal
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/public-ipv4
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/reservation-id
    r-0asb5l2b
    root@ubuntu:~# w3m -dump http://169.254.169.254/latest/meta-data/security-groups
    default

Thanks,
Riccardo