man pages section 1M: System Administration Commands

Exit Print View

Updated: July 2014
 
 

js2ai(1M)

Name

js2ai - Translate JumpStart rules and profiles for use with the Automated Installer (AI).

Synopsis

js2ai [-h | --version]
js2ai -r | -p profile [-d jsdir
]
    [-D destdir] [-lSv]
js2ai -s [-d jsdir]
    [-D destdir] [-Sv]
js2ai -V manifest

Description

js2ai is a utility for converting Oracle Solaris 10 JumpStart rules, profile, and syscfg configuration files to a format compatible with Automated Installer (AI). This utility makes a “best effort” to translate those JumpStart keywords that can be translated to the AI context. While this conversion does not create a complete one-to-one equivalence with JumpStart, it does provide AI manifest and system configuration profile entries that can then be used as a template for creating a complete AI configuration setup based on information gathered from JumpStart configuration files.

    Using js2ai, you can do the following:

  • Process the rules file and the associated profiles in the current working directory.

  • Process the rules file and the associated profiles in a specified directory.

  • Process a specific profile or sysidcfg file.

  • Direct the resulting output files to a specific directory. For more information on the js2ai output files, see the “Examples” and “Files” sections.

Translating Rule Keywords

Table 339-1  JumpStart Rule Keywords Translation
JumpStart Rule Keyword
AI Criteria Keyword
arch
cpu
hostaddress
ipv4
karch
arch
memsize
mem
model
platform
network
ipv4

JumpStart rule keywords not supported by js2ai:

any             installed
disksize        osname
domainname      probe
hostname        totaldisk

Converting Profile Keywords

Table 339-2  JumpStart Profile Keywords
JumpStart Profile Keyword
Notes
boot_device
The rootdisk is set to the specified device if not previously set by the root_device keyword.
fdisk
The value of disk_name must be a device. A device of all is not supported. The fdisk type must be solaris. A size of 0 or delete is not supported.
If partitioning is default and the rootdisk has not been set, the first fdisk solaris partition encountered is used as the rootdisk.
filesys
The local and mirrored file systems are supported when the mount point specified is / or swap.
No validation of the size is performed. The size specified in the resulting AI manifest might need to be adjusted to achieve a successful installation with this manifest.
install_type
Only the value initial_install is supported.
locale
No translation is performed. Make sure the locale specified is supported in Oracle Solaris 11.
package
An attempt to convert the specified package to its Oracle Solaris 11 equivalent is performed. Specifying the location of the package is not supported. Package lookups can take a considerable amount of time. If your profiles contain a long list of packages, you might want to use the –-local flag during the conversion process.
partitioning
Supported types are default and explicit. Unlike JumpStart, when partitioning default is specified, only the disks that js2ai knows about are used. If no disks are specified in any keywords, the generated profile tells AI to choose which disk to use.
pool
If a pool is specified in a profile, the ZFS root pool is created using the specified devices. The pool keyword supersedes all other keywords when determining which devices to use for the ZFS root pool.
No validation of the pool size, swap size, or dump size is performed. These sizes might need to be adjusted in the resulting AI manifest to achieve a successful installation with this manifest.
root_device
The rootdisk is set to the specified device.
system_type
Only the value standalone is supported.
usedisk
The specified device might be used to resolve the any or rootdisk device during the conversion. Any devices specified that are not used for this purpose are added to the ZFS root pool, when that pool is not mirrored.

JumpStart profile keywords not supported by js2ai:

archive_location       geo
backup_media           layout_constraint
bootenv                local_customization
client_arch            metabd
client_root            no_master_check
client_swap            no_content_check
cluster                num_clients
dontuse                patch
forced_deployment

How the System's Root Disk is Determined During Profile Translation

Since js2ai does not have access to the actual system a profile references during the profile translation process, js2ai attempts to determine what the root disk is during translation using a process that matches JumpStart as much as possible.

The js2ai tool performs the following steps to determine what device to use for the root disk.

Stage
Action
1
If the root_device keyword is specified in the profile, js2ai sets rootdisk to the device on which the slice resides.
2
If rootdisk is not set and the boot_device keyword is specified in the profile, js2ai sets rootdisk to the boot device.
3
If rootdisk is not set, partitioning default is specified, and a solaris fdisk entry is encountered, js2ai sets rootdisk to the specified disk_name.
4
If rootdisk is not set and a filesys cwtxdysz size / entry is specified in the profile, js2ai sets rootdisk to the cwtxdysz disk specified in the entry.
5
If rootdisk is not set and a usedisk disk entry is specified in the profile, js2ai sets rootdisk to the disk disk specified in the entry.
6
If rootdisk is not set and the following specification is encountered in the profile where size is not 0 or delete and disk is not all, then rootdisk is set to this disk name.
fdisk disk solaris size
7
If rootdisk is not set, any occurrence where the device is specified as rootdisk generates a conversion error.

