nova-lxd needs to read 'product_name' in environment, not 'platform'

Bug #1685810 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Scott Moser
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Unassigned
Yakkety
Fix Released
Medium
Unassigned
Zesty
Fix Released
Medium
Unassigned
Artful
Fix Released
Medium
Unassigned

Bug Description

=== Begin SRU Template ===
[Impact]
Warning message for nova-lxd images in openstack clouds due to no valid datasource found.

[Test Case]
# It downloads a cloud image of a given release, and then creates a -proposed
image with cloud-init upgraded.
wget https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/plain/bin/lxc-proposed-snapshot
chmod 755 get-proposed-image

source novarc

for release in xenial yakkety zesty do;
 ref=$release-proposed;
 lxc-proposed-snapshot --proposed --publish $release $ref;
 lxc image export $ref .;
 imagefile=`ls -tr *gz | tail -n 1`
 mkdir $ref;
 cd $ref;
 sudo tar -zxvpf ../$imagefile; # preserve permissions
 cd rootfs;
 sudo tar zcpvf $ref.tar.gz *;
 #upload raw image to your cloud
  openstack image create --disk-format raw --container-format bare --file $ref.tar.gz testing/$ref.tar.gz;
  openstack server create --image testing/$ref.tar.gz --flavor=m1.tiny lxd-$release --key-name <your-key>;
  nova floating-ip-create;
  nova foating-ip-associate <server> <address>;
  ssh ubuntu@<address> 'sudo DEBUG_LEVEL=2 DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force 2>&1 | grep Found'; # single datasource: OpenStack
done

[Regression Potential]
Low as this only addresses the warning by correctly identifying the OpenStack cloud datasource.

[Other Info]

=== End SRU Template ===

It seems that signals were crossed in bug 1661797.
cloud-init implementation reads the environment variable 'platform' from pid1, and nova-lxd implementation exported 'product_name'.

Thus, ssh to nova-lxd provided container, user sees a warning.
Also
$ sudo DEBUG_LEVEL=2 DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force 2>&1 | grep PLAT
PID_1_PLATFORM=unavailable

While:
$ sudo cat /proc/1/environ | tr '\0' '\n'
product_name=OpenStack Nova
container=lxc

Related bugs:
 * bug 1661797: identify lxd-nova platform to enable Openstack datasource

Related branches

Scott Moser (smoser)
description: updated
Scott Moser (smoser)
Changed in cloud-init:
status: Confirmed → Fix Committed
Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in cloud-init (Ubuntu Xenial):
status: New → Confirmed
Changed in cloud-init (Ubuntu Yakkety):
status: New → Confirmed
Changed in cloud-init (Ubuntu Zesty):
status: New → Confirmed
Changed in cloud-init (Ubuntu Xenial):
importance: Undecided → Medium
Changed in cloud-init (Ubuntu Yakkety):
importance: Undecided → Medium
Changed in cloud-init (Ubuntu Zesty):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.9-113-g513e99e0-0ubuntu1

