Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Gliffy Diagram
sizeL
nameImage Capture Sequence - xCAT
pageVCL:Image Capture Sequence
alignleft
spaceVCL
  • Interface subroutines should be very generic
  • Modules may or may not implement an interface subroutine.  If an interface subroutine is not implemented, the core modules assume it isn't needed.
  • OS modules should be completely ignorant of the provisioning engine being used
  • OS modules should never have conditional statements regarding the provisioning engine or provisioning architecture.  For example, an OS module should not need to worry about whether the OS is installed on a bare metal or virtual machine.
  • PHP frontend tasks 
  • vcld & image.pm tasks 
  • OS tasks
  • Provisioning engine tasks

Current xCAT/Windows Image Capture Sequence

  1. User clicks "Create Image"
    • it's possible that another process is running
  2. PHP frontend code inserts the new rows into the image and imagerevision tables
    • image.deleted = 1, this prevents the new image from being available for checkout until the image creation process is done
  3. PHP frontend changes the existing request state to 'image'
    • the reservation image information is changed to contain the new image and imagerevision IDs, not the IDs of the image and imagerevision used as the base image
    • it's possible that another 'inuse' process is still running for the reservation, this process will detect that the request state has changed to 'image' and exit
  4. vcld detects the new request and begins to process it 
    • a new image.pm object is created
    • image.pm::process() is called
  5. image.pm::process()
    • make sure image does not already exist in the image repository
  6. OS::capture_prepare()
    • change root password to known value 
    • logoff user
    • remove user account
    • make sure DHCP is enabled on the private NIC
    • defragment the hard drive
    • disable the pagefile
      • set sshd service startup to auto
      • reboot
      • delete the pagefile
    • configure auto admin login to login as root
    • copy Sysprep, drivers, and scripts to the computer
    • set sshd service startup to manual so that it doesn't immediately start up when the computer the image is loaded on boots up
  7. provisioner::capture_prepare()
    • write the currentimage.txt file on the computer
    • update nodetype.tab with the new image name
    • create a .tmpl file for the new image
    • run 'nodeset <node> image' to instruct xCAT to save an image the next time the computer boots
  8. OS::capture_start()
    • run sysprep.cmd
      • cleans various files from the hard drive
      • copies VCLprepare.cmd script to group policy logon scripts directory
      • copies VCLcleanup.cmd script to group policy logoff scripts directory
      • executes sysprep.exe with the switch instructing it to reboot the computer
  9. provisioner::capture_monitor()
    • continuously check the size of the new image files to make sure they're growing
    • continuously check the nodeset status of the computer, imaging is done when it changes to 'boot'
    • create hda.mbr, hda.sfdisk, sda.mbr, sda.sfdisk files
  10. image.pm::process()
    • update request state to completed
    • provisioner::get_image_size() is called
    • database tables are updated for the newly created image
      • image.lastupdate timestamp = current time
      • image.deleted = 0
      • image.size = result from provisioner::get_image_size()
      • image.name = imagerevision.imagename, this updates the image to contain the correct revision number in the name
      • imagerevision.deleted = 0, this causes the image to appear in the list available for checkout
      • imagerevision.datecreated = current time
  11. image.pm::image_creation_successful()
    • email message is sent notifying the image creator that the process has completed
    • email message is sent to the system administrators
    • reload request is inserted into the database - the computer is reloaded with the newly created image
  • image.pm::image_creation_failed()
    • email message is sent notifying the image creator that the process has been delayed
    • email message is sent to the system administrators notifying them that the image creation process failed
    • request state is updated to maintenance, this prevents vcld from attempting to process or delete the request until an administrator has investigated the problem
    • computer state is updated to maintenance, this prevents any other processes from altering or reloading the computer

Current VMWare Image Capture Sequence

  • provisioner::capture()
    • write the currentimage.txt file on the computer
    • change root password to known value
    • defragment the hard drive
    • disable the pagefile
      • set sshd service startup to auto
      • reboot
      • delete the pagefile
    • copy Sysprep, drivers, and scripts to the computer
    • set sshd service startup to manual
    • run sysprep.cmd
      • copies VCLprepare.cmd script to group policy logon scripts directory
      • copies VCLcleanup.cmd script to group policy logoff scripts directory
      • executes sysprep.exe with the switch instructing it to shutdown the computer
    • VMWare command is issued to stop the virtual machine: 'vmware-cmd <vmx path> stop hard'
    • directory is created for the new image in the repository
    • vmdk files are copied from the VM host to the repository
    • vmdk files are renamed according to the new image name
    • vmx path is unregistered from the VM host
    • vmx directory is deleted from the VM host