$ cat /etc/cloud/build.info 
build_name: server
serial: 20170303.2

# system used OpenStack datasource
$ cat /var/lib/cloud/data/result.json 
{
 "v1": {
  "datasource": "DataSourceOpenStack [net,ver=2]",
  "errors": []
 }
}

$ grep Looking /var/log/cloud-init.log
2017-03-08 22:32:07,094 - __init__.py[DEBUG]: Looking for for data source in: 
['NoCloud', 'ConfigDrive', 'OpenNebula', 'DigitalOcean', 'Azure', 'AltCloud', 
'OVF', 'MAAS', 'GCE', 'OpenStack', 'CloudSigma', 'SmartOS', 'Ec2', 
'CloudStack', 'None'], via packages ['', 'cloudinit.sources'] that matches 
dependencies ['FILESYSTEM']
2017-03-08 22:32:09,183 - __init__.py[DEBUG]: Looking for for data source in: 
['NoCloud', 'ConfigDrive', 'OpenNebula', 'DigitalOcean', 'Azure', 'AltCloud', 
'OVF', 'MAAS', 'GCE', 'OpenStack', 'CloudSigma', 'SmartOS', 'Ec2', 
'CloudStack', 'None'], via packages ['', 'cloudinit.sources'] that matches 
dependencies ['FILESYSTEM', 'NETWORK']

## upgrade
$ rel=$(lsb_release -sc)
$ line=$(awk '$1 == "deb" && $2 ~ /ubuntu.com/ { printf("%s %s %s-proposed main 
universe\n", $1, $2, rel); exit(0) }; ' "rel=$rel" /etc/apt/sources.list)
$ echo "$line" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt-get update -q && sudo apt-get install -q cloud-init
$ dpkg-query --show cloud-init
cloud-init      0.7.9-48-g1c795b9-0ubuntu1~16.10.1

## interactive...
$ dpkg-reconfigure cloud-init

$ cat /etc/cloud/cloud.cfg.d/90_dpkg.cfg 
# to update this file, run dpkg-reconfigure cloud-init
datasource_list: [ Ec2, None ]

$ sudo rm -Rf /var/lib/cloud /var/log/cloud-init* /run/cloud-init
$ sudo reboot


### then ssh back in, you see a warning
Looks like http://paste.ubuntu.com/24142108/

Write the file as instructed
$ cat /etc/cloud/cloud.cfg.d/99-ec2-datasource.cfg
#cloud-config
datasource:
 Ec2:
  strict_id: false

# clean up and reboot again
$ mkdir old2; sudo mv /run/cloud-init/ /var/log/cloud-init* /var/lib/cloud/ old2
$ sudo reboot


## Then go back in, no warning shown due to the config.
$ grep strict_ /var/log/cloud-init.log
2017-03-08 22:45:25,174 - DataSourceEc2.py[DEBUG]: strict_mode: false, 
cloud_platform=Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1660385

Title:
  Alert user of Ec2 Datasource on lookalike cloud

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1660385/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to