Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  • Description
    • reserve() gets called by new.pm after a machine has been reloaded if the state is "new" (new.pm also handles the "reload" state and others)
    • It should perform the steps necessary to take a reloaded machine and prepare it for a particular reservation
    • Anything reservation-specific that doesn't require knowing the user's IP should be done in reserve()
    • After reserve() has run, the state can be changed to reserved and the "Connect" button can be presented to the user
    • reserve() would normally add the reservation user and any users set in imagemeta usergroup to the computer, set their passwords, and add them to the appropriate groups
    • reserve() does not configure the firewall or do anything networking related because at the time it's called, the state has not been changed to reserved and the user has not been shown the "Connect" button.  Hence, the user's IP is not known.
    • reserve() is called by new.pm before the "Connect" button is shown to the user because adding several user accounts may take a long time.  If adding users was done after the state was changed to reserved, a user could attempt to connect before all of the users accounts were added.
  • Expected Beginning State
    • Request state is pending/new 
    • Computer has been reloaded
  • Expected Ending State
    • Computer has been configured for a particular reservation
    • User accounts have been added and configured
    • Request state can be changed to reserved and the "Connect" button can be presented to the user
  • Called By
    • new.pm
  • Arguments & Calling Environment
    • Must only be called as an object method of an OS object ($os->get_current_image_name>reserve())
    • No arguments
  • Return Values
    • True (1) 
      • Computer has successfully been configured for a particular reservation
    • False (0 or undefined) 
      • Computer could not be configured for a particular reservation

...