Package VMBuilder :: Module vm :: Class VM
[frames] | no frames]

Class VM

source code

object --+
         |
        VM

The VM object has the following attributes of relevance to plugins:

distro: A distro object, representing the distro running in the vm

disks: The disk images for the vm.
filesystems: The filesystem images for the vm.

result_files: A list of the files that make up the entire vm.
              The ownership of these files will be fixed up.

optparser: Will be of interest mostly to frontends. Any sort of option
           a plugin accepts will be represented in the optparser.

Instance Methods
 
__init__(self, conf=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
distro_help(self) source code
 
hypervisor_help(self) source code
 
register_setting(self, *args, **kwargs) source code
 
register_setting_group(self, group) source code
 
setting_group(self, *args, **kwargs) source code
 
add_disk(self, *args, **kwargs)
Adds a disk image to the virtual machine
source code
 
add_filesystem(self, *args, **kwargs)
Adds a filesystem to the virtual machine
source code
 
call_hooks(self, func) source code
 
preflight_check(self) source code
 
create(self)
The core vm creation method
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables
  hypervisor
hypervisor object, representing the hypervisor the vm is destined for
Properties

Inherited from object: __class__

Method Details

__init__(self, conf=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

create(self)

source code 

The core vm creation method

The VM creation happens in the following steps:

A series of preliminary checks are performed:

  • We check if we're being run as root, since the filesystem handling requires root priv's
  • Each plugin's preflight_check method is called. See VMBuilder.plugins.Plugin documentation for details
  • create_directory_structure is called
  • VMBuilder.disk.create_partitions is called
  • VMBuilder.disk.create_filesystems is called
  • .mount_partitions is called
  • .install is called