How the any Device Is Translated During Profile Translation

The js2ai tool performs the following steps to determine what device to use when the any keyword is specified.

Stage
Action
1
If the any device is specified and the keyword action specified (non-mirrored pool, or filesys with a / mount point), the any device is set to rootdisk if rootdisk is set.
2
If the any device has not been translated and a usedisk statement exists in the profile, the any device is set to the device specified by the usedisk statement.
3
If the any device has not been translated and the action where the any device is specified causes the ZFS root pool to be created, AI chooses the device. This is not applicable when a mirrored pool is specified.

How the ZFS Root Pool is Determined During Profile Translation

The js2ai tool performs the following steps to determine what device to use for the ZFS root pool. Once the ZFS root pool is determined, subsequent definitions encountered are flagged as errors if they conflict with the ZFS root pool that has already been determined.

Stage
Action
1
If the profile specifies the pool keyword, js2ai sets the ZFS root pool to the devices specified by the pool keyword.
2
If the ZFS root pool has not been determined and the profile specifies a filesys with a mount point of /, the ZFS root pool is created using the devices specified.
3
If the ZFS root pool has not been determined and all keywords in the profile have been processed, and if rootdisk is set, the ZFS root pool is created using the rootdisk device.
4
If the ZFS root pool has not been determined and the partition type is default, AI chooses the device to use for the ZFS root pool.
5
If the ZFS root pool has not been determined and no errors have occurred during processing, AI chooses the device to use for the ZFS root pool.
6
If the ZFS root pool is not a mirrored pool and one or more usedisk devices that were specified have not been used for a rootdisk or any device translation, those disks are added to the ZFS root pool.

Converting sysidcfg Keywords

Table 339-3  JumpStart sysidcfg Keywords
sysidcfg Keyword
Notes
keyboard
No translation is performed. Make sure the keyboard specified in the sysidcfg file is supported in Oracle Solaris 11.
name_service
Supports values None, DNS, NIS , and LDAP. NIS+ name services are translated as NIS. If a name service is specified, the network interface in Oracle Solaris 11 is configured for DefaultFixed. The network_interface keyword can be used to define the characteristics of the network.
Oracle Solaris by default uses the prefix 'net' when assigning link names. In order to use the existing Oracle Solaris 10 interface name specified in the sysidcfg file, this feature is disabled. If you wish to use automatic assignment of neutral link names you must change the network interface name specified in the sysidcfg to a Oracle Solaris neutral link name like net0.
network_interface
AI supports configuring only a single interface as part of system installation. Because of this limitation, the js2ai tool processes only the interface labeled PRIMARY or the first interface encountered in the sysidcfg file. If a name_service is specified, the network is configured as DefaultFixed. A properly configured DefaultFixed network needs to provide the host name, IP address, netmask, and gateway. Automated network configuration is only supported if no name service is specified.
root_password
Oracle Solaris 11 uses roles instead of root user. An admin user with root role privileges will need to be defined in order to access the system in multi-user mode. As the necessary structure can't completely be defined via the root_password keyword the necessary structures used to defined a user account with root role privileges is added the xml file sc_profile.xml as a comment. If the root_password keyword is not specified the necessary data structure for it will also be defined as a comment.
security_policy
Supports value: None
service_profile
Supports value: limited_net
system_locale
js2ai will check to ensure that the locale specified is one of the default core locales supported. For more information on core locales see http://docs.oracle.com/cd/E23824_01/html/E24456/glmwl.html .
A warning will be generated if the locale specified is not in the core locales. js2ai will also attempt to convert non core locales to core locales.
terminal
No translation is performed. Make sure the terminal type specified in the sysidcfg file is supported in Oracle Solaris 11.
timeserver
Supports value: localhost
timezone
No translation is necessary.
nfs4_domain
nfs4_domain=dynamic is supported for Automatic and DefaultFixed networks. nfs4_domain=<custom_domain_name> is only supported for DefaultFixed networks. The conversion of network_interface keyword determines whether a DefaultFixed or Automatic network is configured.

Options

The js2ai command has the following options. The use of these options is illustrated in the “Examples” section.

