Comment 5 for bug 1691772

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

# Verified seeding nocloud from URL sets hostname properly from seed.

url=https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bugs/lp-1691772/;
for release in xenial zesty; do
   get-proposed-cloudimg $release;
   img=$release-server-cloudimg-amd64-proposed.img;
   qemu-system-x86_64 -snapshot -enable-kvm -m 512 \
      -device virtio-net-pci,netdev=net00 -netdev type=user,id=net00 \
      -drive "file=$img,if=virtio" \
      -smbios "type=1,serial=ds=nocloud-net;seedfrom=$url" \
      -nographic;

   # login ubuntu:passw0rd
   hostname;
   cat /run/cloud-init/result.json;
   grep CODENAME /etc/lsb-release;
   dpkg-query --show cloud-init ;
done

-- xenial seed test

ubuntu@nocloud-guest:~$ hostname
nocloud-guest
ubuntu@nocloud-guest:~$ cat /run/cloud-init/result.json
{
 "v1": {
  "datasource": "DataSourceNoCloudNet [seed=dmi,https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bugs/lp-1691772/][dsmode=net]",
  "errors": []
 }
}
ubuntu@nocloud-guest:~$ grep -i code /etc/lsb-release
DISTRIB_CODENAME=xenial
ubuntu@nocloud-guest:~$ dpkg-query --show cloud-init
cloud-init 0.7.9-233-ge586fe35-0ubuntu1~16.04.1
ubuntu@nocloud-guest:~$ sudo shutdown -h now
...

-- zesty test
 http://cloud-images.ubuntu.com/daily/server/zesty/current/zesty-server-cloudimg-amd64.img
...

ubuntu@nocloud-guest:~$ hostname
nocloud-guest
ubuntu@nocloud-guest:~$ cat /run/cloud-init/result.json
{
 "v1": {
  "datasource": "DataSourceNoCloudNet [seed=dmi,https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bugs/lp-1691772/][dsmode=net]",
  "errors": []
 }
}
ubuntu@nocloud-guest:~$ grep CODENAME /etc/lsb-release
DISTRIB_CODENAME=zesty
ubuntu@nocloud-guest:~$ dpkg-query --show cloud-init
cloud-init 0.7.9-233-ge586fe35-0ubuntu1~17.04.1