Skip to main content

Machiner

The Machiner handles creation and deletion of virtual machines in the vSphere environment from already deployed templates by the Templater.

Endpoints​

The Machiner has two gRPC endpoints:

create​

During the virtual machine creation phase, if there are links assigned to the VM then network devices are added to the VM and assigned to the given networks.

message DeployVirtualMachine {
VirtualMachine virtualMachine = 1;
MetaInfo metaInfo = 2;
}

For reference, the VirtualMachine, Configuration, MetaInfo messages are defined as follows:

message Configuration {
uint32 cpu = 1;
uint64 ram = 2;
}

message VirtualMachine {
string name = 1;
Configuration configuration = 2;
string templateId = 3;
repeated string links = 4;
}

message MetaInfo {
string exerciseName = 1;
string deploymentName = 2;
}

delete​

The virtual machine is deleted from the vSphere environment.

Request​

message Identifier {
string value = 1;
}

Successful Response​

message Empty {}

Configuration​

The following configuration options are available for the Machiner handler:

VariableMandatoryTypeRules
useryesstringvCenter username
passwordyesstringvCenter password
hostnameyesstringAddress of the vCenter environment
insecureyesboolEnables or disables certificate verification for the vSphere client
template_folder_pathyesstringThe storage folder for templates
resource_pool_pathyesstringThe resource pool to be used
exercise_root_pathyesstringThe VM folder root path for exercises under which VMs are created
server_addressyesstringThe handlers own address and port

Example configuration file:

user: vsphere_username
password: vsphere_password
hostname: my-vsphere.net
insecure: true
template_folder_path: /Datacenter/vm/Templates/*
resource_pool_path: /Datacenter/host/Cluster/Resources/Handlers
exercise_root_path: /Datacenter/vm/Exercises
server_address: 0.0.0.0:7777