Skip to content

Looks like qemu-img version 6.1.0 needs "-F" parameter #200

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

Closed
goetzrieger opened this issue Jan 4, 2022 · 4 comments
Closed

Looks like qemu-img version 6.1.0 needs "-F" parameter #200

goetzrieger opened this issue Jan 4, 2022 · 4 comments
Assignees

Comments

@goetzrieger
Copy link

Couldn't deploy on a CentOS 8 Stream Hetzner server with latest updates because creating the images with qemu failed.

Looks like at least in qemu-img 6.1.0 the "-F" for target format is needed. I didn't hand in a PR because I don't know if this would break older qemu-img versions...

So in ansible/roles/openshift-4-cluster/tasks/create-vm.yml I changed

- name: Create disk for {{ vm_instance_name }}
  command: "qemu-img create -f qcow2 -b {{ coreos_image_location }} /var/lib/libvirt/images/{{ vm_instance_name }}.qcow2 {{ vm_root_disk_size }}"
  args:
    creates: "/var/lib/libvirt/images/{{ vm_instance_name }}.qcow2"
  when: vm_storage_backend == "qcow2"

to

- name: Create disk for {{ vm_instance_name }}
  command: "qemu-img create -f qcow2 -F qcow2 -b {{ coreos_image_location }} /var/lib/libvirt/images/{{ vm_instance_name }}.qcow2 {{ vm_root_disk_size }}"
  args:
    creates: "/var/lib/libvirt/images/{{ vm_instance_name }}.qcow2"
  when: vm_storage_backend == "qcow2"

And all is well... ;)

@rbo rbo self-assigned this Jan 10, 2022
@rbo
Copy link
Contributor

rbo commented Jan 10, 2022

Thanks for the Issue @goetzrieger

$ qemu-img --version
qemu-img version 4.2.0 (qemu-kvm-4.2.0-48.module+el8.4.0+11909+3300d70f.3)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
$ qemu-img create --help | grep create
  create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]

My version si quite old... (rhel8.4)

@goetzrieger: What is the output of qemu-img create --help ?

@rbo
Copy link
Contributor

rbo commented Jan 10, 2022

ah at my fedora workstation:

$ qemu-img --version
qemu-img version 6.1.0 (qemu-6.1.0-10.fc35)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
$ qemu-img create --help  |grep create
  create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]
       contain only zeros for qemu-img to create a sparse image during
  '-n' skips the target volume creation (useful if the volume is created
  'snapshot' is the name of the snapshot to create, apply or delete
  '-c' creates a snapshot
$

It looks like overall -F is the right option. I will fix this. Thanks.

rbo added a commit that referenced this issue Jan 11, 2022
rbo added a commit that referenced this issue Jan 11, 2022
@rbo
Copy link
Contributor

rbo commented Jan 11, 2022

Fixed in Devel tree

@rbo
Copy link
Contributor

rbo commented Feb 16, 2022

Merged into master.

@rbo rbo closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants