Virtual Machine Providers

Cloudmesh is based on the concept of providers that make it possible to develop API interfaces for different services independently while inheriting the functionality form a common abstract class.

Let us demonstrate the concept of abstract providers for compute providers. We assume that the source directories are stored in ~/cm. We have the following structure:



Here the ABC class determines which methods must be implemented by the main cloud provider. This provider then detects the activity to the cloud provider that is determined by the internal cloudmesh cloud variable. To simplify authentication, the credentials can be stored in the cloudmesh.yaml file.

Example: The yaml file ~/.cloudmesh/cludmesh.yaml contains the entry:

  compute: # currently called cloud
        name: maycloud
        kind: aws
        size: ...
        image: ...

Now when we call:

provider = cloudmesh.compute.Provider(service="mycloud")

The Provider will load in the provider from the AWS directory, as the cm.kind is specified as aws. Thus the main provider delegates the tasks to interface with the particular cloud type via the definitions coming from the cloudmesh YAML file. This makes it possible to easily create multiple interfaces to different cloud service providers while managing a uniform interface via the ABC class. All providers in this hierarchy must inherit from the ABC class.

Deatils of a virtual machine provider ~~~~~~~~~~~~~~~—————~~~~~~~

Here we list in more details how a virtual machine provider can look like:


    cloudmesh-compute/  #curertly named cloudmes-cloud



In this case, we have includes in the compute provider imports for the providers defined in their own repositories. As we use the shared namespace they can be accessed from the main provider easily. This allows us to simply add the provider with a simple pip install:

cd ~/cm/cloudmesh-compute/
pip install .
cd ~/cm/cloudmesh-aws/
pip install .
cd ~/cm/cloudmesh-azure/
pip install .

Now the aws and azure providers are accessible in cloudmesh and if a command is provided they can be accessed from there.