–h, –-help

Show the usage help message.

–-version

Show the version number of the js2ai utility.

–d jsdir, – -dir jsdir

Specify the location of the rules and profile files or the sysidcfg file.

–D destdir, – -dest destdir

Specify the location for the output files.

–l, –-local

When searching for Image Packaging System (IPS) equivalents for the package keyword value in a JumpStart profile, search the IPS packages installed on the host system rather than the packages in an IPS package repository.

–p profile, – -profile profile

Convert the specified JumpStart profile and generate a manifest for the profile processed. In this case, no criteria file is needed or generated.

–r, –-rule

Convert rules and associated profiles and generate a manifest for each profile processed.

–s, –-sysidcfg

Process the sysidcfg file and output the results to sc_profile.xml.

–S, –-skip

Skip validation.

–v, –-verbose

Provide details on the actions that occurred during processing.

–V filename

Validate the specified AI manifest file or SMF system configuration profile file. AI criteria validation is not supported.

Error Report

Error Report

The js2ai tool generates an error report when one or more errors occurs during the conversion.

# js2ai -r
                    Process  Unsupported  Conversion  Validation
Name      Warnings  Errors   Items        Errors      Errors
--------  --------  -------  -----------  ----------  ----------
rules            0        0            2           0           -
profile1         0        0            0           2           1

Conversion completed. One or more failures and/or warnings occurred.
For details see ./js2ai.log

The report contains one entry for each file in which js2ai encountered an error. To generate an error report even when no errors occur, specify – v or –-verbose.

The report tells you what type of errors occurred in what files. Five error types are defined: Warnings, Process Errors, Unsupported Items, Conversion Errors, and Validation Errors.

Warnings

Items in these messages are not required to be corrected. For example, you might receive a warning message that information such as host name or root password was not provided, and default values will be used.

Process Errors

These errors refer to problems that prevent js2ai from processing a file or a line within the file. Process errors typically occur when the file has a syntax error.

Unsupported Items

These items refer to a line that js2ai does not support. Changing the value associated with a keyword might eliminate this error.

Conversion Errors

These errors refer to a condition that prevents js2ai from processing a line. These errors should be manually corrected, or the offending lines should be removed from the file.

Validation Errors

These errors refer to the errors that occurred when the generated manifest was validated against the schema definition used by AI. These errors must to be corrected before the manifest can be used by AI.

The js2ai.log file indicates what error occurred on what line.

# cat js2ai.log
rules: line 4: unsupported keyword: disksize
rules: line 4: unsupported keyword: installed
net924_sun4c: line 4: unsupported keyword: cluster
net924_sun4c: line 5: unsupported keyword: num_clients
net924_sun4c: line 6: unsupported keyword: client_swap
net924_sun4c: line 7: unsupported keyword: client_arch
upgrade: line 1: unsupported value for 'install_type' specified: upgrade

If a validation error of the manifest occurs, the js2ai.log file contains a pointer to the log file that contains the validation errors, as shown in the following example:

Validation Errors:
    profile1: manifest validation of
    ./AI_profile1/profile1.xml failed.
    For details see ./AI_profile1/profile_validation.log

Conversion Strategy

Conversion Strategy

