How to pull and launch debian/9 cloud variant

Hi everyone! I see on https://us.images.linuxcontainers.org that debian:9 Variant cloud is exists. How can I launch it? If I do

lxc launch debian:9 mycontainer

Container created but without cloud-init inside. My custom “default” profile contains cloud-init instructions, but it nod work of course without cloud-init inside image.

Hello

from this post it’s said that the goal is to 'adding cloud-init functionality to all distro images that can support it ', as such all distro are building a cloud variant but if cloud-init is not supported a ‘cloud’ labelled image is built but is identical to the default one. It’s confusing but it’s like that.
See this file, you’ll notice that a ‘variant’ is included in the jenkins axes but the build instruction don’t use the variant variable (see for example fedora version where the build instruction does use the variant variable at line 55)
Perhaps the problem comes from Debian 8 that does not inits correctly at the moment (systemd-networkd goes into an infinite loop), so of course cloud-init would not work.
Anyway, you could use distrobuilder yourself to try to build a debian 9 image, if there is no basic problem in Debian 9 you would get a cloud-init enabled image. In your place I’d try first to install cloud-init manually in a debian 9 container to see if it works.

stgraber@castiana:~$ lxc image info images:debian/9/cloud
Fingerprint: f586c49d545f4582ab0aff40a0a02f98d5912ba7c69d235108427cac54f9f16c
Size: 83.08MB
Architecture: x86_64
Public: yes
Timestamps:
    Created: 2019/08/17 00:00 UTC
    Uploaded: 2019/08/17 00:00 UTC
    Expires: never
    Last used: never
Properties:
    serial: 20190817_05:24
    description: Debian stretch amd64 (20190817_05:24)
    os: Debian
    release: stretch
    architecture: amd64
Aliases:
    - debian/stretch/cloud
    - debian/stretch/cloud/amd64
    - debian/9/cloud
    - debian/9/cloud/amd64
Cached: no
Auto update: disabled

Thanks for response! It help had me understand the reasons of problem.

Yes, I tried it, but is just default image inside, without cloud-init. Now I understand that I need build custom image.

root@hv01 ~ # lxc launch images:debian/9/cloud c1
Creating c1
Starting c1
root@hv01 ~ # lxc exec c1 bash
root@c1:~# ls /etc/cloud*
ls: cannot access '/etc/cloud*': No such file or directory
root@c1:~#

Hmm, debian/9/cloud is definitely meant to have cloud-init installed.
Is it just the configuration that’s missing or the entirety of cloud-init too?

dpkg -l | grep cloud in the container may help with that.

@monstermunchkin

root@hv01 ~ # lxc launch images:debian/9/cloud c2
Creating c2
Starting c2
root@hv01 ~ # lxc exec c2 bash
root@c2:~# dpkg -l | grep cloud
root@c2:~#
root@c2:~# apt-cache policy  cloud-init
cloud-init:
  Installed: (none)
  Candidate: 0.7.9-2
  Version table:
     0.7.9-2 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
root@hv01 ~ # lxc image info images:debian/9/cloud
Fingerprint: 9a8a078472961f42c4f624c7a38b2c0ab0d6b7768c4611d4641b82ceec8c681e
Size: 83.07MB
Architecture: x86_64
Public: yes
Timestamps:
    Created: 2019/08/19 00:00 UTC
    Uploaded: 2019/08/19 00:00 UTC
    Expires: never
    Last used: never
Properties:
    description: Debian stretch amd64 (20190819_05:24)
    os: Debian
    release: stretch
    architecture: amd64
    serial: 20190819_05:24
Aliases:
    - debian/stretch/cloud
    - debian/stretch/cloud/amd64
    - debian/9/cloud
    - debian/9/cloud/amd64
Cached: no
Auto update: disabled

I can confirm that debian/stretch/cloud is missing cloud-init but I don’t understand why. Building it locally with distrobuilder and our debian.yaml creates a proper cloud image.

Edit: my mistake. Our CI config is missing an option.

Now that you have added the variant, maybe you should remove jessie from build since network service is failing to start completely (can be seen with lxc console), so I doubt cloud-init will work.