confusing example from 'lxc help image'

Bug #1530413 reported by James Troup
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
Fix Released
Low
Stéphane Graber

Bug Description

'lxc help image' with lxd installed from Ubuntu 15.10 includes this
text:

| Create, delete, list image aliases. Example:
| lxc remote add store2 images.linuxcontainers.org
| lxc image alias list store2:

But if I try it, I get this:

| james@ornery:~$ lxc remote add store2 images.linuxcontainers.org
| james@ornery:~$ lxc image alias list store2:
| error: not found
| james@ornery:~$

Am I meant to get this error? What is an alias? Why 'store2' rather
than just 'store'?

Revision history for this message
Stéphane Graber (stgraber) wrote :

Thanks for reporting this.

images.linuxcontainers.org is a fake LXD server implemented through static files and rewrite rules, it doesn't implement the API that "alias list" uses. I'll add the missing file to images.linuxcontainers.org which should take care of the error you've received.

And yes, I agree that the help here could do with some improvement, at the very least point to other help messages to better understand some of the concepts.

Briefly:
 - The LXD text client (lxc) can interact with multiple servers, those are called "remotes" and can be added/changed/removed through "lxc remote ..."
 - LXD is image based, all containers must be created from an image. The unique identifier used by LXD for images is the sha256 of their compressed tarball representation. As humans don't usually enjoy typing a full sha256 to tell LXD what they want, LXD has the concept of image aliases which is a human-friendly name that you can add to a particular image.

So the two commands you typed did:
 - lxc remote add store2 images.linuxcontainers.org
   Added a new remote called "store2" pointing to the public image server (fake LXD) at images.linuxcontainers.org
 - lxc image alias list store2:
   Attempted to list all image aliases set on the "store2" remote.

Changed in lxd (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Stéphane Graber (stgraber) wrote :

The image server has now been fixed to implement the GET /1.0/images/aliases interface, so the command won't be failing anymore.

Revision history for this message
Robert Hönig (indielives010) wrote :

Bug fix confirmed under xenial, no fail.

Changed in lxd (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote :

If I had intended for this issue to be marked fix released, I'd have done so when I commented earlier.

The server side bug may be fixed, the help message however is still arguably confusing.

Changed in lxd (Ubuntu):
status: Fix Released → Triaged
Changed in lxd (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Stéphane Graber (stgraber) wrote :

I reworked the help quite a bit to help with this, patch is pending upstream review.

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

This bug was fixed in the package lxd - 0.27-0ubuntu1

---------------
lxd (0.27-0ubuntu1) xenial; urgency=medium

  * New upstream release (0.27)
    - Support for container disk quota (zfs and btrfs only)
    - Download progress during image copy and container launch (LP: #1530414)
    - Initial work on a LXC to LXD script (supports almost every
      configuration except for unprivileged containers)
    - New linux.kernel_modules container property (list of modules to
      load before starting the container)
    - New core.https_allowed_origin server property (controls the
      Access-Control-Allow-Origin header)
    - Profile changes are now live-applied to all affected containers
    - "lxc config edit" now works against servers too
    - Changes to security.nesting are now live-applied
    - Support for xfs with the lvm backend
    - "lxc image list" now supports filtering (by name, hash and properties)
    - Improved bash completion profile
    - The default remote is now visible in "lxc remote list"
    - "lxc info" now indicates whether a container is ephemeral or persistent
    - Various improvement to help messages
      (LP: #1531643, LP: #1530413, LP: #1531357)
    - A lot of bugfixes and other performance improvement, see:
      https://linuxcontainers.org/lxd/news/

 -- Stéphane Graber <email address hidden> Wed, 20 Jan 2016 09:53:05 -0500

Changed in lxd (Ubuntu):
status: Triaged → Fix Released
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.