identify lxd-nova platform to enable Openstack datasource

Bug #1661797 reported by Scott Moser
50
This bug affects 6 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Unassigned
nova-lxd
Fix Released
High
Unassigned
cloud-init (Ubuntu)
Fix Released
High
Unassigned
Xenial
Confirmed
Medium
Unassigned
Yakkety
Confirmed
Medium
Unassigned
Zesty
Fix Released
High
Unassigned
nova-lxd (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
In Progress
High
Unassigned
Yakkety
In Progress
High
Unassigned
Zesty
Fix Released
Medium
Unassigned

Bug Description

nova-lxd uses the Openstack Network metadata service.

In an effort to avoid polling metadata services in cloud-init we will disable
attempts to reach the MD without positive identification of the cloud.

We need to be able to positively identify that the container we are running
inside should have access to an openstack metadata service so we can
safely assume it will be there.

How can we positively identify that a container is running in nova-lxd?
Is there anything in the environment (possibly pid 1 environ?) that we
can look at?

One way I could see doing t his would be for lxd-nova to put
   CLOUD_PLATFORM='openstack-nova'
inside the pid 1 environment. then cloud-init can look at /proc/1/environ
and pick that out.

Open to other ideas, and would love it if there was something we could do.

Related bugs
 bug 1660385: Alert user of Ec2 Datasource on lookalike cloud
 bug 1661797: identify lxd-nova platform to enable Openstack datasource
 bug 1661693: identify brightbox platform to enable Ec2 datasource
 bug 1663304: identify openstack kvm platform on arm64
 bug 1668313: [SRU] mitaka point release

Tags: dsid
Revision history for this message
Ryan Harper (raharper) wrote :

We could also look at exporting a file/key via lxcfs that we could detect? Not sure if lxcfs can also emulate sys, but if so, then /sys/hypervisor/lxd would be a good place as well.

Scott Moser (smoser)
Changed in cloud-init:
status: New → Confirmed
Changed in cloud-init (Ubuntu):
status: New → Confirmed
Changed in nova-lxd:
status: New → Confirmed
Changed in cloud-init:
importance: Undecided → High
Changed in cloud-init (Ubuntu):
importance: Undecided → High
description: updated
Revision history for this message
Tycho Andersen (tycho-s) wrote :

You could also potentially be the first users of /dev/lxd, setting some key like user.is-nova-lxd: true for the container, and then querying it over /dev/lxd.

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

There is a gerrit review at https://review.openstack.org/#/c/431247/1

Revision history for this message
Paul Hummer (rockstar) wrote :

I've combined this patch functionality into this patch (the flavor<->profile code was refactored in an already submitted patch). https://review.openstack.org/#/c/411985/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova-lxd (master)

Change abandoned by Paul Hummer (<email address hidden>) on branch: master
Review: https://review.openstack.org/431247
Reason: The actual change occurred in another patch.

Scott Moser (smoser)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.9-23-g0df21b6-0ubuntu1

---------------
cloud-init (0.7.9-23-g0df21b6-0ubuntu1) zesty; urgency=medium

  * New upstream snapshot.
    - support nova-lxd by reading platform from environment of pid 1.
      (LP: #1661797)
    - ds-identify: change aarch64 to use the default for non-dmi systems.
      that default is to enable cloud-init even if no datasources are
      explicitly found.
    - Remove style checking during build and add latest style checks to tox
      [Joshua Powers] (LP: #1652329)
    - code-style: make master pass pycodestyle (2.3.1) cleanly.

 -- Scott Moser <email address hidden> Thu, 09 Feb 2017 13:18:47 -0500

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Scott Moser (smoser)
Changed in cloud-init:
status: Confirmed → Fix Committed
Changed in nova-lxd (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Scott Moser (smoser)
Changed in cloud-init (Ubuntu Yakkety):
importance: Undecided → Medium
status: New → Confirmed
Changed in cloud-init (Ubuntu Xenial):
importance: Undecided → Medium
status: New → Confirmed
Changed in nova-lxd (Ubuntu Xenial):
importance: Undecided → High
status: New → Confirmed
Changed in nova-lxd (Ubuntu Yakkety):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Scott Moser (smoser) wrote :

I marked this as fix-released in zesty just by
 pull-lp-source nova-lxd zesty

that got me 15.0.0-0ubuntu1
 ./nova/virt/lxd/flavor.py
has commit b664cc294dc9f320c343ba6b9c4317c071e671bb which added 'product_name' with value 'OpenStack Nova' to the lxc container's pid 1 environment.

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

Marking fix-released in nova-lxd in zesty.

description: updated
Changed in nova-lxd (Ubuntu Zesty):
status: Confirmed → Fix Released
Changed in nova-lxd (Ubuntu Yakkety):
status: Confirmed → In Progress
Changed in nova-lxd (Ubuntu Xenial):
status: Confirmed → In Progress
Revision history for this message
Scott Moser (smoser) wrote :

I've marked this as 'In progress' for nova-lxd in ubuntu for xenial.
That is per comment from Chuck that this is included in the SRU that is in the queue (13.3.0-0ubuntu1).

 https://launchpad.net/ubuntu/xenial/+queue?queue_state=1&queue_text=nova-lxd

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

Chuck has just uploaded nova-lxd_14.2.0-0ubuntu0.16.10.1.dsc for yakkety to SRU queue.
This bug is fixed in that release.

Revision history for this message
James Page (james-page) wrote :

Marking nova-lxd task as Fix Released; changes landed and released, need to work through SRU process.

Changed in nova-lxd:
importance: Undecided → High
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

nova-lxd changes are now present in both yakkety-proposed (14.2.0-0ubuntu0.16.10.1) and xenial-proposed (13.3.0-0ubuntu1).

The fix for this bug requires those versions and a not-yet-done cloud-init SRU to xenial and yakkety to identify nova-lxd.

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.