-
Notifications
You must be signed in to change notification settings - Fork 72
Fix lvm #62
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
base: master
Are you sure you want to change the base?
Fix lvm #62
Conversation
So uptdate the when condition to avoid skiping tasks
…netinstall as CDROM
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.
Thanks for proposing this. Currently this role does not support the block type (see libvirt_volume_default_type in README). I haven't used LVM with this role, but I believe that people have been using libvirt volume pools backed by LVM (which is supported by the libvirt-host role). In that case, you could use type=volume for the device.
If that does not fit your use case, you could add support for the block type, but let's make sure it's not limited to LVM devices. Here you are using the pool
attribute of devices which really refers to libvirt volume pools rather than an LVM volume group.
Hi, I have tested (again) with these variables :
The role is crashing with this error (it's was in verbose mode)
On the destination server, the lv is created :
And the pool is correctly reconize by virsh
|
That's a shame. I had a quick search for issues but I don't really have time to investigate. If you want to add support for block devices, we can do that as a workaround. For type=block, I think we should specify a path to a device, rather than specifying a pool. In this case, we would set |
@@ -27,7 +27,7 @@ | |||
{% endif %} | |||
-a {{ ansible_check_mode }} | |||
with_items: "{{ volumes }}" | |||
when: item.type | default(libvirt_volume_default_type) == 'volume' | |||
when: item.type | default(libvirt_volume_default_type) == 'volume' or ( item.type | default(libvirt_volume_default_type) == 'block' and item.pool is defined ) |
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.
I don't think this makes sense for a block device.
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.
Hi,
It's a workaround (only for block device in LVM) otherwise the tasks is skipped so the volume is not created.
as the variable need to be like this :
volumes:
- name: 'ns2'
type: 'block'
capacity: '10GB'
pool: 'lvm_pool'
format: 'raw'
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.
I see, but I don't think it makes sense in the general case. Typically a block device would not be associated with a volume, AFAIU.
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.
In general case, volume.pool will not exist so it's will skip, so same behaviour than before
Fix #61