On 11/01/2011 11:16, Darren Kenny wrote:
> On 07/01/2011 23:37, [email protected] wrote:
>> The current target schema allows for vdev specification
>> as follows:
>>
>> <target_device>
>> <zpool name="mypool" is_root=true action="create">
>> <vdev redundancy="mirror">
>> <disk>
>> <disk_name name="c0t0d0" name_type="ctd"/>
>> ...
>> </disk>
>> <disk>
>> <disk_name name="c0t0d1" name_type="ctd"/>
>> ...
>> </disk>
>> <partition action="create" name="1" part_type="191">
>> <size val="5000mb"
>> </partition>
>> <partition action="create" name="2">
>> <size val="5000mb"
>> </partition>
>> <partition action="create" name="3">
>> <size val="5000mb"
>> </partition>
>> </vdev>
>> </zpool>
>> </target_device>
>> </target>
>>
>> That is, when creating a 2 disk mirror and 3 partitions, how
>> does one know which disk these partitions should be created on?
>> There is no way of knowing as it currently stands.
>>
>> It just seems that instead of having disk/partition/slice elements
>> embedded within vdev, it might be cleaner to simply have references
>> in the vdev element to a disk/partition/slice name. Thus, doing away
>> with needing to embed these elements within a vdev.
>>
>> It would look something like this:
>>
>> <target>
>> <target_device>
>> <zpool name="mypool" is_root=true action="create">
>> <vdev redundancy="mirror">
>> disk ="c0t0d0"
>> disk ="c0t0d1"
>> </vdev>
>> </zpool>
>> <disk>
>> <disk_name name="c0t0d0" name_type="ctd">
>> <partition action="create" name="1" part_type="191">
>> <size val="5000mb"
>> </partition>
>> <partition action="create" name="2">
>> <size val="5000mb"
>> </partition>
>> <partition action="create" name="3">
>> <size val="5000mb"
>> </partition>
>> <disk>
>> <disk_name name="c0t0d1" name_type="ctd"/>
>> ...
>> </disk>
>> </target_device>
>> </target>
>>
>> In the case a vdev is on a partition or a slice, the vdev
>> specification would change to something like this (totally
>> unrealistic but you get the idea):
>>
>> <vdev redundancy="mirror">
>> disk ="c0t0d0" slice = "0"
>> disk ="c0t0d1" part = "3"
>> </vdev>
>>
>> This would specify a mirror made from c0t0d0s0 and c0t0d1p3.
>>
>> Alok, Drew and I would like to nail this down by Jan 14th.
>
> Hi Jean/Alok/Drew,
>
> While I totally understand the purpose of this, I really would prefer if thing
> made better use of XML here rather than free-text, specifically w.r.t. the
> text:
>
> disk ="c0t0d0" slice = "0"
> disk ="c0t0d1" part = "3"
>
> I think you should use a specific child-tag of <vdev> here to allow for some
> enforcement of the specification in the XML, and also to perform some basic
> syntax checking automatically.
>
> As such, maybe it's worth having a <dev> tag like:
>
> <vdev redundancy="mirror">
> <dev disk ="c0t0d0" slice = "0"/>
> <dev disk ="c0t0d1" part = "3"/>
> </vdev>
>
> Maybe since this is in essence a reference to a device that needs to be
> specified else where (using <disk>, etc) then maybe it should be called
> <dev_ref> or <vdev_ref> - so that it's obvious that it's a reference.
>
> I just think that if we're using XML we shouldn't be allowing free-text unless
> there is absolutely no other option to handle things that way - and in this
> case
> I thing XML is a good way to specify things.
Just to add to this, I don't think we can limit things to the use of the ctd
naming - mainly since we allow disk selection to be done without knowing this.
For example, you could decide to select based on the bootdisk, and define some
partitions and slices on it. In this case you don't know the ctd of the disk,
but you do know the slices indexes:
<!-- Define Physical Disk layout -->
<target_device>
<disk>
<disk_keyword key="boot_disk"/>
<slice name="0"></slice>
<slice name="1"></slice>
</disk>
</target_device>
<!-- Define Logicial devices -->
<target_device>
<zpool name="rpool" is_root=true>
<vdev>
<dev_ref slice="0"/>
</vdev>
<zpool>
</target_device>
<target_device>
<zpool name="space" is_root=false>
<vdev>
<dev_ref slice="1"/>
</vdev>
<zpool>
<target_device>
If you do this, specifying a slice, with out the disk name, would fall back to
the selected disk.
Because of this, I feel there is a need to be able to concretely identify a disk
that a slice is on, and I feel this could be done using an attribute such as
'id' which uniquely identifies the disk, regardless of the selection criteria
for the disk, e.g.
<!-- Define Physical Disk layout -->
<target_device>
<disk id="my_disk"> <!-- Can be anything for id as long as it's unique -->
<disk_keyword key="boot_disk"/>
<slice name="0"></slice>
<slice name="1"></slice>
</disk>
</target_device>
<!-- Define Logicial devices -->
<target_device>
<zpool name="rpool" is_root=true>
<vdev>
<dev_ref id="my_disk" slice="0"/>
</vdev>
<zpool>
</target_device>
<target_device>
<zpool name="space" is_root=false>
<vdev>
<dev_ref id="my_disk" slice="1"/>
</vdev>
<zpool>
<target_device>
Just a suggestion ;)
Thanks,
Darren.
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss