yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #69424
[Bug 1734167] Re: DNS doesn't work in no-cloud as launched by ubuntu
$ wget http://cloud-images.ubuntu.com/artful/20171122/artful-server-
cloudimg-amd64.img
## set up dns locally for 'qemu-host' to the default ip for user networking.
$ grep qemu-host /etc/hosts
10.0.2.2 qemu-host
$ cat data/user-data
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
$ cat data/meta-data
instance-id: i-test
## webserv is http://bazaar.launchpad.net/~curtin-dev/curtin/trunk/view/head:/tools/webserv
$ webserve 44225 data
:: 44225
## backdoor the image so you can login with 'backdoor:passw0rd'
# backdoor-image is http://bazaar.launchpad.net/~smoser/+junk/backdoor-image/view/head:/backdoor-image
$ sudo backdoor-image -v --password=passw0rd
$ url="http://qemu-host:44225/"
$ qemu-system-x86_64 -enable-kvm \
-device virtio-net-pci,netdev=net00 \
-netdev type=user,id=net00 \
-drive file=artful-server-cloudimg-amd64.img,id=disk00,if=none,format=qcow2,index=0 \
-device virtio-blk,drive=disk00,serial=artful-server-cloudimg-amd64.img \
-vga none -nographic -snapshot -echr 0x5 \
-smbios type=1,serial=ds=nocloud-net;s=$url" -m 768
## console does show
## [ 20.388179] cloud-init[606]: 2017-11-24 17:03:13,786 - util.py[WARNING]: Gett
## ing data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloudNet'>
failed
## login
$ pastebinit /var/log/cloud-init.log
http://paste.ubuntu.com/26035544/
## interesting part of that is
2017-11-24 17:03:12,779 - url_helper.py[DEBUG]: [9/11] open 'http://qemu-host:44667/meta-data' with {'url': 'http://qemu-host:44667/meta-data', 'allow_redirects': True, 'method': 'GET', 'headers': {'User-Agent': 'Cloud-Init/17.1'}} configuration
2017-11-24 17:03:12,782 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2017-11-24 17:03:13,783 - url_helper.py[DEBUG]: [10/11] open 'http://qemu-host:44667/meta-data' with {'url': 'http://qemu-host:44667/meta-data', 'allow_redirects': True, 'method': 'GET', 'headers': {'User-Agent': 'Cloud-Init/17.1'}} configuration
2017-11-24 17:03:13,786 - handlers.py[DEBUG]: finish: init-network/search-NoCloudNet: FAIL: no network data found from DataSourceNoCloudNet
2017-11-24 17:03:13,786 - util.py[WARNING]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloudNet'> failed
2017-11-24 17:03:13,794 - util.py[DEBUG]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloudNet'> failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 332, in find_source
if s.get_data():
File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceNoCloud.py", line 157, in get_data
(md_seed, ud) = util.read_seeded(seedfrom, timeout=None)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 932, in read_seeded
md_resp = read_file_or_url(md_url, timeout, retries, file_retries)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 892, in read_file_or_url
exception_cb=exception_cb)
File "/usr/lib/python3/dist-packages/cloudinit/url_helper.py", line 270, in readurl
raise excps[-1]
cloudinit.url_helper.UrlError: HTTPConnectionPool(host='qemu-host', port=44667): Max retries exceeded with url: /meta-data (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbd6b21b0b8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2017-11-24 17:03:13,802 - handlers.py[DEBUG]: start: init-network/search-None: searching for network data from DataSourceNone
** Also affects: cloud-init (Ubuntu)
Importance: Undecided
Status: New
** Also affects: systemd (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1734167
Title:
DNS doesn't work in no-cloud as launched by ubuntu
Status in cloud-init:
New
Status in cloud-init package in Ubuntu:
New
Status in systemd package in Ubuntu:
New
Bug description:
I use no-cloud to test the kernel in CI (I am maintainer of the bcache
subsystem), and have been running it successfully under 16.04 cloud
images from qemu, using a qemu command that includes:
-smbios "type=1,serial=ds=nocloud-
net;s=https://raw.githubusercontent.com/mlyle/mlyle/master/cloud-
metadata/linuxtst/"
As documented here:
http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
Under the new 17.10 cloud images, this doesn't work: the network comes
up, but name resolution doesn't work-- /etc/resolv.conf is a symlink
to a nonexistent file at this point of the boot and systemd-resolved
is not running. When I manually hack /etc/resolv.conf in the cloud
image to point to 4.2.2.1 it works fine.
I don't know if nameservice not working is by design, but it seems
like it should work. The documentation states:
"With ds=nocloud-net, the seedfrom value must start with http://,
https:// or ftp://"
And https is not going to work for a raw IP address.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1734167/+subscriptions
References