Package com.morpheusdata.core.providers
Interface WorkloadProvisionProvider
- All Superinterfaces:
ComputeProvisionProvider
,PluginProvider
,ProvisionProvider
- All Known Subinterfaces:
VmProvisionProvider
Provides methods for interacting with the provisioning engine of Morpheus. This is akin to dealing with requests made
from "Add Instance" or from Application Blueprints
- Since:
- 0.15.3
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
Allows the workload to be resizedNested classes/interfaces inherited from interface com.morpheusdata.core.providers.ComputeProvisionProvider
ComputeProvisionProvider.MoveFacet
Nested classes/interfaces inherited from interface com.morpheusdata.core.providers.ProvisionProvider
ProvisionProvider.BlockDeviceNameFacet, ProvisionProvider.HypervisorConsoleFacet, ProvisionProvider.HypervisorProvisionFacet, ProvisionProvider.IacResourceFacet, ProvisionProvider.SnapshotFacet
-
Method Summary
Modifier and TypeMethodDescriptioncreateWorkloadResources
(Workload workload, Map opts) Method called before runWorkload to allow implementers to create resources required before runWorkload is calledfinalizeWorkload
(Workload workload) This method is called after successful completion of runWorkload and provides an opportunity to perform some final actions during the provisioning process.getServerDetails
(ComputeServer server) Method called after a successful call to runWorkload to obtain the details of the ComputeServer.default ServiceResponse<PrepareWorkloadResponse>
prepareWorkload
(Workload workload, WorkloadRequest workloadRequest, Map opts) This method is called before runWorkload and provides an opportunity to perform action or obtain configuration that will be needed in runWorkload.removeWorkload
(Workload workload, Map opts) This is the key method called to destroy / remove a workload.restartWorkload
(Workload workload) Issues the remote calls to restart a workload element.runWorkload
(Workload workload, WorkloadRequest workloadRequest, Map opts) This method is a key entry point in provisioning a workload.startWorkload
(Workload workload) Issues the remote calls necessary to start a workload element for running.stopWorkload
(Workload workload) Issues the remote calls necessary top stop a workload element from running.default ServiceResponse
updateMetadataTags
(ComputeServer server, Map opts) This is the method called when a server's metadata tags are updated in Morpheus.validateWorkload
(Map opts) Validates the provided provisioning options of a workload.Methods inherited from interface com.morpheusdata.core.providers.ComputeProvisionProvider
startServer, stopServer
Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getMorpheus, getName, getPlugin, isPlugin
Methods inherited from interface com.morpheusdata.core.providers.ProvisionProvider
aclEnabled, canAddVolumes, canCustomizeDataVolumes, canCustomizeRootVolume, canReconfigureNetwork, canResizeRootVolume, cloneToTemplate, computeZonePoolRequired, createDefaultInstanceType, customSupported, disableRootDatastore, getCircularIcon, getComputeServerInterfaceTypes, getComputeTypeLayouts, getDataVolumeStorageTypes, getDefaultInstanceTypeDescription, getDefaultInstanceTypeOptions, getDeployTargetService, getHostDiskMode, getHostType, getMaxNetworks, getNodeFormat, getNodeOptionTypes, getOptionTypes, getProvisionTypeCode, getRootVolumeStorageTypes, getServicePlans, getTemplateParameters, getViewSet, getVirtualImages, getVirtualImageTypes, hasCloneTemplate, hasComputeZonePools, hasConfigurableSockets, hasDatastores, hasNetworks, hasNodeTypes, hasPlanTagMatch, hasSecurityGroups, hasStorageControllers, lvmSupported, multiTenant, networksScopedToPools, requiresVirtualImage, serverType, supportsAgent, supportsAutoDatastore, supportsCustomServicePlans
-
Method Details
-
validateWorkload
Validates the provided provisioning options of a workload. A return of success = false will halt the creation and display errors- Parameters:
opts
- options- Returns:
- Response from API. Errors should be returned in the errors Map with the key being the field name and the error message as the value.
-
prepareWorkload
default ServiceResponse<PrepareWorkloadResponse> prepareWorkload(Workload workload, WorkloadRequest workloadRequest, Map opts) This method is called before runWorkload and provides an opportunity to perform action or obtain configuration that will be needed in runWorkload. At the end of this method, if deploying a ComputeServer with a VirtualImage, the sourceImage on ComputeServer should be determined and saved.- Parameters:
workload
- the Workload object we intend to provision along with some of the associated data needed to determine how best to provision the workloadworkloadRequest
- the RunWorkloadRequest object containing the various configurations that may be needed in running the Workload. This will be passed along into runWorkloadopts
- additional configuration options that may have been passed during provisioning- Returns:
- Response from API
-
runWorkload
ServiceResponse<ProvisionResponse> runWorkload(Workload workload, WorkloadRequest workloadRequest, Map opts) This method is a key entry point in provisioning a workload. This could be a vm, a container, or something else. Information associated with the passed Workload object is used to kick off the workload provision request- Parameters:
workload
- the Workload object we intend to provision along with some of the associated data needed to determine how best to provision the workloadworkloadRequest
- the RunWorkloadRequest object containing the various configurations that may be needed in running the Workloadopts
- additional configuration options that may have been passed during provisioning- Returns:
- Response from API
-
finalizeWorkload
This method is called after successful completion of runWorkload and provides an opportunity to perform some final actions during the provisioning process. For example, ejected CDs, cleanup actions, etc- Parameters:
workload
- the Workload object that has been provisioned- Returns:
- Response from the API
-
stopWorkload
Issues the remote calls necessary top stop a workload element from running.- Parameters:
workload
- the Workload we want to shut down- Returns:
- Response from API
-
startWorkload
Issues the remote calls necessary to start a workload element for running.- Parameters:
workload
- the Workload we want to start up.- Returns:
- Response from API
-
restartWorkload
Issues the remote calls to restart a workload element. In some cases this is just a simple alias call to do a stop/start, however, in some cases cloud providers provide a direct restart call which may be preferred for speed.- Parameters:
workload
- the Workload we want to restart.- Returns:
- Response from API
-
removeWorkload
This is the key method called to destroy / remove a workload. This should make the remote calls necessary to remove any assets associated with the workload.- Parameters:
workload
- to removeopts
- map of options- Returns:
- Response from API
-
getServerDetails
Method called after a successful call to runWorkload to obtain the details of the ComputeServer. Implementations should not return until the server is successfully created in the underlying cloud or the server fails to create.- Parameters:
server
- to check status- Returns:
- Response from API. The publicIp and privateIp set on the WorkloadResponse will be utilized to update the ComputeServer
-
updateMetadataTags
This is the method called when a server's metadata tags are updated in Morpheus. Should return success if tags are updated and fail if tags are not/can't be updated.- Parameters:
server
- server object with updated metadata fieldopts
- map of options- Returns:
- Response from API
-
createWorkloadResources
Method called before runWorkload to allow implementers to create resources required before runWorkload is called- Parameters:
workload
- that will be provisionedopts
- additional options- Returns:
- Response from API
-