identify lxd-nova platform to enable Openstack datasource

Bug #1661797 reported by Scott Moser on 2017-02-04
50
This bug affects 6 people
Affects Status Importance Assigned to Milestone
cloud-init
High
Unassigned
nova-lxd
High
Unassigned
cloud-init (Ubuntu)
High
Unassigned
Xenial
Medium
Unassigned
Yakkety
Medium
Unassigned
Zesty
High
Unassigned
nova-lxd (Ubuntu)
Medium
Unassigned
Xenial
High
Unassigned
Yakkety
High
Unassigned
Zesty
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

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) on 2017-02-08
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
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.

Scott Moser (smoser) wrote :

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

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/

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) on 2017-02-09
description: updated
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) on 2017-02-09
Changed in cloud-init:
status: Confirmed → Fix Committed
Changed in nova-lxd (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Scott Moser (smoser) on 2017-02-15
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
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) on 2017-03-03
tags: added: dsid
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
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

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.

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
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.

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers