Comment 5 for bug 974509

Revision history for this message
Scott Moser (smoser) wrote :

This is fixed in cloud-init trunk and in the ubuntu quantal package listed in comment 4.
I've tested this by:

 * setup:
   * have *some* way to add 'ubuntu-mirror' to the dns for kvm guests
     I used dnsmasq on a server system, and can control this by adding entries
     to /etc/hosts. You need to be able to configure your system such
     that 'host ubuntu-mirror' returns something:
     $ host ubuntu-mirror
     ubuntu-mirror has address 192.168.1.1
   * use make-seed-disk [1] to create a seed disk for cloud-init.
     $ cat user-data.txt
     #cloud-config
     password: passw0rd
     chpasswd: { expire: False }
     ssh_pwauth: True
     $ make-seed-disk seed.img user-data.txt

 * verify issue in released version of precise or quantal alpha3:
   * add 'ubuntu-mirror' entry to dns
   * boot kvm guest
   * check mirror in /etc/apt/sources by:
     $ grep "^deb .*main$" /etc/apt/sources.list
   * quantal-alpha3: ubuntu-mirror is selected
   * precise 20120728: ubuntu-mirror is selected

 * verify fix in quantal 20120804 or later:
   * add 'ubuntu-mirror' entry to dns
   * boot kvm guest of quantal 20120804 or later.
   * check mirror in /etc/apt/sources by:
     $ grep "^deb .*main$" /etc/apt/sources.list
 * verify no regression:
   * remove 'ubuntu-mirror' entry from dns, boot, check /etc/apt/sources.list
 * verify explicit enablement works:
   * add ubuntu-mirror
   * create seed disk with 'apt_mirror_search_dns: True' in user-data
   * verify that /etc/apt/sources.list shows ubuntu-mirror

 * Notes, boot kvm with:
    kvm -m 512 -curses -drive file=seed.img,if=virtio \
      -drive file=disk.img,if=virtio

--
[1] http://smoser.brickies.net/git/?p=tildabin.git;a=blob;f=make-seed-disk;hb=HEAD