-
Notifications
You must be signed in to change notification settings - Fork 91
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
ovirt_disk: Add convert action of the disk #601
base: master
Are you sure you want to change the base?
Conversation
@spameier could you please try this PR if it works for you? |
Hey, thanks for the very quick initiative! [SNIP] After installing |
Happy to hear that! (probably unrelated issues on my env) |
I indeed see a conversion job being created in oVirt, but the format does not change. The job title in oVirt is "Converting disk test to Preallocated/RAW" when trying to convert from raw to cow. Playbook: - hosts: localhost
gather_facts: no
connection: local
vars_files:
- vault.yml # Contains encrypted `engine_password`
- vars.yml
tasks:
- name: Login
ovirt_auth:
url: "{{ engine_url }}"
password: "{{ engine_password }}"
username: "{{ engine_user }}"
- ovirt_disk_info:
auth: "{{ ovirt_auth }}"
pattern: id=d7ca29bf-aa77-402b-9c8d-ae854b260ac2
register: result
- debug:
msg: "{{ result.ovirt_disks[0].format }}"
- ovirt_disk:
auth: "{{ ovirt_auth }}"
id: d7ca29bf-aa77-402b-9c8d-ae854b260ac2
format: cow
sparse: yes
- ovirt_disk_info:
auth: "{{ ovirt_auth }}"
pattern: id=d7ca29bf-aa77-402b-9c8d-ae854b260ac2
register: result
- debug:
msg: "{{ result.ovirt_disks[0].format }}"
collections:
- ovirt.ovirt Output:
|
Do you have some error in engine log? |
I see no real error i the GUI. Here's a gist with the logs while the playbook is running: https://gist.github.com/spameier/be77ed3c6c28081bea85376f05e88d48 |
I could recreate the behaviour with |
@@ -921,6 +921,12 @@ def main(): | |||
action_condition=lambda d: module.params['sparsify'], | |||
wait_condition=lambda d: d.status == otypes.DiskStatus.OK, | |||
) | |||
ret = disks_module.action( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to explicitly add the disk format here.
if module.params['format'] != None:
disk.format = otypes.DiskFormat.COW if module.params['format'] == 'cow' else otypes.DiskFormat.RAW
Also when converting from raw to cow you need to set disk.sparse
to True
. I am unsure whether you want the user to set this or implicitly change the value.
b25c455
to
536cae4
Compare
Fixes: #600