You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Background

The VCL backend code was significantly reworked in version 2.0 to utilize a "modularized" framework.  This framework allows certain parts of the code to be separated from the core code through the implementation of modules.

VCL interacts with external technologies including:

  • provisioning engines
  • operating systems
  • monitoring utilities

The technology being used may vary based on the VCL deployment, management node, image, computer, and so on.  Modules make configuring VCL to use a certain technology easy while simplifying the core code.

The advantages of implementing modules are not limited to external technologies.  Modules may be implemented for functions applicable only to VCL, but may vary based on the environment.  For example, research is being conducted to compare different algorithms which are used to select the image that is loaded on a computer after a reservation is complete.  A module is created for each algorithm, and configuring a managment node to use a certain algoritym is as simple as changing one value in the database.

Advantages

  • Modules make it easier for developers to implement new technologies to be used with VCL easily
  • Core VCL code does not need to be altered in order to support additional technologies or functionality
  • Increased flexibility for different configurations
  • Consistent methods to access data stored in the database
  • Code maintainability is increased because each module focuses on a distinct task and the core code does not need to check for numerous different conditions based on the technology being used

Object Orientation and Inheritance

Module.pm (VCL::Module)

  • Provides a constructor for all derived objects to use
    • Objects which inherit from VCL::Module do not need to implement their own new() subroutines
    • Objects which inherit from VCL::Module do not need to deal with "blessing" themselves
  • Provides access to the database data for the reservation via the data() subroutine implemented by Module.pm
    • Any module derived from VCL::Module can call $self->data->[get_something] or $self->data->[set_something]

State.pm (VCL::Module::State)

  • Supports the core VCL state modules such as new.pm, image.pm, reclaim.pm, and others
  • Provides an initialize() subroutine which performs common tasks whenever a state object is created
    • initialize() creates the provisioning and OS objects
  • Provides an os() subroutine which allows the state objects to interact with the resource's operating system by calling $self->os->[subroutine]

  • Provides a provisioner() subroutine which allows the state objects to interact with the provisioning engine that has been configured for the resource by calling $self->provisioner->[subroutine]

  • Provides other subroutines such as reservation_failed() which performs a consistent set of tasks when a reservation fails

Provisioning.pm (VCL::Module::Provisioning)

  • Provisioning engine modules should inherit from VCL::Module::Provisioning
  • Modules which are a subclass of VCL::Module::Provisioning also receive the functionality provided by VCL::Module through inheritance
  • VCL::Module::Provisioning provides provisioning modules with access to the OS object created for the reservation

OS.pm (VCL::Module::OS)

  • OS modules should inherit from VCL::Module::OS
  • Modules which are a subclass of VCL::Module::OS also receive the functionality provided by VCL::Module through inheritance
  • VCL::Module::OS provides OS modules with access to the provisioning object created for the reservation
    • This is useful if the OS needs to perform a task such as power cycling the computer if a reboot fails

Data 

Module Initialization

Database Module Configuration

  • No labels