Interface MorpheusSynchronousProvisionService
public interface MorpheusSynchronousProvisionService
-
Method Summary
Modifier and TypeMethodDescriptionbuildCloudConfigOptions(Cloud cloud, ComputeServer server, Boolean installAgent, Map<String, Object> opts) Generates Cloud Configuration Options for Passing into User-Data Generation or Unattend Generation Depending on PlatformbuildCloudMetaData(PlatformType platform, Long instanceId, String hostname, Map<String, Object> cloudConfigOptions) Builds the cloud metadatabuildCloudNetworkData(PlatformType platform, Map<String, Object> cloudConfigOptions) Builds the cloud network databuildCloudUserData(PlatformType platform, UsersConfiguration usersConfiguration, Map<String, Object> cloudConfigOptions) Builds the userdata typically passed to cloud-initbyte[]buildIsoOutputStream(Boolean isSysPrep, PlatformType platform, String metaData, String userData, String networkData) Builds up the data for an iso image based on the given parametersgetUserConfig(Workload workload, VirtualImage virtualImage, Map<String, Object> opts) Generates a UsersConfiguration given workload and virtual imagevoidsetProvisionFailed(ComputeServer server, Workload workload) Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation.voidsetProvisionFailed(ComputeServer server, Workload workload, String errorMessage) Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation.voidsetProvisionFailed(ComputeServer server, Workload workload, String errorMessage, Map opts) Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation.
-
Method Details
-
setProvisionFailed
Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation. The instance status will also be set to Failed- Parameters:
server- The Server object we want to set to failed.workload- the Workload object we want to set to failed.
-
setProvisionFailed
Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation. The instance status will also be set to Failed. Setting the errorMessage is helpful in telling the user why their provision request did fail- Parameters:
server- The Server object we want to set to failed.workload- the Workload object we want to set to failed.errorMessage- The descriptive error message as to why provisioning failed.
-
setProvisionFailed
Sets the Provisioning state of a Workload and Server to Failed This can be called in an error scenario during a provision operation. The instance status will also be set to Failed. Setting the errorMessage is helpful in telling the user why their provision request did fail- Parameters:
server- The Server object we want to set to failed.workload- the Workload object we want to set to failed.errorMessage- The descriptive error message as to why provisioning failed.opts- Any additional options to be sent back to the callback container service for error handling
-
getUserConfig
UsersConfiguration getUserConfig(Workload workload, VirtualImage virtualImage, Map<String, Object> opts) Generates a UsersConfiguration given workload and virtual image- Parameters:
workload- the Workload object we are working withvirtualImage- the virtual image from which user data will be generated fromopts- additional options like fqdn, or hostname data- Returns:
- UsersConfiguration generated
-
buildCloudConfigOptions
Map<String,Object> buildCloudConfigOptions(Cloud cloud, ComputeServer server, Boolean installAgent, Map<String, Object> opts) Generates Cloud Configuration Options for Passing into User-Data Generation or Unattend Generation Depending on Platform- Parameters:
cloud- the current Cloud the server is being provisioned intoserver- the server instance being provisionedinstallAgent- flag to determine if agent is being installed over cloud-init/unattend or notopts- additional options like fqdn, domainName, virtualImage, hostname data. These will be returned in the Map- Returns:
- Map of cloud configuration options
-
buildCloudUserData
String buildCloudUserData(PlatformType platform, UsersConfiguration usersConfiguration, Map<String, Object> cloudConfigOptions) Builds the userdata typically passed to cloud-init- Parameters:
platform- the platform being provisionedusersConfiguration- typically the UsersConfigurations from buildWorkloadUsersConfigcloudConfigOptions- typically the return of buildCloudConfigOptions or buildCloudNetworkConfig- Returns:
- String userdata
-
buildCloudMetaData
String buildCloudMetaData(PlatformType platform, Long instanceId, String hostname, Map<String, Object> cloudConfigOptions) Builds the cloud metadata- Parameters:
platform- the platform being provisionedinstanceId- the ID of the Instancehostname- the hostnamecloudConfigOptions- typically the return of buildCloudConfigOptions or buildCloudNetworkConfig- Returns:
- String cloud metadata
-
buildCloudNetworkData
Builds the cloud network data- Parameters:
platform- the platform being provisionedcloudConfigOptions- typically the return of buildCloudConfigOptions or buildCloudNetworkConfig- Returns:
- String cloud networkdata
-
buildIsoOutputStream
byte[] buildIsoOutputStream(Boolean isSysPrep, PlatformType platform, String metaData, String userData, String networkData) Builds up the data for an iso image based on the given parameters- Parameters:
isSysPrep- indicates if the iso is for a sysprep imageplatform- the platform (should be windows or linux)metaData- the metadata to embed in the isouserData- the userdata to embed in the isonetworkData- the networkdata to embed in the iso (optional)- Returns:
- a byte array for the iso
-