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 Details

    • createVolume

      ServiceResponse<StorageVolume> createVolume(StorageVolume volume, ComputeServer server)
      Creates a volume on the associated datastore
      Parameters:
      volume - The volume to create
      server - 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 create
      server - The server to remove the volume from
      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.
    • cloneVolume

      ServiceResponse<StorageVolume> cloneVolume(StorageVolume volume, ComputeServer server, StorageVolume sourceVolume)
      Clones a volume on the associated datastore
      Parameters:
      volume - The cloned volume
      server - The server the volume is associated with
      sourceVolume - 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 resize
      server - 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 volume
      server - The server the volume is associated with
      server - The server to clone the volume on
      virtualImage - the virtual image this volume is being cloned out of
      cloudFile - the specific disk file (Karman abstraction) that is being cloned
      Returns:
      Cloned volume
    • refreshDatastore

      ServiceResponse<Datastore> refreshDatastore(Datastore datastore)
      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 ServiceResponse object. 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 for
      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

      ServiceResponse<Snapshot> revertSnapshot(ComputeServer server, Snapshot snapshot)
      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 on
      snapshot - the snapshot to revert to
      Returns:
      the success state and a copy of the snapshot
    • removeSnapshot

      ServiceResponse removeSnapshot(ComputeServer server, Snapshot snapshot)
      Deletes volume snapshots of all volumes associated with a server.
      Parameters:
      server - the server to delete snapshots for
      snapshot - the snapshot to delete
      Returns:
      the success state
    • createSnapshot

      ServiceResponse<Snapshot> createSnapshot(Instance instance, CreateSnapshotRequest req)
      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 for
      req - 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

      ServiceResponse<Snapshot> revertSnapshot(Instance instance, Snapshot snapshot)
      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 on
      snapshot - the snapshot to revert to
      Returns:
      the success state and a copy of the snapshot
    • removeSnapshot

      ServiceResponse removeSnapshot(Instance instance, Snapshot snapshot)
      Deletes snapshot associated with an instance.
      Parameters:
      instance - the instance to delete snapshots for
      snapshot - the snapshot to delete
      Returns:
      the success state