Recommended Strategy for Rule and Profile Conversion

    A one-to-one conversion between JumpStart and AI does not exist. The following steps provide a general procedure for performing the conversion.

  1. The js2ai utility attempts to flag any errors it encounters, but js2ai assumes the rules, profiles, and sysidcfg files that are being converted are valid.

  2. Copy the JumpStart configuration directory of rules, profile, and syscfg configuration files to an Oracle Solaris 11 system that has the install/installadm package installed.

  3. In the JumpStart configuration directory that you copied to the Oracle Solaris 11 system in step 2, run the js2ai conversion tool.

    # js2ai -rS

    This command performs a conversion operation on the rules file and the profiles referenced by the rules file. Each profile referenced in the rules file is processed against the AI client provisioning manifest, /usr/share/auto_install/manifest/default.xml . This step creates a directory named AI_profile for each profile specified in the JumpStart rules file. The AI_profile directory contains one or more AI manifests for the translated profile in the form profile${arch}.xml. See the “Files” section for more information.

    The –S option skips the validation sequence. Validation is done in step 5.

  4. If the message “Successfully completed conversion” is output, skip to step 5. Otherwise, examine the js2ai.log file and follow these steps:

    1. Correct any process errors.

    2. Remove any lines from the rules and profile files that are listed as Unsupported Items.

    3. Examine the conversion errors and correct the errors if possible. Otherwise, remove the lines that are causing the errors.

    4. Examine any warning messages and make sure no corrections are necessary.

    5. Repeat step 3 until no processing errors, unsupported items, and conversion errors are reported.

  5. Rerun js2ai without the –S option.

    # js2ai -r

    If any validation errors occur for any of the processed profiles, the resulting AI manifest must be manually corrected. Examine the js2ai.log file for details of the failure. See the AI documentation for information about AI manifests.

  6. Convert any sysidcfg files that are associated with this JumpStart configuration.

    For each sysidcfg file, execute the following command:

    # js2ai -sS -d sysidcfgdir

    For each sysidcfg file processed, this step creates an AI system configuration profile file named sc_profile.xml in the directory where the js2ai command was invoked. Use the –D option to specify a different directory for the sc_profile.xml file.

    Unlike profiles conversion a js2ai sysidcfg conversions will always generate a warning about the user account.

    sysidcfg:line x:WARNING: Oracle Solaris 11 uses roles instead of root user.
    An admin user with root role privileges will need to be defined in order to
    access the system in multi-user mode.  The necessary xml structures have been
    added to sc_profile.xml as a comment.  Edit sc_profile.xml to perform the
    necessary modifications to define the admin user.

    This warning has to do with the inability of js2ai to generate the necessary data structure from just the root_passwd keyword. A manual step at the end of the conversion process will be necessary to correct this.

    Additionally a warning message may about neutral link name support being disabled may be generated.

    sysidcfg:line x:WARNING: In order to support the direct translation of the
    sysidcfg interface 'e1000g', Oracle Solaris 11 neutral link name support will
    be disabled.  If you wish to use neutral link names, change the interface
    name specified in the sysidcfg file to a 'netx' style interface name or edit
    the resulting sc_profile.xml file.

    If you wish to use the old style link names then no action is required. In most instances the interfaces will map the same as they do in Oracle Solaris 10. But there is no guarantee this will occur 100% of the time.

  7. Examine the results:

    1. Correct any process errors.

    2. Remove any lines from the sysidcfg file that are listed as unsupported items.

    3. Examine the conversion errors and correct the errors if possible. Otherwise, remove the lines that are causing the errors.

    4. Examine any warning messages and make sure no corrections are necessary.

    5. Repeat step 6 until no processing errors, unsupported items, and conversion errors are reported.

  8. Rerun js2ai without the –S option.

    # js2ai -s -d sysidcfgdir

    If any validation errors occur for any of the processed sysidcfg files, the resulting AI system configuration profile must be manually corrected. Examine the js2ai.log file for details of the failure. See the AI documentation for information about system configuration profiles.

  9. Edit the sc_profile.xml file that js2ai generated to add the user account information to the system/config-user structure. If your sysidcfg file contained the root_passwd keyword in it, js2ai would generate a system/config-user structure like the following:

    <service name="system/config-user" type="service" version="1">
    <instance enabled="true" name="default">
    <!--
    Configures user account as follows:
    * User account name 'jack'
    * password 'jack'
    * GID 10
    * UID 101
    * root role
    * bash shell
    -->
           <!--
    <property_group name="user_account" type="application">
       <propval name="login" type="astring" value="jack"/>
       <propval name="password" type="astring" value="9Nd/cwBcNWFZg"/>
       <propval name="description" type="astring" value="default_user"/>
       <propval name="shell" type="astring" value="/usr/bin/bash"/>
       <propval name="gid" type="astring" value="10"/>
       <propval name="uid" type="astring" value="101"/>
       <propval name="type" type="astring" value="normal"/>
       <propval name="roles" type="astring" value="root"/>
       <propval name="profiles" type="astring" value="System Administrator"/>
    </property_group>
     -->
       <property_group name="root_account" type="application">
             <propval name="password" type="astring" value="{your_root_passwd}"/>
             <propval name="type" type="astring" value="role"/>
           </property_group>
         </instance>
       </service>

    In XML a comment is started with <!-- and ends in --> . To define the user necessary to support Oracle Solaris 11 remove the XML comment markers around the user_account structure. Then modify the structure as desired to create the user that will have root role privileges. If no root_password keyword was specified the root_account property group structure would also be commented out and you will need to uncommit it and update the root password field.

  10. The js2ai conversion process is complete. Perform a manual verification of the resulting criteria, AI manifest, and system configuration profile files. The disk space requirements for an Oracle Solaris 11 installation are different from the disk space required for an Oracle Solaris 10 installation. Make sure the disk space allocated in your AI manifests meets the requirements of Oracle Solaris 11.

  11. Configure AI to use the newly generated files. Add the newly generated criteria, AI manifest, and system configuration profile files to an existing AI install service.

    Use the installadm command with the create-manifest subcommand to add each AI manifest with criteria for selecting that manifest. Each client can use only one AI manifest.

    # installadm create-manifest -n svcname \
    
    -f filename -m manifest \
    
    -C criteriafile

    Use the create-profile subcommand to add each profile with criteria for selecting that configuration profile. Each client can use one or more system configuration profiles.

    # installadm create-profile -n svcname \
    
    -f filename -p profile \
    
    -C criteriafile

    See the AI documentation and the installadm(1M) man page for information about configuring AI install services.

