Skip to content

the mini design of xcat inventory export and import for osimage

yangsong edited this page May 8, 2018 · 7 revisions

the export of osimages

xcat-inventory export -t osimage [-o <osimage name>] -f|--path <destdir>  [--format <format>] [--archive] 
  • if option -f|--path <destdir> is not specified, keep the current behavior to display the osimage definition in stdout

  • if option -f|--path <destdir> is specified, create each subdirectory <osimage name> for each osimage object under <destdir>, each subdirectory <osimage name> contains the following files:

    (1) definition.yaml: the definition of the osimage in the specified <format>

    (2) the directory hierarchy of the osimage customized files referenced in osimage definition, the osimage customized files under the path which shipped by xCAT will not be exported.

  • if --archive is specified, a tarball instead of osimage directory will be created

An example:

[root@c910f03c05k21 osimage]# xcat-inventory export -t osimage -o rhels7.4sp1-x86_64-netboot-compute --format yaml --path //opt/inventory/site/osimage/
[root@c910f03c05k21 osimage]# cat /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/definition.yaml
osimage:
  rhels7.4sp1-x86_64-netboot-compute:
    basic_attributes:
      arch: x86_64
      distribution: rhels7.4sp1
      osdistro: rhels7.4sp1-x86_64
    genimgoptions:
      exlist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.exlist
      postinstall: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.postinstall
      rootimgdir: /install/netboot/rhels7.4sp1/x86_64/compute
    imagetype: linux
    package_selection:
      otherpkgdir: /install/post/otherpkgs/rhels7.4sp1/x86_64
      otherpkglist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.otherpkglist
      pkgdir: /install/rhels7.4sp1/x86_64
      pkglist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.pkglist
    provision_mode: netboot
    role: compute
    scripts:
      postbootscripts: config_cuda
      postscripts: confignetwork
schema_version: '1.0'

[root@c910f03c05k21 osimage]# tree /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute
/opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute
├── config_cuda
├── confignetwork
├── definition.yaml
└── opt
    └── inventory
        └── site
            └── osimage
                └── rhels7.4sp1-x86_64-netboot-compute
                    ├── compute.rhels7.x86_64.exlist
                    ├── compute.rhels7.x86_64.otherpkglist
                    ├── compute.rhels7.x86_64.pkglist
                    └── compute.rhels7.x86_64.postinstall

5 directories, 7 files

the import of osimages

xcat-inventory import [-t osimage] [-o <osimage name>] -f|--path <srcdir> 
  • if <srcdir> is a flat text file, keep the current behavior of xcat-inventory import
  • if <srcdir> is a directory, check whether the file "definition.yaml" exists under <srcdir>
    • if yes, <srcdir> is an osimage directory
      • if [-o <osimage name>] is specified, compare the specified osimage name <osimage name> and the osimage name in definition.yaml
        • if the specified osimage name matches the osimage name in definition.yaml, import osimage definition into xCAT DB, copy the customized osimage files referenced in osimage definition to the destination path in osimage definition; otherwise, complain the specified osimage does not exist under <srcdir>. If the destination file is exactly the same as the source file, just import osimage definition into xCAT DB, skip file copy.
      • if [-o <osimage name>] is not specified, import the osimage definition and customized osimage files under <srcdir>
    • if no, <srcdir> might be an directory holding osimage directories
      • if [-o <osimage name>] is specified, find the directory <osimage name> under <srcdir>, import <osimage name> if it is a valid osimage directory
      • if [-o <osimage name>] is not specified, import all the valid osimage directories under <srcdir>
  • if <srcdir> is a tarball file, extract the tarball first and import the unarchived file/directory

News

History

  • Oct 22, 2010: xCAT 2.5 released.
  • Apr 30, 2010: xCAT 2.4 is released.
  • Oct 31, 2009: xCAT 2.3 released. xCAT's 10 year anniversary!
  • Apr 16, 2009: xCAT 2.2 released.
  • Oct 31, 2008: xCAT 2.1 released.
  • Sep 12, 2008: Support for xCAT 2 can now be purchased!
  • June 9, 2008: xCAT breaths life into (at the time) the fastest supercomputer on the planet
  • May 30, 2008: xCAT 2.0 for Linux officially released!
  • Oct 31, 2007: IBM open sources xCAT 2.0 to allow collaboration among all of the xCAT users.
  • Oct 31, 1999: xCAT 1.0 is born!
    xCAT started out as a project in IBM developed by Egan Ford. It was quickly adopted by customers and IBM manufacturing sites to rapidly deploy clusters.
Clone this wiki locally