Vm Templates

Contents

Design in Progress

Version 1

Design

For general-purpose OS images (F10, windows XP, etc), we don't want to tie Vm Size to ISO.

Storage

Implementation

Storage -attach or create
  1. Iterate over all available storage volumes in the storage pools that belong to the HW pool -- if we find one that's the right size, then we use it.
  2. Iterate over all the storage pools that support creating new volumes (i.e. nfs, lvm) -- find the first that has enough available space to create the volume we want. This round will just pick one arbitrarily, with no regard to type or anything else besides that it is a storage pool for the user's resourcepool. (TODO: check if we can actually tell available space from the storage pool level)
  3. Fail the task if we can't find any free storage volumes and can't create any.
Pseudo code

(module written using BDD-inspired language)

 module CloudService

 include <various modules as needed>

  def svc_new
    should check if user has permission:CLOUD_CREATE
    should return list of VmTemplates to choose from
    should return list of VmResourcePools to choose from if user has more than one
  end

  svc_create
    should check if user has permission:CLOUD_CREATE for give VmResourcePool
    should call some storage service to see if there is a volume available for use, and if not, add a task to create one (this may require one or more new StorageXService methods)
    should call VmService::svc_create, using chosen VmTemplate, VmResourcePool, and values from VmSize.yml
  end
 end

 VmSize.yml:

  small:
    cpus: 2
    memory: 262144
    storage_size_in_gb: 15

Post-Version 1


Glossary

Vm Size
in this context, when we say Vm Size, we mean metadata to help define a new vm(separate from what is provisioned _onto_ that vm). This metadata includes cpu, ram, and storage size (and possibly network-related information)
Vm Template
the provisioned system. Initially, this is likely just isos, but in future releases may be ks, appliance, etc.
Vm Profile
combination of Vm Size and Vm Template
MediaWiki