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

lxd_container: requested image not found by fingerprint #8161

Open
1 task done
Herschdorfer opened this issue Mar 28, 2024 · 2 comments
Open
1 task done

lxd_container: requested image not found by fingerprint #8161

Herschdorfer opened this issue Mar 28, 2024 · 2 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@Herschdorfer
Copy link
Contributor

Summary

I'm currently trying to create a LXD container via Ansible on a virtual machine.
The Machine is running Ubuntu 22.04.

I copied the example from https://docs.ansible.com/ansible/latest/collections/community/general/lxd_container_module.html

# An example for creating container in project other than default
- hosts: localhost
  connection: local
  tasks:
    - name: Create a started container in project mytestproject
      community.general.lxd_container:
        name: mycontainer
        ignore_volatile_options: true
        state: started
        source:
          protocol: simplestreams
          type: image
          mode: pull
          server: https://images.linuxcontainers.org
          alias: ubuntu/20.04/cloud
        profiles: ["default"]
        wait_for_ipv4_addresses: true
        timeout: 600

Now im getting the error:

TASK [Create a started container in project mytestproject] ********************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"actions": [], "changed": false, "msg": "Failed getting remote image info: Failed getting image: The requested image couldn't be found for fingerprint \"ubuntu/20.04/cloud\""}

when i run the example with the fingerprint, all seems to be ok

- hosts: localhost
  connection: local
  tasks:
    - name: Create a started container
      community.general.lxd_container:
        name: mycontainer
        ignore_volatile_options: true
        state: started
        source:
          type: image
          mode: pull
          # Provides current (and older) Ubuntu images with listed fingerprints
          server: https://cloud-images.ubuntu.com/releases
          # Protocol used by 'ubuntu' remote (as shown by 'lxc remote list')
          protocol: simplestreams
          # This provides an Ubuntu 14.04 LTS amd64 image from 20150814.
          fingerprint: e9a8bdfab6dc
        profiles: ["default"]
        wait_for_ipv4_addresses: true
        timeout: 600
PLAY RECAP ********************************************************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Issue Type

Bug Report

Component Name

lxd_container

Ansible Version

ansible 2.10.8
  config file = None
  configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

Community.general Version

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 1.3.6  

# /home/xxx/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 8.5.0  

Configuration

OS / Environment

Ubuntu 22.04 LTS

Steps to Reproduce

- hosts: localhost
  connection: local
  tasks:
    - name: Create a started container
      community.general.lxd_container:
        name: mycontainer
        ignore_volatile_options: true
        state: started
        source:
          type: image
          mode: pull
          # Provides current (and older) Ubuntu images with listed fingerprints
          server: https://cloud-images.ubuntu.com/releases
          # Protocol used by 'ubuntu' remote (as shown by 'lxc remote list')
          protocol: simplestreams
          # This provides an Ubuntu 14.04 LTS amd64 image from 20150814.
          fingerprint: e9a8bdfab6dc
        profiles: ["default"]
        wait_for_ipv4_addresses: true
        timeout: 600

Expected Results

Container gets created

Actual Results

TASK [Create a started container in project mytestproject] ********************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"actions": [], "changed": false, "msg": "Failed getting remote image info: Failed getting image: The requested image couldn't be found for fingerprint \"ubuntu/20.04/cloud\""}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Mar 28, 2024
@felixfontein felixfontein changed the title requested image not found by fingerprint lxd_container: requested image not found by fingerprint Mar 29, 2024
@Herschdorfer
Copy link
Contributor Author

meanwhile i was able to create a container after reading the API specification at: https://documentation.ubuntu.com/lxd/en/latest/howto/instances_create/

I changes the yaml to:

---
- hosts: localhost
  connection: local
  tasks:
    - name: Create a started container in project mytestproject
      community.general.lxd_container:
        name: mycontainer
        ignore_volatile_options: true
        state: started
        source:
          protocol: simplestreams
          type: image
          server: https://cloud-images.ubuntu.com/releases
          alias: "22.04"
        profiles: ["default"]
        wait_for_ipv4_addresses: true
        timeout: 600

I had to change the alias to the version eg. "20.04" and changed the server to https://cloud-images.ubuntu.com/releases.

https://discuss.linuxcontainers.org/t/important-notice-for-lxd-users-image-server/18479 mentions that there will be no access anymore for lxd 5.20+ from 15th of March onwards.

Maybe the docs need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants