Hello!
I’m just starting my adventure with opennebula (5.2.0).
I would like to add raw data to definition of block device. Now I’ve got such xml (used by libvirt):
< disk type=‘file’ device=‘disk’ >
< source file=’/var/lib/one//datastores/101/22/disk.0’/>
< target dev=‘vda’/>
< driver name=‘qemu’ type=‘qcow2’ cache=‘none’ io=‘native’ discard=‘unmap’/>
< /disk>
And I’d like to add:
< blockio logical_block_size=‘4096’ physical_block_size=‘4096’/>
There is RAW = [ …] but content of this is added to the < devices> level not to < disk>
I bet on the second one too. I’ve played with such tweaks so it was not hard to scratch simple helper script. It needs lxml python module. if there is no distribution package for your OS you should use pip to install it (pip install lxml).
The usage should be straight forward - just drop the script in /var/lib/one/remotes/vmm/kvm/, make it executable and alter the deploy script adding few lines between cat > $domain and data= like:
<...>
cat > $domain
# first take a backup ...
cp $domain ${domain}.orig
# alter the domain XML
$(dirname $0)/vmTweakDiskBlockioBlockSize.py $domain
data=`virsh --connect $LIBVIRT_URI create $domain`
<...>
Then propagate the change to the hypervisors:
su - oneadmin -c "onehost sync --force"
I hope this helps. Feel free to alter the script in any shape if needed.