Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identify lxd-nova platform to enable Openstack datasource #2799

Closed
ubuntu-server-builder opened this issue May 10, 2023 · 13 comments
Closed
Labels
launchpad Migrated from Launchpad priority Fix soon

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1661797

Launchpad details
affected_projects = ['nova-lxd', 'cloud-init (Ubuntu)', 'nova-lxd (Ubuntu)', 'cloud-init (Ubuntu Xenial)', 'nova-lxd (Ubuntu Xenial)', 'cloud-init (Ubuntu Yakkety)', 'nova-lxd (Ubuntu Yakkety)', 'cloud-init (Ubuntu Zesty)', 'nova-lxd (Ubuntu Zesty)']
assignee = None
assignee_name = None
date_closed = 2017-09-23T02:15:08.337502+00:00
date_created = 2017-02-04T03:03:53.386819+00:00
date_fix_committed = 2017-02-09T20:37:34.888295+00:00
date_fix_released = 2017-09-23T02:15:08.337502+00:00
id = 1661797
importance = high
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1661797
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = smoser
submitter_name = Scott Moser
tags = ['dsid']
duplicates = [1674099, 1676828, 1687425]

Launchpad user Scott Moser(smoser) wrote on 2017-02-04T03:03:53.386819+00:00

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

@ubuntu-server-builder ubuntu-server-builder added launchpad Migrated from Launchpad priority Fix soon labels May 10, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ryan Harper(raharper) wrote on 2017-02-06T15:34:22.882073+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Tycho Andersen(tycho-s) wrote on 2017-02-08T15:30:50.764405+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-02-09T02:43:20.678409+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Paul Hummer(rockstar) wrote on 2017-02-09T07:52:38.199557+00:00

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/

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user OpenStack Infra(hudson-openstack) wrote on 2017-02-09T15:14:14.130782+00:00

Change abandoned by Paul Hummer (paul@eventuallyanyway.com) on branch: master
Review: https://review.openstack.org/431247
Reason: The actual change occurred in another patch.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Launchpad Janitor(janitor) wrote on 2017-02-09T20:31:24.242438+00:00

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 smoser@ubuntu.com Thu, 09 Feb 2017 13:18:47 -0500

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-02-28T17:24:52.927885+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-03-03T14:41:48.131010+00:00

Marking fix-released in nova-lxd in zesty.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-03-03T14:46:56.530291+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-03-03T15:03:10.470310+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Page(james-page) wrote on 2017-03-16T10:28:16.247303+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-03-22T13:03:49.129804+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:15:12.764721+00:00

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad priority Fix soon
Projects
None yet
Development

No branches or pull requests

1 participant