2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

Merge pull request #5372 from immarvin/ondoc

refine doc for mkdef --template
This commit is contained in:
Gᴏɴɢ Jie 2018-07-05 16:22:45 +08:00 committed by GitHub
commit 2bd189b73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 7 deletions

View File

@ -3,7 +3,7 @@ Select or Create an osimage Definition
Before creating an image on xCAT, the distro media should be prepared ahead. That can be ISOs or DVDs.
XCAT use 'copycds' command to create an image which will be available to install nodes. "copycds" will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default.
XCAT use 'copycds' command to create an image which will be available to install nodes. ``copycds`` will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default.
If using an ISO, copy it to (or NFS mount it on) the management node, and then run: ::
@ -81,15 +81,16 @@ In this way, if you need to install some additional RPMs into your MN later, you
**[Tips 2]**
You can create/modify an osimage definition easily based on the default osimage definition. The general steps are:
You can create/modify an osimage definition easily with any existing osimage definition, the command is ::
mkdef -t osimage -o <new osimage> --template <existing osimage> [<attribute>=<value>, ...]
* lsdef -t osimage -z <os>-<arch>-install-compute > <filename>.stanza
* modify <filename>.stanza according to your requirements
* cat <filename>.stanza| mkdef -z
Except the specified attributes *<attribute>*, the attributes of *<new osimage>* will inherit the values of template osimage *<existing osimage>*.
For example, if you need to change the osimage name to your favorite name, this command may be helpful: ::
As an example, the following command creates a new osimage "myosimage.rh7.compute.netboot" based on the existing osimage "rhels7.4-ppc64le-netboot-compute" with some customized attributes ::
mkdef -t osimage -o myosimage.rh7.compute.netboot --template rhels7.4-ppc64le-netboot-compute synclists=/tmp/synclist otherpkgdir=/install/custom/osimage/myosimage.rh7.compute.netboot/3rdpkgs/ otherpkglist=/install/custom/osimage/myosimage.rh7.compute.netboot/3rd.pkglist
chdef -t osimage rhels6.2-x86_64-install-compute -n rhels6.2_myimage

View File

@ -29,3 +29,32 @@ The manually defined node will be like this::
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles
primarynic=mac
``mkdef --template`` can be used to create node definitions easily from the typical node definition templates or existing node definitions, some examples:
* creating node definition "cn2" with an existing node definition "cn1" ::
# mkdef -t node -o cn2 --template cn1 mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2
1 object definitions have been created or modified.
except the attributes specified(``mac``, ``ip`` and ``bmc`` attribute here), other attibutes of the newly created node "cn2" inherit the values of template node "cn1"
* creating a node definition "cn2" with the template "ppc64le-openbmc-template"(openbmc controlled ppc64le node) shipped by xCAT ::
# mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcpassword=USERID bmcusername=PASSW0RD
1 object definitions have been created or modified.
the unspecified attributes of newly created node "cn2" will be assigned with the default values in the template
to list all the node definition templates available in xCAT, run ::
# lsdef -t node --template
to display the full definition of template "ppc64le-openbmc-template", run ::
# lsdef -t node --template ppc64le-openbmc-template
the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:<attribute description>`` in template definition.
the optional attributes, which can be specified optionally, are denoted with the value ``OPTIONAL:<attribute description>`` in template definition