Comment 4 for bug 1674685

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

# launch an instance on azure of yakkety and of xenial
$ azure vm create --vm-size=Basic_A0 \
    --vm-name=smoser0413y "--location=East US" \
    --<email address hidden> --no-ssh-password --ssh=22 \
    smoser0413y b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-yakkety-16_10-amd64-server-20170412-en-us-30GB smoser

$ azure vm create --vm-size=Basic_A0 \
    --vm-name=smoser0413y "--location=East US" \
    --<email address hidden> --no-ssh-password --ssh=22 \
    smoser0413y b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-yakkety-16_10-amd64-server-20170412-en-us-30GB smoser

## on each system
% git clone https://git.launchpad.net/~smoser/cloud-init/+git/sru-info
% sudo ./sru-info/bin/enable-proposed
% sudo apt-get -q update
% sudo apt-get install -qy cloud-init
## this just sets the hostname back to the stock 'ubuntu'
## so the code will think it needs to re-publish it
## as it only publishes if it differs from the existing.
% echo "ubuntu" | sudo tee /etc/hostname
% sudo ./sru-info/bin/do-reboot clean save=orig

# reconnect and verify yakkety
$ cat /etc/cloud/build.info
build_name: server
serial: 20170412

$ dpkg-query --show cloud-init
cloud-init 0.7.9-90-g61eb03fe-0ubuntu1~16.10.1

$ lsb_release -sc
yakkety

$ grep WARN /var/log/cloud-init.log || echo no warn
no warn
$ grep --after-context=7 "pubhname" /var/log/cloud-init.log
2017-04-13 20:52:40,641 - DataSourceAzure.py[DEBUG]: pubhname: publishing hostname [hostname=smoser0413y policy=True interface=eth0]
2017-04-13 20:52:40,648 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2017-04-13 20:52:40,648 - util.py[DEBUG]: Read 11 bytes from /proc/uptime
2017-04-13 20:52:40,649 - util.py[DEBUG]: Running command ['sh', '-xc', 'i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x'] with allowed return codes [0] (shell=False, capture=False)
2017-04-13 20:52:45,982 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2017-04-13 20:52:45,982 - util.py[DEBUG]: Read 11 bytes from /proc/uptime
2017-04-13 20:52:45,982 - util.py[DEBUG]: publishing hostname took 5.334 seconds (5.34)
2017-04-13 20:52:45,983 - util.py[DEBUG]: Running command ['hostname', 'ubuntu'] with allowed return codes [0] (shell=False, capture=True)

$ cat /run/cloud-init/result.json
{
 "v1": {
  "datasource": "DataSourceAzureNet [seed=/dev/sr0]",
  "errors": []
 }
}

# reconnect and verify xenial
$ dpkg-query --show cloud-init
cloud-init 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1
$ cat /etc/cloud/build.info
build_name: server
serial: 20170412
$ lsb_release -sc
xenial
$ rep WARN /var/log/cloud-init.log || echo no warn
The program 'rep' is currently not installed. You can install it by typing:
sudo apt install rep
no warn
$ ^C
$ grep WARN /var/log/cloud-init.log || echo no warn
no warn
$ grep --after-context=7 "pubhname" /var/log/cloud-init.log
2017-04-13 20:54:51,199 - DataSourceAzure.py[DEBUG]: pubhname: publishing hostname [hostname=smoser0413x policy=True interface=eth0]
2017-04-13 20:54:51,199 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2017-04-13 20:54:51,199 - util.py[DEBUG]: Read 11 bytes from /proc/uptime
2017-04-13 20:54:51,207 - util.py[DEBUG]: Running command ['sh', '-xc', 'i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x'] with allowed return codes [0] (shell=False, capture=False)
2017-04-13 20:54:56,081 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2017-04-13 20:54:56,081 - util.py[DEBUG]: Read 11 bytes from /proc/uptime
2017-04-13 20:54:56,081 - util.py[DEBUG]: publishing hostname took 4.869 seconds (4.88)
2017-04-13 20:54:56,081 - util.py[DEBUG]: Running command ['hostname', 'ubuntu'] with allowed return codes [0] (shell=False, capture=True)
$ cat /run/cloud-init/result.json
{
 "v1": {
  "datasource": "DataSourceAzureNet [seed=/dev/sr0]",
  "errors": []
 }
}