2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-11-21 17:11:52 +00:00
0 The mini design of osimage version control(initial draft)
zet809 edited this page 2018-04-16 16:14:44 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Target:

  1. enable the management of essential information of osimage under source control tool such as GIT
  2. provide an easy workflow to generate, manage and apply the osimage versions
  3. enable the sharing of osimages among clusters

Design:

the osimage entity under source control

1. the content of the osimage entity under source control:

• the osimage definition in YAML format, generated by “xcat-inventory export”

  osimage:
    rhels7.4-ppc64le-netboot-compute:
      basic_attributes:
        arch: ppc64le
        distribution: rhels7.4
        osdistro: rhels7.4-ppc64le
        osname: Linux
      diskpartitionspec: /install/osimages/rhels7.4-ppc64le-netboot-compute/scripts/partfile
      genimgoptions:
        exlist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist
        permission: '755'
        postinstall: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall
        rootimgdir: /install/netboot/rhels7.4/ppc64le/compute
      imagetype: linux
      package_selection:
        otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le
        pkgdir: /install/rhels7.4/ppc64le
        pkglist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist
      provision_mode: netboot
      role: compute
      scripts:
        postbootscripts: scriptC,scriptD
        postscripts: scriptA,scriptB
  schema_version: '2.0'

• the files inferred in the osimage definition:

  • pkglist(if customized)
  • otherpkglist(if customized)
  • postscripts(if customized)
  • postbootscripts(if customized)
  • diskpartitionspec
  • filestosync
  • template(if customized)
  • exlist(if customized)
  • postinstall(if customized)
  • initrd and compressed rootimg(not by default)
  • the information about the repo under pkgdir and otherpkgdir directories

2. the directory hierarchy of osimage entity

the related path of the files under the osimage directory follows the relative path in the osimage definition under “/”, the directory hierarchy of the osimage “rhels7.4-ppc64le-netboot-compute” is:

  ./install/postscripts/scriptA
  ./install/postscripts/scriptB
  ./install/postscripts/scriptC
  ./install/postscripts/scriptD
  ./install/osimages/rhels7.4-ppc64le-netboot-compute/scripts/partfile
  ./definition.yaml

the workflow of osimage versions:

xcat-inventory export t osimage o rhels7.4-ppc64le-netboot-comput f then a osimage entity will be generated under the specified path

the osimage directory can be managed under source control system.

The genimage and packimage can be performed according to the osimage definition under the osimage directory instead of osimage definition in DB by “genimage f ”, “packimage f ”, the generated initrd and compressed rootimg can be placed to the same place in current xCAT code logic “/install/netboot/….”

After osimage is confirmed work fine during provision, it can be applied to xCATdb by “xcat-inventory import f”

The osimages can be shared by pull the osimage directory from the source control repo of share the tarball of the osimage directory. User should make sure the “pkgdir” and “otherpkgdir” holding the packages is compatible with the osimage definition.

The restructure of osimage entity in xCAT

Currently, the osimages share lots of files shipped by xCAT, such as pkglist, templates. This caused some difficulty while share or source control the osimages. An idea is to infer these default files by a “#INCLUDE#” clause in side the files of each osimage, so that each osimage will have all the files, 3-rd party rpms, initrd and rootimg(for diskless) in its director