--- cloud-init-0.7.7~bzr1155/debian/cloud-init.postinst 2015-11-05 09:59:04.000000000 -0700 +++ cloud-init-0.7.7~bzr1155.applied/debian/cloud-init.postinst 2015-11-17 12:35:04.877603098 -0700 @@ -193,6 +193,53 @@ } +apply_lp_1506187(){ + # With LP: #1506187, the Azure instance ID detection method was changed + # to use the DMI data. In order to prevent existing instances from thinking + # they are new instances, the instance ID needs to be updated here. + + if grep DataSourceAzure /var/lib/cloud/instance/datasource > /dev/null 2>&1; then + new_instance_id=$(cat /sys/devices/virtual/dmi/id/product_uuid) + old_instance_id=$(basename $(readlink -f /var/lib/cloud/instance)) + echo "Azure instance ID is: ${new_instance_id}" + + if [ -z "${new_instance_id}" -o -z "${old_instance_id}" ]; then + cat <