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:

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 management node to use a certain algorithm is as simple as changing one value in the database.

Object Orientation and Inheritance

Object orientation and inheritance are used in the VCL modular framework, allowing modules to access functionality from the classes which they inherit from.  This relieves module developers from having to worry about many underlying details and reduces code duplication.

The following diagram shows how inheritance is organized:
Figure: VCL module inheritance organization
  A few notes about the diagram:

Explain:

Advantages

Explain: 

Core Modules

  Explain:

vcld (VCL::vcld)

Explain:

DataStructure.pm (VCL::DataStructure)

Explain:

utils.pm (VCL::utils)

Explain:

Module.pm (VCL::Module)

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

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

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

Implementation Details

Working with Inheritance

Explain:

Including Non-Inherited Modules

 Explain:

Module Initialization

Explain how modules can implement initialize() subs which are automatically called

Database Configuration for Modules

Explain module table, computer.moduleid, managementnode.predictivemoduleid

Cross-Module Access

Explain why some modules shouldn't have access to others, which is why Module.pm doesn't make os() and provisioner() available

Required & Optional Module Subroutines

Explain:

Package Organization

Explain: