<block_device/> represents a block device. Every <block_device/> is a target of some <mapper/>.
Every block device has <content/>, which represent data stored on block device.
Block devices are manipulated in different ways:
Existing block devices are retrieved either by using “get_bd(path)” function or by extraction from <mapper/>.
New block devices are created by submitting <block_device_template/> from <new_targets/> of <mapper/> to Storage Module using “create_bd” function.
Properties are changed by modifying <properties/> tag, see bellow, and submitting <block_device/> to Storage Module using “modify_bd” function.
Content is manipulated by changing <content/> tag, see bellow, and submitting <block_device/> to Storage Module using “modify_bd” function. Both, content and block device properties, can be modified using single call to “modify_bd.”
Block devices are removed by submitting <block_device/> to Storage Module using “remove_bd” function. Operation will succeed only if bd's “removable” property is “true”.
Block Device XML description:
<block_device mapper_id="unique mapper id" mapper_type="mapper type" path="path" state_ind="fajanadaeacaoaiagaaaaacalajacaea">
<properties/> <content/>
</block_device>
Every <block_device/> is a target of <mapper/>
which is of type “mapper_type” and id “mapper_id”.
It
also has a “path” and “state_ind”. State indicator
“state_ind” is a hashed string of block device properties; if
something changes on a block device, its state indicator will change
as well. It is used to detect mid-air collisions.
<properties/> tag, which has
variables for children.
Some
properties can be mutable; modifying them and sending
<block_device/> to Storage Module will commit changes to the
disk.
Block devices from different “mapper_type”s have
different set of properties defined; some of them will be present in
all block devices, eg “removable”. See descriptions of
respective LINKME mappers.
Example of properties for Logical
Volume:
<properties>
<var mutable="false" name="attrs" type="string" value="-wi-ao"/> <var mutable="false" name="extent_size" type="int" value="33554432"/> <var mutable="false" name="lvname" type="string" value="root"/> <var mutable="false" name="mirrored" type="boolean" value="false"/> <var mutable="false" name="path" type="string" value="/dev/VG_main/root"/> <var mutable="false" name="removable" type="boolean" value="true"/> <var max="17179869184" min="16106127360" mutable="true" name="size" step="33554432" type="int" value="16106127360"/> <var mutable="false" name="snapshot" type="boolean" value="false"/> <var mutable="false" name="snapshots" type="list_str"/> <var mutable="false" name="uuid" type="string" value="lEI9Zt-LzZt-aMa2-glrC-zC69-M6J3-KaGSHt"/> <var mutable="false" name="vgname" type="string" value="VG_main"/>
</properties>
<content/> tag, which represent data stored on block device. <content/> also contains data about new contents.