hu.mta.sztaki.lpds.cloud.simulator.iaas
Interface VMManager<E,F>

Type Parameters:
E - The type of the system that will manage the VMs.
F - The kind of the managed capacities behind the VMManager.
All Known Implementing Classes:
IaaSService, PhysicalMachine

public interface VMManager<E,F>

This interface intends to provide a generic overview of the VM management functionalities in a system.

Author:
Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013

Nested Class Summary
static interface VMManager.CapacityChangeEvent<F>
          The interface to implement for those events where a VMManager object changes its capacity.
static class VMManager.NoSuchVMException
          Receiving this kind of exception shows that the system does not recognize the VM it should operate on.
static class VMManager.VMManagementException
          This is a generic class to represent all kinds of problems that could occur while managing VMs on the system.
 
Method Summary
 ResourceConstraints getCapacities()
          Allows the query of the total capacities
 Collection<VirtualMachine> listVMs()
          Provides an overview on the VMs currently in the system
 void migrateVM(VirtualMachine vm, E target)
          Migrates a VM from the current system to another.
 void reallocateResources(VirtualMachine vm, ResourceConstraints newresources)
          Allows fine-grained resource utilization setup of the particular VM after it was allocated on the system.
 VirtualMachine[] requestVM(VirtualAppliance va, ResourceConstraints rc, Repository vaSource, int count, HashMap<String,Object> schedulingConstraints)
          Creates a new VM in the system and immediately returns with a new VM object.
 void subscribeToCapacityChanges(VMManager.CapacityChangeEvent<F> e)
          manages the subscriptions for capacity change (increase/decrease) events
 void terminateVM(VirtualMachine vm, boolean killTasks)
          Terminates a VM in the system.
 void unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<F> e)
          manages the subscriptions for capacity change (increase/decrease) events
 

Method Detail

requestVM

VirtualMachine[] requestVM(VirtualAppliance va,
                           ResourceConstraints rc,
                           Repository vaSource,
                           int count,
                           HashMap<String,Object> schedulingConstraints)
                           throws VMManager.VMManagementException,
                                  NetworkNode.NetworkException
Creates a new VM in the system and immediately returns with a new VM object. The user have to check if the VM is actually running through the VM object. Implementors should ensure that the particular VA is accessible for the system before the VM gets started.

Parameters:
va - the kind of VM to be created
Returns:
the new VM
Throws:
VMManager.VMManagementException - if the request cannot be fulfilled for some reason
NetworkNode.NetworkException

terminateVM

void terminateVM(VirtualMachine vm,
                 boolean killTasks)
                 throws VMManager.NoSuchVMException,
                        VMManager.VMManagementException
Terminates a VM in the system. Ensures that it is not running after the request completes anymore.

Parameters:
vm - the VM to be terminated
Throws:
VMManager.NoSuchVMException - if the request was issued for a VM unknown in the system
VMManager.VMManagementException - if the request cannot be fulfilled for some reason

migrateVM

void migrateVM(VirtualMachine vm,
               E target)
               throws VMManager.NoSuchVMException,
                      VMManager.VMManagementException,
                      NetworkNode.NetworkException
Migrates a VM from the current system to another. The VM is not going to be running during this period. It will not consume resources on the current system anymore

Parameters:
vm - the VM to be relocated
target - the target system that should host the VM in the future
Throws:
VMManager.NoSuchVMException - if the request was issued for a VM unknown in the system
VMManager.VMManagementException - if the request cannot be fulfilled for some reason
NetworkNode.NetworkException

reallocateResources

void reallocateResources(VirtualMachine vm,
                         ResourceConstraints newresources)
                         throws VMManager.NoSuchVMException,
                                VMManager.VMManagementException
Allows fine-grained resource utilization setup of the particular VM after it was allocated on the system. Even during its runtime. Don't forget that in real VMs resource availability changes might cause troubles. Apply it rarely if you are not sure it will also work in the real world!

Parameters:
vm - The VM to be adjusted
newresources - The new amount of resources needed (this could not only raise the available resources of the VM but also decrease them
Throws:
VMManager.NoSuchVMException - if the request was issued for a VM unknown in the system
VMManager.VMManagementException - if the request cannot be fulfilled for some reason

listVMs

Collection<VirtualMachine> listVMs()
Provides an overview on the VMs currently in the system

Returns:
the VMs currently registered with the system (they are either alredy running or will run in the foreseeable future

getCapacities

ResourceConstraints getCapacities()
Allows the query of the total capacities

Returns:
the total computing capacities of this VMManager

subscribeToCapacityChanges

void subscribeToCapacityChanges(VMManager.CapacityChangeEvent<F> e)
manages the subscriptions for capacity change (increase/decrease) events

Parameters:
e - the listener object which expects capacity change events

unsubscribeFromCapacityChanges

void unsubscribeFromCapacityChanges(VMManager.CapacityChangeEvent<F> e)
manages the subscriptions for capacity change (increase/decrease) events

Parameters:
e - the listener object that no longer expects capacity change events


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.