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

No space left on device with VHD target, only with Ansible module #291

Open
Procsiab opened this issue Sep 13, 2023 · 1 comment
Open

No space left on device with VHD target, only with Ansible module #291

Procsiab opened this issue Sep 13, 2023 · 1 comment
Labels
approved pm aprroved to work
Milestone

Comments

@Procsiab
Copy link

I am reporting this since I cannot reproduce it from composer-cli, and from the metadata produced by the compose it seems that the custom size I set for the image artefact is respected, however: every compose that I run with the infra.osbuild.start_compose module and VHD target fails at the step org.osbuild.copy with the following error:

cp: error writing '/run/osbuild[...]': No space left on device

If I run the same compose from the CLI, it succeeds (I use the same parameters declared as the module's arguments).

I am using the infra.osbuild collection version 2.2.0, on a Fedora 38 system with Python 3.9.16
I attach the metadata and log files for both the succeeding job run from CLI and the failing one run from Ansible, and also the blueprint file and the command/task I used to run the respective composes.

Successful CLI run

composer-cli compose start datalab_general vhd datalab_general template_static/az_storage_account.toml --size 5120

Failed Ansible run

hosts: localhost
tasks:
  - name: Start the compose job, with VHD target                                                       
    infra.osbuild.start_compose:                                                                       
      blueprint: "{{ blueprint_name }}"                                                                
      size: 5120                                                                                       
      profile: "{{ lookup('ansible.builtin.template', 'templates/' + storageprof_name + '.toml.j2') }}"
      image_name: "{{ blueprint_name }}_img"                                                           
      allow_duplicate: true  # not idempotent                                                          
      compose_type: 'vhd'                                                                              
      timeout: 150                                                                                     
    register: builder_compose_start_out 

infra_osbuild_issue.zip

@chadmf chadmf added the approved pm aprroved to work label Sep 20, 2023
@chadmf chadmf added this to the GA milestone Sep 20, 2023
@Procsiab
Copy link
Author

I think that this issue may be related to the fact that the size parameter is handled differently between the module_utils/weldrapiv1 implementation and the one found inside the weldr-client (composer-cli) project:

In the first case, the value is passed directly inside the HTTP request body, assuming it's in MB (https://github.com/redhat-cop/infra.osbuild/blob/958dcaba25c9b3ec402cbccce5d920b303e93525/plugins/module_utils/weldrapiv1.py#L294C18-L294C34)

In the second instance, the size is assumed to be in Bytes, therefore it is multiplied by 1024² before being sent inside the HTTP request to the Weldr API (https://github.com/osbuild/weldr-client/blob/cddc652a655a6cbc5144a417edf8c1c73bf49e98/weldr/compose.go#L160)

My assumption is supported by the fact that the following task can correctly queue and finish a build for a VHD (while I could not achieve this using the start_compose module):

    - name: Start the compose job, with VHD target
      ansible.builtin.uri:
        unix_socket: /run/weldr/api.socket
        url: http://localhost/api/v1/compose
        method: POST
        timeout: 150
        body_format: json
        body:
          blueprint_name: "{{ blueprint_name }}"
          compose_type: 'vhd'
          branch: 'master'
          size: 5368709120
      register: builder_compose_start_out

TL;DR

It must be assumed that the size for the start_compose module is in fact in Bytes (not in MiB, as stated here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved pm aprroved to work
Projects
None yet
Development

No branches or pull requests

2 participants