host $ rel=vivid serial=20150422
host $ 
url=http://cloud-images.ubuntu.com/releases/$rel/release-$serial/ubuntu-14.04-server-cloudimg-amd64-disk1.img
host $ img_dist="$rel-$serial-amd64.img.dist"
host $ img=${img_dist%.dist}


## host
host $ pkgs="qemu-utils qemu-system-x86 cloud-image-utils"
host $ sudo apt-get --assume-yes install $pkgs


host $ [ -f "$img_dist" ] ||
  { wget "$url" -O "$img_dist.tmp" && mv "$img_dist.tmp" "$img_dist"; }
host $ [ -f "$img" ] ||
   { qemu-img convert -O raw "$img_dist" "$img.tmp" && mv "$img.tmp" "$img"; }

## create a user-data to let you log in
host $ cat > user-data <<EOF 
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF
host $ cloud-localds seed.img user-data

## launch a guest with 2 nics, one stable/ssh in, one for testing
host $ qemu-img create -f qcow2 -b $img disk.img
host $ qemu-system-x86_64 -enable-kvm \
   -device virtio-net-pci,netdev=net00 \
   -netdev user,id=net00,hostfwd=tcp::2222-:22 \
   -device virtio-net-pci,netdev=net01 \
   -netdev user,id=net01 \
   -drive if=virtio,file=disk.img,if=virtio \
   -drive if=virtio,file=seed.img,if=virtio \
   -m 768 -curses

## have 2 windows / shells in system.
### setup system
guest $ 
crazy_url=http://bazaar.launchpad.net/~smoser/+junk/lp1444428/download/head:/nicgocrazy-20150421193756-8xtcmllz0qf4efb4-2/nic-go-crazy
guest $ $ 
loop_url=http://bazaar.launchpad.net/~smoser/+junk/lp1444428/download/head:/ifuploop-20150421193756-8xtcmllz0qf4efb4-1/ifup-loop

guest $ wget "$crazy_url" -O nic-go-crazy
guest $ wget "$loop_url" -O loop-ifup
guest $ chmod 755 nic-go-crazy loop-ifup
guest $ echo "iface eth1 inet dhcp" | sudo tee -a /etc/network/interfaces

### recreate failure ####
guest-w1 % sudo ./nic-go-crazy 20 nicfoo
guest-w2 % sudo ./loop-ifup
 sudo ./loop-ifup
sudo: unable to resolve host ubuntu
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Error getting interface address for 'nic0927390'; No such device
Error getting interface information.

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging..

exiting.
Failed to bring up eth1.

### enable proposed and get update ###
guest $ rel=$(lsb_release -sc)
guest $ echo "deb http://archive.ubuntu.com/ubuntu ${rel}-proposed main" |
   sudo tee -a /etc/apt/sources.list.d/proposed.list
guest $ sudo apt-get update --quiet
guest $ apt-cache policy isc-dhcp-client
isc-dhcp-client:
  Installed: 4.3.1-5ubuntu2
  Candidate: 4.3.1-5ubuntu2.1
  Version table:
     4.3.1-5ubuntu2.1 0
        500 http://archive.ubuntu.com/ubuntu/ vivid-proposed/main amd64 Packages
 *** 4.3.1-5ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
        100 /var/lib/dpkg/status

guest $ sudo apt-get install isc-dhcp-client -qy

## retry the 'recreate failure' test above. It should run indefinintely.


** Tags removed: verification-needed
** Tags added: verification-done

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

Title:
  dhclient can fail if other nics are renamed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1446767/+subscriptions

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

Reply via email to