← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1691772] Re: provide a way to seed NoCloud from network without image modification.

 

** Changed in: cloud-init
       Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1691772

Title:
  provide a way to seed NoCloud from network without image modification.

Status in cloud-init:
  Fix Released
Status in cloud-init package in Ubuntu:
  Fix Released
Status in cloud-init source package in Xenial:
  Confirmed
Status in cloud-init source package in Zesty:
  Confirmed

Bug description:
  === Begin SRU Template ===
  [Impact]
  In bug 1660385, we made imitating the EC2 datasource more difficult.
  By design, that broke some users or platforms who have done so in the past.

  The change here gives users who were using the Ubuntu images in a low-tech
  "No Cloud" fashion an easier way to regain that functionality.

  The solution was to read the 'system-serial-number' field in DMI data and
  consider it as as input to the nocloud datasource in a similar way to
  what we had done in the past with the kernel command line.

  [Test Case]
  a.) download a cloud image, update its cloud-init

     # see below for 'get-proposed-cloudimg'
     $ release=xenial
     $ get-proposed-cloudimg $release

  b.) boot that image with command line pointing at a 'seed'

     $ img=${release}-server-cloudimg-amd64-proposed.img
     # url has to provide '<url>/user-data' and '<url>/meta-data'
     $ url=https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bugs/lp-1691772/
     $ 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

     # note,  you can hit 'ctrl-a c' to toggle between the qemu monitor
     # and the serial console in '-nographic' mode.

  c.) Log in with 'ubuntu:passw0rd' and check hostname.
     If the above url was correctly used, then:
       * you can log in with 'ubuntu:passw0rd'
       * the hostname will be set to 'nocloud-guest'
       * /run/cloud-init/result.json will show that the url has been used.

     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": []
      }
     }

  [Regression Potential]
  The code attempts to parse the 'system-serial-number' entry in dmi data as a
  string with data in it.  If that field had the string 'ds=nocloud' that was
  not intended as consumable for cloud-init, a false positive could occur and
  an exception cause the NoCloud datasource to not read data from another
  location.

  This seems somewhat unlikely and other paths should result in simply no
  new action being taken.

  [Other Info]
  Upstream commit at
    https://git.launchpad.net/cloud-init/commit/?id=802e7cb2da8

  get-proposed-cloudimg is available at [1], it basically downloads an
  ubuntu cloud image, enables -proposed and upgrade/installs cloud-init.

  --
  [1] https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/tree/bin/get-proposed-cloudimg

  === End SRU Template ===

  
  Vladimir suggested this in bug 1660385 comment 12 [1].
  The idea would be to have a supported way that you could seed images with cloud-init using Nocloud without any tinkering in the image.  That would mean
   a.) no second block device
   b.) no usage of kernel command line.

  --
  [1] https://bugs.launchpad.net/cloud-init/+bug/1660385/comments/12

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