Package com.morpheusdata.core.storage
Interface MorpheusVmeQcow2DatastoreService
public interface MorpheusVmeQcow2DatastoreService
Provides pass-through operations for the
DatastoreTypeProvider
in the event the custom datastore type is simply exposing
a filesystem based mount where qcow2 files can be created. This could be used when a custom datastore type provider wraps something like an NFS Pool.- Since:
- 1.2.5
-
Method Summary
Modifier and TypeMethodDescriptioncloneVolume
(StorageVolume volume, ComputeServer server, StorageVolume sourceVolume) Clones a volume based on a source volume object.cloneVolume
(StorageVolume volume, ComputeServer server, VirtualImage virtualImage, com.bertramlabs.plugins.karman.CloudFileInterface cloudFile) Clones a volume based on a source being the reference to the actual File in the Virtual Image.createVolume
(StorageVolume volume, ComputeServer server) Perform any operations necessary on the target to create a volume.removeVolume
(StorageVolume volume, ComputeServer server, boolean removeSnapshots, boolean force) Perform any operations necessary on the target to remove a volume.resizeVolume
(StorageVolume volume, ComputeServer server, Long newSize) Perform any operations necessary on the target to resize a volume.
-
Method Details
-
removeVolume
ServiceResponse removeVolume(StorageVolume volume, ComputeServer server, boolean removeSnapshots, boolean force) Perform any operations necessary on the target to remove a volume. This is used to remove a volume on a storage server It is typically called as part of server teardown.- Parameters:
volume
- the current volume to removeserver
- the server the volume is being removed from (may contain information such as parentServer (hypervisor) or cluster)removeSnapshots
- 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.- Returns:
- the success state of the removal
-
createVolume
Perform any operations necessary on the target to create a volume. This is used to create a volume on a storage server It is typically called as part of server provisioning.- Parameters:
volume
- the current volume to createserver
- the server the volume is being created on (may contain information such as parentServer (hypervisor) or cluster)- Returns:
- the success state and a copy of the volume
-
cloneVolume
ServiceResponse<StorageVolume> cloneVolume(StorageVolume volume, ComputeServer server, StorageVolume sourceVolume) Clones a volume based on a source volume object. This is one of the most important methods for provisioning as mostVirtualImage
provisioning objects are cloned from a local image cache of source volumes. This is where the QCOW2 may reside Often times you can infer this from the combination of the sourceVolume object as well as its datastoreString sourceVolumePath = sourceVolume.datastore.externalPath + '/' + sourceVolume.externalId //this is the QCOW2 path typically used for clone operations String command = "sudo mkdir -p \"${volume.datastore.externalPath}/${server.externalId ?: server.name}\" ; sudo ionice -c 3 cp -f \"${sourceVolume.datastore.externalPath}/${sourceVolume.externalId}\" \"${volume.datastore.externalPath}/${server.externalId ?: server.name}/${volume.volumeName}\"" morpheusContext.executeCommandOnServer(server, command)
- Parameters:
volume
- the volume we are creating and cloning intoserver
- the server the volume is associated with (typically the workload/vm)sourceVolume
- the source volume we are cloning from- Returns:
- the success state and a copy of the volume
-
cloneVolume
ServiceResponse<StorageVolume> cloneVolume(StorageVolume volume, ComputeServer server, VirtualImage virtualImage, com.bertramlabs.plugins.karman.CloudFileInterface cloudFile) Clones a volume based on a source being the reference to the actual File in the Virtual Image. This can be called in the event there is no image cache or we need to directly stream to an image target. Remember, this code runs in the manager or morpheus appliance and not on the host itself. In order to stream contents directly to the target , we need to create a link we can fetch using theMorpheusFileCopyService
- Parameters:
volume
- the volume we are creating and cloning intoserver
- the server the volume is associated with (typically the workload/vm)virtualImage
- the virtual image this volume is being cloned out ofcloudFile
- the specific disk file (Karman abstraction) that is being cloned- Returns:
- the success state and a copy of the volume
- See Also:
-
resizeVolume
ServiceResponse<StorageVolume> resizeVolume(StorageVolume volume, ComputeServer server, Long newSize) Perform any operations necessary on the target to resize a volume. This is used to resize a volume on a storage server- Parameters:
volume
- the current volume to resizeserver
- the server the volume is being resized on (may contain information such as parentServer (hypervisor) or cluster)newSize
- the new size of the volume... TODO: this exists on the volume record already, is newSize needed?- Returns:
- the success state and a copy of the volume
-