You're right, there is not a standard way of identifying cloud platforms.
One way of doing such is as Openstack Nova does.
I think this is a reasonable "best practice".
And qemu cmdline contains:
-smbios "type=1,manufacturer=OpenStack Foundation,product=OpenStack Nova,version=12.0.3,serial=fb14e3a3-bff8-4e1a-8d27-ee2a2414d822,uuid=bf7f3844-42d3-4bcf-a58c-a33b0c12cb28,family=Virtual Machine"
The driver for doing this is:
a.) to improve boot speed of Ubuntu images by quickly discarding datasources that are not expected to be there.
b.) to utilmately entirely disable cloud-init if no datasource would be found.
c.) to avoid attempting to access network resources that may not be present. That can result in timeouts or other unexpected behavior.
Neil,
You're right, there is not a standard way of identifying cloud platforms.
One way of doing such is as Openstack Nova does.
I think this is a reasonable "best practice".
Amazon shows what they are doing at docs.aws. amazon. com/AWSEC2/ latest/ UserGuide/ identify_ ec2_instances. html
http://
To show what openstack does: dmi/id/ product_ name system- product- name
$ cat /sys/class/
OpenStack Nova
$ sudo dmidecode --string=
OpenStack Nova
From outside, virsh xml contains: rer'>OpenStack Foundation</entry> >OpenStack Nova</entry> >13.1.1< /entry> >fb14e3a3- bff8-4e1a- 8d27-ee2a2414d8 22</entry> >0c0fb83e- a83f-49c2- b483-db405fbdc8 ee</entry> >Virtual Machine</entry>
<sysinfo type='smbios'>
<system>
<entry name='manufactu
<entry name='product'
<entry name='version'
<entry name='serial'
<entry name='uuid'
<entry name='family'
</system>
And qemu cmdline contains: manufacturer= OpenStack Foundation, product= OpenStack Nova,version= 12.0.3, serial= fb14e3a3- bff8-4e1a- 8d27-ee2a2414d8 22,uuid= bf7f3844- 42d3-4bcf- a58c-a33b0c12cb 28,family= Virtual Machine"
-smbios "type=1,
The driver for doing this is:
a.) to improve boot speed of Ubuntu images by quickly discarding datasources that are not expected to be there.
b.) to utilmately entirely disable cloud-init if no datasource would be found.
c.) to avoid attempting to access network resources that may not be present. That can result in timeouts or other unexpected behavior.