Package com.morpheusdata.core.storage
Interface MorpheusDatastoreTypeService
public interface MorpheusDatastoreTypeService
A service for interacting with associated Datastores
This service routes the action (e.g., createVolume()) to the datastore associated with the volume(s) passed in for the action. Note: It is up to the caller of this service to save the related changes.
-
Method Summary
Modifier and TypeMethodDescriptioncloneVolume(StorageVolume volume, ComputeServer server, StorageVolume sourceVolume) Clones a volume on the associated datastorecloneVolume(StorageVolume volume, ComputeServer server, VirtualImage virtualImage, com.bertramlabs.plugins.karman.CloudFileInterface cloudFile) Clones a volume on the associated datastorecreateSnapshot(ComputeServer server, Boolean forBackup, Boolean forExport) Creates volume snapshots of all volumes associated with a server.createSnapshot(Instance instance, CreateSnapshotRequest req) Creates volume snapshots of all volumes associated with an instance.createVolume(StorageVolume volume, ComputeServer server) Creates a volume on the associated datastorerefreshDatastore(Datastore datastore) Refresh the provider with the associated data in the external system.removeSnapshot(ComputeServer server, Snapshot snapshot) Deletes volume snapshots of all volumes associated with a server.removeSnapshot(Instance instance, Snapshot snapshot) Deletes snapshot associated with an instance.removeVolume(StorageVolume volume, ComputeServer server, boolean removeSnapshots, boolean force) Removes a volume on the associated datastoreresizeVolume(StorageVolume volume, ComputeServer server, boolean isShutdown) Resize a volume on the associated datastorerevertSnapshot(ComputeServer server, Snapshot snapshot) Reverts a server to a snapshot.revertSnapshot(Instance instance, Snapshot snapshot) Reverts an instance to a snapshot.
-
Method Details
-
createVolume
Creates a volume on the associated datastore- Parameters:
volume- The volume to createserver- The server to create the volume on- Returns:
- Created volume
-
removeVolume
ServiceResponse removeVolume(StorageVolume volume, ComputeServer server, boolean removeSnapshots, boolean force) Removes a volume on the associated datastore- Parameters:
volume- The volume to createserver- The server to remove the volume fromremoveSnapshots- whether to remove snapshots associated with the volume. In some implementations this is mandatory and not separate.force- whether to force the removal of the volume. This is typically used to force the removal of a volume that is in use.
-
cloneVolume
ServiceResponse<StorageVolume> cloneVolume(StorageVolume volume, ComputeServer server, StorageVolume sourceVolume) Clones a volume on the associated datastore- Parameters:
volume- The cloned volumeserver- The server the volume is associated withsourceVolume- The source volume to clone from- Returns:
- Cloned volume
-
resizeVolume
ServiceResponse<StorageVolume> resizeVolume(StorageVolume volume, ComputeServer server, boolean isShutdown) Resize a volume on the associated datastore- Parameters:
volume- The volume to resizeserver- The server to clone the volume on- Returns:
- Cloned volume
-
cloneVolume
ServiceResponse<StorageVolume> cloneVolume(StorageVolume volume, ComputeServer server, VirtualImage virtualImage, com.bertramlabs.plugins.karman.CloudFileInterface cloudFile) Clones a volume on the associated datastore- Parameters:
volume- The cloned volumeserver- The server the volume is associated withserver- The server to clone the volume onvirtualImage- the virtual image this volume is being cloned out ofcloudFile- the specific disk file (Karman abstraction) that is being cloned- Returns:
- Cloned volume
-
refreshDatastore
Refresh the provider with the associated data in the external system.- Parameters:
datastore- The Datastore object contains all the saved information regarding configuration of the Datastore.- Returns:
- a
ServiceResponseobject. A ServiceResponse with a success value of 'false' will indicate the refresh process has failed and will change the datastore status to 'error'
-
createSnapshot
ServiceResponse<Snapshot> createSnapshot(ComputeServer server, Boolean forBackup, Boolean forExport) Creates volume snapshots of all volumes associated with a server.- Parameters:
server- the server to create snapshots forforBackup- whether this snapshot is for backup purposesforExport- whether this snapshot is for export purposes (like an image import)- Returns:
- the success state and a copy of the snapshot
-
revertSnapshot
Reverts a server to a snapshot. This is used to revert a server to a previous state. The caller should ensure the server is powered off during this operation and powered back on to desired user state after this operation is complete. NOTE: These snapshots are typically volume based and not vm state based.- Parameters:
server- the server to revert the snapshot onsnapshot- the snapshot to revert to- Returns:
- the success state and a copy of the snapshot
-
removeSnapshot
Deletes volume snapshots of all volumes associated with a server.- Parameters:
server- the server to delete snapshots forsnapshot- the snapshot to delete- Returns:
- the success state
-
createSnapshot
Creates volume snapshots of all volumes associated with an instance. NOTE: A snapshot for a multi workload instance is structured as follows: - Instance snapshot contains the snapshot files of each shared volume among the servers - Instance snapshot is the parent snapshot for each of the server snapshots - Server snapshot contains snapshot files for each of the server volumes.- Parameters:
instance- the instance to create snapshots forreq- the snapshot creation request containing - forBackup whether this snapshot is for backup purposes - forExport whether this snapshot is for export purposes (like an image import)- Returns:
- the success state and a copy of the snapshot
-
revertSnapshot
Reverts an instance to a snapshot. This is used to revert an instance to a previous state. The caller should ensure the instance is powered off during this operation and powered back on to desired user state after this operation is complete.- Parameters:
instance- the instance to revert the snapshot onsnapshot- the snapshot to revert to- Returns:
- the success state and a copy of the snapshot
-
removeSnapshot
Deletes snapshot associated with an instance.- Parameters:
instance- the instance to delete snapshots forsnapshot- the snapshot to delete- Returns:
- the success state
-