Examples

Example 1 Processing a JumpStart Configuration

The following command processes the JumpStart rules and profiles in the current directory. The output is also placed in this directory.

# js2ai -r
Example 2 Processing a Specific JumpStart Directory

The following command processes the JumpStart rules and profiles from the specified directory and places the output files in the same directory.

# js2ai -r -d /export/jumpstart

For more information about the output files, see Example 4 and the “Files” section.

Example 3 Processing a Profile in a Specific JumpStart Directory and Separate Destination Directory

The following command processes the JumpStart rules and profile files from the /export/jumpstart directory and places the output files in /export/output.

# js2ai -p profile1 -d /export/jumpstart -D /export/output
Example 4 Example Input and the Resulting Output for a Specified Rule and Its Profile

Rule:

arch sparc && karch sun4u && \
    model 'SUNW,Serverblade1'  -   profile    -

Profile:

install_type    initial_install
pool mypool auto auto auto c1t0d0s0

Conversion command:

# js2ai -r -d /jumpstart -D /tmp/output

Output files:

/tmp/output/AI_profile/profile.x86.xml
/tmp/output/AI_profile/profile.sparc.xml
/tmp/output/AI_profile/criteria-1.xml

Two manifest files are created, one for SPARC and one for x86, even though the rules file specifies the CPU type as SPARC. During the conversion process, rules and profiles are processed independently of one another.

Example 5 Adding Generated Files to an AI Install Service

This example adds the manifest and criteria to an existing service, using the files generated in Example 4.

Files:

/tmp/output/AI_profile/profile.sparc.xml
/tmp/output/AI_profile/criteria-1.xml

installadm command:

# installadm create-manifest -n svc-name \
-f /tmp/output/AI_profile/profile.sparc.xml \
-m sparc_profile \
-C /tmp/output/AI_profile/criteria-1.xml
Example 6 Processing a sysidcfg File

The following command processes the sysidcfg file in the current directory and outputs the resulting SMF system configuration profile as sc_profile.xml in the same directory.

# js2ai -s

Exit Status

The following exit values are returned:

0

All the files were processed successfully.

>0

An error occurred.

Files

outputdir/AI_${ profile}

Directory that contains all the corresponding files that have been translated to the new AI syntax associated with the profile.

outputdir/AI_${ profile}.${arch}.xml

The manifest file created as a result of translating the profile. ${arch} can be one of these three values: sparc, x86, or generic. A manifest file that is in the form ${profile}.generic.xml can be used to install both x86 and SPARC systems.

outputdir/AI_${ profile}/criteria-rule.xml

The criteria-rule.xml file produced corresponds to the rule in the rules file. The rule is the rule number based on its position in the rules file. This criteria file can then be used with the –C option to the installadm command.

Since more than one rule can specify the same profile, more than one criteria file can exist in each directory, but only one instance of the ${profile}.${arch}.xml file should exist in each output directory.


Note - If the –p option is used, no criteria file is produced for the profile that is processed. Criteria files are only generated when used with the –r option.
outputdir/js2ai.err

This file contains a stack trace of an unexpected condition that occurred during processing. This file is not typically created.

outputdir/js2ai.log

This file contains a log of the files processed and any errors found during processing.

outputdir/sc_profile.xml

This file is the SMF system configuration profile that is generated when the –s option is used to convert a sysidcfg file.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
install/js2ai
Interface Stability
Committed

See also

installadm(1M), pkg(1)

Transitioning From Oracle Solaris 10 JumpStart to Oracle Solaris 11.2 Automated Installer

Part III, Installing Using an Install Server, in Installing Oracle Solaris 11.2 Systems