Package com.morpheusdata.core
Class AbstractProvisionProvider
- java.lang.Object
-
- com.morpheusdata.core.AbstractProvisionProvider
-
- All Implemented Interfaces:
PluginProvider
,ProvisioningProvider
public abstract class AbstractProvisionProvider extends java.lang.Object implements ProvisioningProvider
-
-
Constructor Summary
Constructors Constructor Description AbstractProvisionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
canAddVolumes()
Indicates if volumes may be added during provisioningjava.lang.Boolean
canCustomizeDataVolumes()
Indicates if data volumes may be customized during provisioning.java.lang.Boolean
canCustomizeRootVolume()
Indicates if the root volume may be customized during provisioning.java.lang.Boolean
canReconfigureNetwork()
Indicates if the network can be changedjava.lang.Boolean
canResizeRootVolume()
Indicates if the root volume may be resizedjava.lang.Boolean
computeZonePoolRequired()
Indicates if a ComputeZonePool is required during provisioningjava.lang.Boolean
disableRootDatastore()
Indicates if a Datastore on a root volume on a ComputeServer is configurableServiceResponse
finalizeHost(ComputeServer server)
This method is called after successful completion of runHost and successful completion of waitForHost and provides an opportunity to perform some final actions during the provisioning process.ServiceResponse
finalizeWorkload(Workload workload)
This method is called after successful completion of runWorkload and provides an opportunity to perform some final actions during the provisioning process.ComputeServerType
findVmNodeServerTypeForCloud(java.lang.Long cloudId, java.lang.String platform, java.lang.String provisionTypeCode)
java.util.Collection<StorageVolumeType>
getDataVolumeStorageTypes()
Provides a Collection of StorageVolumeTypes that are available for data StorageVolumesStorageVolume
getRootDisk(Workload workload)
java.lang.Long
getRootSize(Workload workload)
java.util.Collection<StorageVolumeType>
getRootVolumeStorageTypes()
Provides a Collection of StorageVolumeTypes that are available for root StorageVolumesjava.lang.Boolean
hasComputeZonePools()
Determines if this provision type has ComputeZonePools that can be selected or not.java.lang.Boolean
hasConfigurableSockets()
Indicates if the sockets are configurable when deploying a ComputeServer via a custom planjava.lang.Boolean
hasStorageControllers()
Indicates if StorageControllers are utilizedjava.lang.Boolean
networksScopedToPools()
Indicates if Network selection should be scoped to the ComputeZonePool selected during provisioningServiceResponse
prepareHost(ComputeServer server, HostRequest hostRequest, java.util.Map opts)
This method is called before runHost and provides an opportunity to perform action or obtain configuration that will be needed in runHost.ServiceResponse
prepareWorkload(Workload workload, WorkloadRequest workloadRequest, java.util.Map opts)
This method is called before runWorkload and provides an opportunity to perform action or obtain configuration that will be needed in runWorkload.ServiceResponse<HostResponse>
runHost(ComputeServer server, HostRequest hostRequest, java.util.Map opts)
This method is called to provision a Host (i.e.java.lang.Boolean
supportsAutoDatastore()
Indicates if automatic Datastore selection is supportedServiceResponse<HostResponse>
waitForHost(ComputeServer server)
This method is called after runHost returns successfully and provides implementations a mechanism to wait for the ComputeServer to finish the creation process in the underlying Cloud.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.morpheusdata.core.PluginProvider
getCode, getMorpheus, getName, getPlugin, isPlugin
-
Methods inherited from interface com.morpheusdata.core.ProvisioningProvider
createWorkloadResources, getComputeServerInterfaceTypes, getComputeTypeLayouts, getHostType, getMaxNetworks, getNodeOptionTypes, getOptionTypes, getServerDetails, getServicePlans, getVirtualImages, hasDatastores, hasNetworks, hasPlanTagMatch, removeWorkload, resizeServer, resizeWorkload, restartWorkload, runWorkload, startServer, startWorkload, stopServer, stopWorkload, validateDockerHost, validateInstance, validateWorkload
-
-
-
-
Method Detail
-
hasComputeZonePools
public java.lang.Boolean hasComputeZonePools()
Description copied from interface:ProvisioningProvider
Determines if this provision type has ComputeZonePools that can be selected or not.- Specified by:
hasComputeZonePools
in interfaceProvisioningProvider
- Returns:
- Boolean representation of whether or not this provision type has ComputeZonePools
-
canAddVolumes
public java.lang.Boolean canAddVolumes()
Description copied from interface:ProvisioningProvider
Indicates if volumes may be added during provisioning- Specified by:
canAddVolumes
in interfaceProvisioningProvider
- Returns:
- Boolean
-
canCustomizeRootVolume
public java.lang.Boolean canCustomizeRootVolume()
Description copied from interface:ProvisioningProvider
Indicates if the root volume may be customized during provisioning. For example, the size changed- Specified by:
canCustomizeRootVolume
in interfaceProvisioningProvider
- Returns:
- Boolean
-
canCustomizeDataVolumes
public java.lang.Boolean canCustomizeDataVolumes()
Description copied from interface:ProvisioningProvider
Indicates if data volumes may be customized during provisioning. For example, the size changed- Specified by:
canCustomizeDataVolumes
in interfaceProvisioningProvider
- Returns:
- Boolean
-
canResizeRootVolume
public java.lang.Boolean canResizeRootVolume()
Description copied from interface:ProvisioningProvider
Indicates if the root volume may be resized- Specified by:
canResizeRootVolume
in interfaceProvisioningProvider
- Returns:
- Boolean
-
canReconfigureNetwork
public java.lang.Boolean canReconfigureNetwork()
Description copied from interface:ProvisioningProvider
Indicates if the network can be changed- Specified by:
canReconfigureNetwork
in interfaceProvisioningProvider
- Returns:
- Boolean
-
hasStorageControllers
public java.lang.Boolean hasStorageControllers()
Description copied from interface:ProvisioningProvider
Indicates if StorageControllers are utilized- Specified by:
hasStorageControllers
in interfaceProvisioningProvider
- Returns:
- Boolean
-
supportsAutoDatastore
public java.lang.Boolean supportsAutoDatastore()
Description copied from interface:ProvisioningProvider
Indicates if automatic Datastore selection is supported- Specified by:
supportsAutoDatastore
in interfaceProvisioningProvider
- Returns:
- Boolean
-
networksScopedToPools
public java.lang.Boolean networksScopedToPools()
Description copied from interface:ProvisioningProvider
Indicates if Network selection should be scoped to the ComputeZonePool selected during provisioning- Specified by:
networksScopedToPools
in interfaceProvisioningProvider
- Returns:
- Boolean
-
disableRootDatastore
public java.lang.Boolean disableRootDatastore()
Description copied from interface:ProvisioningProvider
Indicates if a Datastore on a root volume on a ComputeServer is configurable- Specified by:
disableRootDatastore
in interfaceProvisioningProvider
- Returns:
- Boolean
-
hasConfigurableSockets
public java.lang.Boolean hasConfigurableSockets()
Description copied from interface:ProvisioningProvider
Indicates if the sockets are configurable when deploying a ComputeServer via a custom plan- Specified by:
hasConfigurableSockets
in interfaceProvisioningProvider
- Returns:
- Boolean
-
getRootVolumeStorageTypes
public java.util.Collection<StorageVolumeType> getRootVolumeStorageTypes()
Description copied from interface:ProvisioningProvider
Provides a Collection of StorageVolumeTypes that are available for root StorageVolumes- Specified by:
getRootVolumeStorageTypes
in interfaceProvisioningProvider
- Returns:
- Collection of StorageVolumeTypes
-
getDataVolumeStorageTypes
public java.util.Collection<StorageVolumeType> getDataVolumeStorageTypes()
Description copied from interface:ProvisioningProvider
Provides a Collection of StorageVolumeTypes that are available for data StorageVolumes- Specified by:
getDataVolumeStorageTypes
in interfaceProvisioningProvider
- Returns:
- Collection of StorageVolumeTypes
-
computeZonePoolRequired
public java.lang.Boolean computeZonePoolRequired()
Description copied from interface:ProvisioningProvider
Indicates if a ComputeZonePool is required during provisioning- Specified by:
computeZonePoolRequired
in interfaceProvisioningProvider
- Returns:
- Boolean
-
prepareWorkload
public ServiceResponse prepareWorkload(Workload workload, WorkloadRequest workloadRequest, java.util.Map opts)
Description copied from interface:ProvisioningProvider
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.- Specified by:
prepareWorkload
in interfaceProvisioningProvider
- 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
-
prepareHost
public ServiceResponse prepareHost(ComputeServer server, HostRequest hostRequest, java.util.Map opts)
Description copied from interface:ProvisioningProvider
This method is called before runHost and provides an opportunity to perform action or obtain configuration that will be needed in runHost. At the end of this method, if deploying a ComputeServer with a VirtualImage, the sourceImage on ComputeServer should be determined and saved.- Specified by:
prepareHost
in interfaceProvisioningProvider
- Parameters:
server
- the ComputeServer object we intend to provision along with some of the associated data needed to determine how best to provision the serverhostRequest
- the HostRequest object containing the various configurations that may be needed in running the server. This will be passed along into runHostopts
- additional configuration options that may have been passed during provisioning- Returns:
- Response from API
-
runHost
public ServiceResponse<HostResponse> runHost(ComputeServer server, HostRequest hostRequest, java.util.Map opts)
Description copied from interface:ProvisioningProvider
This method is called to provision a Host (i.e. Docker host). Information associated with the passed ComputeServer object is used to kick off the provision request. Implementations of this method should populate HostResponse as complete as possible and as quickly as possible. Implementations may choose to save the externalId on the ComputeServer or pass it back in HostResponse.- Specified by:
runHost
in interfaceProvisioningProvider
- Parameters:
server
- the ComputeServer object we intend to provision along with some of the associated data needed to determine how best to provision the serverhostRequest
- the HostRequest object containing the various configurations that may be needed in running the server.opts
- additional configuration options that may have been passed during provisioning- Returns:
- Response from API
-
waitForHost
public ServiceResponse<HostResponse> waitForHost(ComputeServer server)
Description copied from interface:ProvisioningProvider
This method is called after runHost returns successfully and provides implementations a mechanism to wait for the ComputeServer to finish the creation process in the underlying Cloud. HostResponse should be filled out as complete as possible.- Specified by:
waitForHost
in interfaceProvisioningProvider
- Parameters:
server
- the ComputeServer object to wait for- Returns:
-
finalizeHost
public ServiceResponse finalizeHost(ComputeServer server)
Description copied from interface:ProvisioningProvider
This method is called after successful completion of runHost and successful completion of waitForHost and provides an opportunity to perform some final actions during the provisioning process. For example, ejected CDs, cleanup actions, etc- Specified by:
finalizeHost
in interfaceProvisioningProvider
- Parameters:
server
- the ComputeServer object that has been provisioned- Returns:
- Response from the API
-
finalizeWorkload
public ServiceResponse finalizeWorkload(Workload workload)
Description copied from interface:ProvisioningProvider
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- Specified by:
finalizeWorkload
in interfaceProvisioningProvider
- Parameters:
workload
- the Workload object that has been provisioned- Returns:
- Response from the API
-
findVmNodeServerTypeForCloud
public ComputeServerType findVmNodeServerTypeForCloud(java.lang.Long cloudId, java.lang.String platform, java.lang.String provisionTypeCode)
-
getRootSize
public java.lang.Long getRootSize(Workload workload)
-
getRootDisk
public StorageVolume getRootDisk(Workload workload)
-
-