---------------
cloud-init (0.7.9-113-g513e99e0-0ubuntu1) artful; urgency=medium

  * New upstream snapshot.
    - nova-lxd: read product_name from environment, not platform.
      (LP: #1685810)
    - Fix yum repo config where keys contain array values
      [Dylan Perry] (LP: #1592150)
    - template: Update debian backports template [Joshua Powers] (LP: #1627293)
    - rsyslog: replace ~ with stop [Joshua Powers] (LP: #1367899)
    - Doc: add additional RTD examples [Joshua Powers] (LP: #1459604)
    - Fix growpart for some cases when booted with root=PARTUUID.
      (LP: #1684869)
    - pylint: update output style to parseable [Joshua Powers]
    - pylint: fix all logging warnings [Joshua Powers]
    - CloudStack: Add NetworkManager to list of supported DHCP lease dirs.
      [Syed Mushtaq Ahmed]
    - net: kernel lies about vlans not stealing mac addresses, when they do
      [Dimitri John Ledkov] (LP: #1682871)
    - ds-identify: Check correct path for "latest" config drive
      [Daniel Watkins] (LP: #1673637)
    - doc: Fix example for resolve.conf configuration.
      [Jon Grimm] (LP: #1531582)
    - Fix examples that reference upstream chef repository.
      [Jon Grimm] (LP: #1678145)
    - doc: correct grammar and improve clarity in merging documentation.
      [David Tagatac]
    - doc: Add missing doc link to snap-config module. [Ryan Harper]
    - snap: allows for creating cloud-init snap [Joshua Powers]
    - DigitalOcean: assign IPv4ll address to lowest indexed interface.
      [Ben Howard]
    - DigitalOcean: configure all NICs presented in meta-data. [Ben Howard]
    - Remove (and/or fix) URL shortener references [Jon Grimm] (LP: #1669727)
    - HACKING.rst: more info on filling out contributors agreement.
      [Scott Moser]
    - util: teach write_file about copy_mode option
      [Lars Kellogg-Stedman] (LP: #1644064)
    - DigitalOcean: bind resolvers to loopback interface. [Ben Howard]
    - tests: fix AltCloud tests to not rely on blkid (LP: #1636531)

 -- Scott Moser <email address hidden> Tue, 25 Apr 2017 16:34:08 -0400

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Chad Smith (chad.smith)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Scott, or anyone else affected,

Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-113-g513e99e0-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Chad Smith (chad.smith) wrote :
Download full text (8.7 KiB)

Validated xenial
$ ref=$release-proposed
$ lxc image export $ref .
Output is in a3a030aa025bbef0827529a551839f89aabf6e08446f58cf070cbcaa91dd24e8.tar.gz
$ imagefile=`ls -tr *gz | tail -n 1`
$ mkdir $ref; cd $ref; tar -zxvf ../$imagefile; cd rootfs; tar zcvf /tmp/$ref.tar.gz *;
$ openstack image create --disk-format raw --container-format bare --file /tmp/$ref.tar.gz bbsw/$ref.tar.gz
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| checksum | e957defc94e8f9dcea4a725fbdb4f0cb |
| container_format | bare |
| created_at | 2017-05-10T20:36:11Z |
| disk_format | raw |
| file | /v2/images/c87896c7-1a9b-49a6-8ce5-bb7aca11a245/file |
| id | c87896c7-1a9b-49a6-8ce5-bb7aca11a245 |
| min_disk | 0 |
| min_ram | 0 |
| name | bbsw/xenial-proposed.tar.gz |
| owner | e0eb2d253881491abf92bd522bba9f32 |
| properties | direct_url='rbd://9f63f914-1ae6-11e7-922d-00163e397f92/glance/c87896c7-1a9b-49a6-8ce5-bb7aca11a245/snap', locations='[{'url': |
| | 'rbd://9f63f914-1ae6-11e7-922d-00163e397f92/glance/c87896c7-1a9b-49a6-8ce5-bb7aca11a245/snap', 'metadata': {}}]' |
| protected | False |
| schema | /v2/schemas/image ...

Read more...

tags: added: verification-done-xenial
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Scott, or anyone else affected,

Accepted cloud-init into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-113-g513e99e0-0ubuntu1~16.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Yakkety):
status: Confirmed → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Scott, or anyone else affected,

Accepted cloud-init into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-113-g513e99e0-0ubuntu1~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Zesty):
status: Confirmed → Fix Committed
Chad Smith (chad.smith)
description: updated
Revision history for this message
Chad Smith (chad.smith) wrote :
Download full text (4.3 KiB)

Validated yakkety and zesty discovered single OpenStack datasource:
ref=yakkety-proposed
$ lxc image export $ref .
Output is in a....tar.gz
$ imagefile=`ls -tr *gz | tail -n 1`
$ mkdir $ref; cd $ref; tar -zxvf ../$imagefile; cd rootfs; tar zcvf /tmp/$ref.tar.gz *;
$ openstack image create --disk-format raw --container-format bare --file /tmp/$ref.tar.gz bbsw/$ref.tar.gz
...
| name | bbsw/yakkety-proposed.tar.gz |
...
$ openstack server create --image bbsw/yakkety-proposed.tar.gz --flavor m1.tiny lxd-yakkety --user-data user-data.txt --key-name chad-smith
...
| image | bbsw/zesty-proposed.tar.gz (97d35b90-ff04-478e-ae77-89c3b5c86a41) |
| key_name | chad-smith |
| name | lxd-zesty
$ nova floating-ip-associate lxd-yakkety 10.245.162.112
$ ssh ubuntu@10.245.162.112
The authenticity of host '10.245.162.112 (10.245.162.112)' can't be established.
ECDSA key fingerprint is SHA256:IwlHdz1zqPh2m4fWOkSLxMm82GAFZ6KNzPo2fnHjM3g.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.245.162.112' (ECDSA) to the list of known hosts.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
### no warning
ubuntu@lxd-yakkety:~$ grep VERSION= /etc/os-release
VERSION="16.10 (Yakkety Yak)"
ubuntu@lxd-yakkety:~$ dpkg -l cloud-init
ii cloud-init 0.7.9-113-g513e99e0-0ub all Init scripts for cloud instances

$ubuntu@lxd-yakkety:~$ sudo DEBUG_LEVEL=2 DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force 2>&1 | grep Found
Found single datasource: OpenStack

----zesty
ref=zesty-proposed
$ lxc image export $ref .
Output is in a....tar.gz
$ imagefile=`ls -tr *gz | tail -n 1`
$ mkdir $ref; cd $ref; tar -zxvf ../$imagefile; cd rootfs; tar zcvf /tmp/$ref.tar.gz *;
$ openstack image create --disk-format raw --container-format bare --file /tmp/$ref.tar.gz bbsw/$ref.tar.gz
...
| name | bbsw/zesty-proposed.tar.gz |
...
$ openstack server create --image bbsw/zesty-proposed.tar.gz --flavor m1.tiny lxd-zesty --user-data user-data.txt --key-name chad-smith
...
| image | bbsw/zesty-proposed.tar.gz (97d35b90-ff04-478e-ae77-89c3b5c86a41) |
| key_name | chad-smith |
| name ...

Read more...

tags: added: verification-done-yakkety verification-done-zesty
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.9-113-g513e99e0-0ubuntu1~16.04.1

---------------
cloud-init (0.7.9-113-g513e99e0-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

  * debian/update-grub-legacy-ec2: fix early exit failure no /etc/fstab
    file. (LP: #1682160)
  * New upstream snapshot.
    - nova-lxd: read product_name from environment, not platform.
      (LP: #1685810)
    - Fix yum repo config where keys contain array values [Dylan Perry]
    - template: Update debian backports template [Joshua Powers]
    - rsyslog: replace ~ with stop [Joshua Powers] (LP: #1367899)
    - Doc: add additional RTD examples [Joshua Powers]
    - Fix growpart for some cases when booted with root=PARTUUID.
      (LP: #1684869)
    - pylint: update output style to parseable [Joshua Powers]
    - pylint: fix all logging warnings [Joshua Powers]
    - CloudStack: Add NetworkManager to list of supported DHCP lease dirs.
      [Syed Mushtaq Ahmed]
    - net: kernel lies about vlans not stealing mac addresses, when they do
      [Dimitri John Ledkov] (LP: #1682871)
    - ds-identify: Check correct path for "latest" config drive
      [Daniel Watkins] (LP: #1673637)
    - doc: Fix example for resolv.conf configuration. [Jon Grimm]
    - Fix examples that reference upstream chef repository. [Jon Grimm]
    - doc: correct grammar and improve clarity in merging documentation.
      [David Tagatac]
    - doc: Add missing doc link to snap-config module. [Ryan Harper]
    - snap: allows for creating cloud-init snap [Joshua Powers]
    - DigitalOcean: assign IPv4ll address to lowest indexed interface.
      [Ben Howard] (LP: #1676908)
    - DigitalOcean: configure all NICs presented in meta-data.
      [Ben Howard] (LP: #1676908)
    - Remove (and/or fix) URL shortener references [Jon Grimm]
    - HACKING.rst: more info on filling out contributors agreement.
    - util: teach write_file about copy_mode option
      [Lars Kellogg-Stedman] (LP: #1644064)
    - DigitalOcean: bind resolvers to loopback interface.
      [Ben Howard] (LP: #1676908)
    - tests: fix AltCloud tests to not rely on blkid (LP: #1636531)

 -- Scott Moser <email address hidden> Thu, 27 Apr 2017 12:51:04 -0400

Changed in cloud-init (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.9-113-g513e99e0-0ubuntu1~16.10.1

---------------
cloud-init (0.7.9-113-g513e99e0-0ubuntu1~16.10.1) yakkety; urgency=medium

  * debian/update-grub-legacy-ec2: fix early exit failure no /etc/fstab
    file. (LP: #1682160)
  * New upstream snapshot.
    - nova-lxd: read product_name from environment, not platform.
      (LP: #1685810)
    - Fix yum repo config where keys contain array values [Dylan Perry]
    - template: Update debian backports template [Joshua Powers]
    - rsyslog: replace ~ with stop [Joshua Powers] (LP: #1367899)
    - Doc: add additional RTD examples [Joshua Powers]
    - Fix growpart for some cases when booted with root=PARTUUID.
      (LP: #1684869)
    - pylint: update output style to parseable [Joshua Powers]
    - pylint: fix all logging warnings [Joshua Powers]
    - CloudStack: Add NetworkManager to list of supported DHCP lease dirs.
      [Syed Mushtaq Ahmed]
    - net: kernel lies about vlans not stealing mac addresses, when they do
      [Dimitri John Ledkov] (LP: #1682871)
    - ds-identify: Check correct path for "latest" config drive
      [Daniel Watkins] (LP: #1673637)
    - doc: Fix example for resolv.conf configuration. [Jon Grimm]
    - Fix examples that reference upstream chef repository. [Jon Grimm]
    - doc: correct grammar and improve clarity in merging documentation.
      [David Tagatac]
    - doc: Add missing doc link to snap-config module. [Ryan Harper]
    - snap: allows for creating cloud-init snap [Joshua Powers]
    - DigitalOcean: assign IPv4ll address to lowest indexed interface.
      [Ben Howard] (LP: #1676908)
    - DigitalOcean: configure all NICs presented in meta-data.
      [Ben Howard] (LP: #1676908)
    - Remove (and/or fix) URL shortener references [Jon Grimm]
    - HACKING.rst: more info on filling out contributors agreement.
    - util: teach write_file about copy_mode option
      [Lars Kellogg-Stedman] (LP: #1644064)
    - DigitalOcean: bind resolvers to loopback interface.
      [Ben Howard] (LP: #1676908)
    - tests: fix AltCloud tests to not rely on blkid (LP: #1636531)

 -- Scott Moser <email address hidden> Thu, 27 Apr 2017 13:38:40 -0400

Changed in cloud-init (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.9-113-g513e99e0-0ubuntu1~17.04.1

---------------
cloud-init (0.7.9-113-g513e99e0-0ubuntu1~17.04.1) zesty; urgency=medium

  * debian/update-grub-legacy-ec2: fix early exit failure no /etc/fstab
    file. (LP: #1682160)
  * New upstream snapshot.
    - nova-lxd: read product_name from environment, not platform.
      (LP: #1685810)
    - Fix yum repo config where keys contain array values [Dylan Perry]
    - template: Update debian backports template [Joshua Powers]
    - rsyslog: replace ~ with stop [Joshua Powers] (LP: #1367899)
    - Doc: add additional RTD examples [Joshua Powers]
    - Fix growpart for some cases when booted with root=PARTUUID.
      (LP: #1684869)
    - pylint: update output style to parseable [Joshua Powers]
    - pylint: fix all logging warnings [Joshua Powers]
    - CloudStack: Add NetworkManager to list of supported DHCP lease dirs.
      [Syed Mushtaq Ahmed]
    - net: kernel lies about vlans not stealing mac addresses, when they do
      [Dimitri John Ledkov] (LP: #1682871)
    - ds-identify: Check correct path for "latest" config drive
      [Daniel Watkins] (LP: #1673637)
    - doc: Fix example for resolv.conf configuration. [Jon Grimm]
    - Fix examples that reference upstream chef repository. [Jon Grimm]
    - doc: correct grammar and improve clarity in merging documentation.
      [David Tagatac]
    - doc: Add missing doc link to snap-config module. [Ryan Harper]
    - snap: allows for creating cloud-init snap [Joshua Powers]
    - DigitalOcean: assign IPv4ll address to lowest indexed interface.
      [Ben Howard] (LP: #1676908)
    - DigitalOcean: configure all NICs presented in meta-data.
      [Ben Howard] (LP: #1676908)
    - Remove (and/or fix) URL shortener references [Jon Grimm]
    - HACKING.rst: more info on filling out contributors agreement.
    - util: teach write_file about copy_mode option
      [Lars Kellogg-Stedman] (LP: #1644064)
    - DigitalOcean: bind resolvers to loopback interface.
      [Ben Howard] (LP: #1676908)
    - tests: fix AltCloud tests to not rely on blkid (LP: #1636531)

 -- Scott Moser <email address hidden> Thu, 27 Apr 2017 15:09:31 -0400

Changed in cloud-init (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.