William Schumann wrote: > Sundar, > I wanted to quickly respond to these points of yours: >>> -if partition already exists and is of indicated size, >>> log and return success instead of failing >>> >> Size doesn't matter. Only one Solaris partition is allowed. If there >> is an existing Solaris partition and the user wants to create another, >> we should return error. The user should delete the old one. We can >> process the delete request first before processing create request. > > and >>> -if slice already exists and is of indicated size, >>> log and return success instead of failing >>> >> Again, we want the action to be explicit. Delete the existing slice >> and create a new slice. This will reduce confusion. > The idea behind these is that it would allow a manifest to be reused > without modifying the original slice/partition specifications.
I think that's a fair point to consider. Having manifests apply as broadly as possible without damaging data is a tricky balance to find, but one we should actively strive for. Dave > William > > > Sundar Yamunachari wrote: >> William, >> >> William Schumann wrote: >>> Through the automated installer, fdisk partitions and VTOC slices can >>> be designed and managed on target disks. >>> >>> These features are not yet documented or specified. I am appending a >>> document that describes the current implementation. I am seeking >>> feedback on functionality, both current and proposed, ideas for >>> enhancements, and I would like for us to reach a consensus on how >>> this should work. >>> ------------------------------------------------------------------------------------------------------------------------------------------------ >>> >>> >>> Automated Installer fdisk partition and VTOC slice management options >>> >>> This is configured through an XML manifest that conforms to the Relax >>> NG schema file, ai_manifest.rng. >>> >>> fdisk partition operations (x86-only): >>> create: >>> Creates a partition at a sector address of a given length in >>> sectors >>> >>> <element name="partition_number"> - required by >>> parser, but otherwise ignored >>> <element name="partition_start_sector"> >>> <element name="partition_size"> - length in sectors >>> <element name="partition_type"> - required by >>> parser, but otherwise ignored >>> creates Solaris2 only >>> >>> Current behavior details: >>> -If partition size is zero, space to end of disk is >>> allocated >>> -when overlapping partitions are defined, fdisk detects >>> this and fails >>> -coded, not in repo: added element for specifying >>> partition size units >>> >>> Changes to consider: >>> -make partition type optional with a default of Solaris2 >>> >> Since we support only creating Solaris2, it could be optional during >> create and deleting an existing partition requires partition type. >> Once we start support creating other partition type, we could revisit >> this area. >>> -require Solaris2 only or support creation of other >>> partition types >>> >> Installer should create only Solaris partitions. We should have a >> separate tool to create partitions of other type. >>> -if partition_size is not specified, >>> create partition, to end of disk or start of next >>> partition >>> >> This will be confusing. we should use a keyword to indicate that the >> user wants to create a max size partition that uses remaining space. >> We should not make size as optional for create. >>> -if partition already exists and is of indicated size, >>> log and return success instead of failing >>> >> Size doesn't matter. Only one Solaris partition is allowed. If there >> is an existing Solaris partition and the user wants to create another, >> we should return error. The user should delete the old one. We can >> process the delete request first before processing create request. >>> delete: >>> Deletes a partition of specified length at specified sector >>> >>> <element name="partition_number"> - required by >>> parser, but otherwise ignored >>> <element name="partition_start_sector"> >>> <element name="partition_size"> - length in sectors >>> <element name="partition_type"> - required by >>> parser, but otherwise ignored >>> >>> Current behavior details: >>> exact match required on start sector and size >>> >>> Changes to consider: >>> -either eliminate partition number element or implement >>> 'delete by partition number' >>> >> We want this because fdisk tool doesn't provide starting sector (it >> displays cylinders). We could make this parameter optional. >>> -add feature to create partition of a given size in the >>> unoccupied block that fits best >>> -in the same way it is currently done for slices (below) >>> -user would not have to specify starting sector >>> -this would be the behavior if a starting sector was >>> not specified >>> >> That is a good idea. The user just provide size and partition type and >> the install code figures out where to create the partition. >>> VTOC slice operations (x86 or SPARC): >>> create: >>> Create a VTOC slice given number and size >>> >>> <element name="slice_number"> >>> <element name="slice_size"> - length in sectors >>> >>> Current behavior details: >>> -uses best fit policy for choosing location of slice >>> -if slice_size is zero, creates slice using largest free >>> region >>> -installation always in slice 0 >>> -swap/dump slice may be created using slice 1, >>> unless user creates or preserves slice 1, >>> -if slice already exists, failure >>> Changes to consider: >>> -add slice size units, defaulting to MB >>> >> Sounds good. May be we can support MB, and GB along with sectors >>> -if slice_size element is missing, >>> create slice, using largest available unallocated space >>> >> We should have a special value to denote the largest available size >> like 'max_size' (similar to the comment made in the partition above) >>> -if slice already exists and is of indicated size, >>> log and return success instead of failing >>> >> Again, we want the action to be explicit. Delete the existing slice >> and create a new slice. This will reduce confusion. >>> delete: >>> Delete listed slices by number >>> >>> <element name="slice_number"> >>> <element name="slice_size"> - required by parser, but >>> otherwise ignored >>> >>> >> We can make slice size as optional since multiple actions >> create/delete/preserve share the schema >>> Current behavior details: >>> if slice does not exist, failure >>> preserve: >>> Preserve listed slices, implicitly deleting any slices not >>> named in manifest >>> >>> <element name="slice_number"> >>> <element name="slice_size"> - required by parser, but >>> otherwise ignored >>> >>> Current behavior details: >>> if slice does not exist, failure >>> >> It is okay for now but I think that this is a warning and we don't >> need to fail. >>> Disk target contents >>> Selection criteria: >>> <element name="target_device_use_solaris_partition"> - >>> boolean: "true"or "false" >>> If "true", signals AI to select a disk that already has a >>> Solaris2 partition >>> Other selection criteria: >>> <element name="target_device_name"> >>> <!-- device name like c0t0d0 or MPXIO name like >>> c0t2000002037CD9F72d0 --> >>> <element name="target_device_type"> >>> <element name="target_device_vendor"> >>> <element name="target_device_size"> >>> Changes to consider: >>> add "target_device_devid_contains" - user specifies a >>> substring of the devid >>> >> Can you provide an example for this change? >>> Other disk target contents: >>> <element name="target_device_overwrite_root_zfs_pool"> >>> Cannot find where this is currently implemented >>> >> Take a look at the bug 1771 and 3783. >>> Overall changes to consider: >>> ? >>> >> Currently we install only on slice 0. We could add an install action >> and get the slice where OpenSolaris can be installed. >> >> Thanks, >> Sundar >>> Notes: >>> any failures mentioned here result in install failure >>> 1 sector = 512 bytes >>> >>> The remainder of this message is code segments for reference. >>> >>> Excerpts from auto_install.h: >>> typedef struct { >>> char diskname[MAXNAMELEN]; >>> char disktype[MAXNAMELEN]; >>> char diskvendor[MAXNAMELEN]; >>> uint64_t disksize; >>> char diskusepart[6]; /* 'true' or 'false' */ >>> char diskoverwrite_rpool[6]; /* 'true' or 'false' */ >>> } auto_disk_info; >>> >>> typedef struct { >>> char partition_action[MAXNAMELEN]; >>> int partition_number; >>> uint64_t partition_start_sector; >>> uint64_t partition_size; >>> int partition_type; >>> } auto_partition_info; >>> >>> typedef struct { >>> char slice_action[MAXNAMELEN]; >>> int slice_number; >>> uint64_t slice_size; >>> } auto_slice_info; >>> >>> Excerpts from Relax NG schema ai_manifest.rng: >>> <!-- >>> ======================================================================= >>> Selections for AI target Device specification >>> ======================================================================= >>> --> >>> <define name="ai_target_device_contents"> >>> <interleave> >>> <optional> >>> <!-- device name like c0t0d0 or >>> MPXIO name like c0t2000002037CD9F72d0 --> >>> <element name="target_device_name"> >>> <text/> >>> </element> >>> </optional> >>> <optional> >>> <element name="target_device_type"> >>> <text/> >>> </element> >>> </optional> >>> <optional> >>> <element name="target_device_vendor"> >>> <text/> >>> </element> >>> </optional> >>> <optional> >>> <element name="target_device_size"> >>> <text/> >>> </element> >>> </optional> >>> <optional> >>> <element name="target_device_use_solaris_partition"> >>> <data type="boolean"/> >>> </element> >>> </optional> >>> <optional> >>> <element name="target_device_overwrite_root_zfs_pool"> >>> <data type="boolean"/> >>> </element> >>> </optional> >>> </interleave> >>> </define> >>> >>> <!-- >>> ======================================================================= >>> Selections for AI target device partitions specification >>> ======================================================================= >>> --> >>> <define name="ai_device_partitioning_contents"> >>> <interleave> >>> <element name="partition_action"> >>> <choice> >>> <value>create</value> >>> <value>delete</value> >>> </choice> >>> </element> >>> <element name="partition_number"> >>> <data type="unsignedByte"/> >>> </element> >>> <element name="partition_start_sector"> >>> <data type="unsignedLong"/> >>> </element> >>> <element name="partition_size"> >>> <data type="unsignedLong"/> >>> </element> >>> <element name="partition_type"> >>> <data type="unsignedByte"/> >>> </element> >>> </interleave> >>> </define> >>> >>> <!-- >>> ======================================================================= >>> Selections for AI target device vtoc slices specification >>> ======================================================================= >>> --> >>> <define name="ai_device_vtoc_slices_contents"> >>> <interleave> >>> <element name="slice_action"> >>> <choice> >>> <value>create</value> >>> <value>delete</value> >>> <value>preserve</value> >>> </choice> >>> </element> >>> <element name="slice_number"> >>> <data type="unsignedByte"/> >>> </element> >>> <element name="slice_size"> >>> <data type="unsignedLong"/> >>> </element> >>> </interleave> >>> </define> >>> >>> _______________________________________________ >>> caiman-discuss mailing list >>> caiman-discuss at opensolaris.org >>> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss >>> > _______________________________________________ > caiman-discuss mailing list > caiman-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/caiman-discuss