Tabnine Logo
SnapshotInfo.getLocationType
Code IndexAdd Tabnine to your IDE (free)

How to use
getLocationType
method
in
org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo

Best Java code snippets using org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo.getLocationType (Showing top 4 results out of 315)

origin: apache/cloudstack

@Override
public void postSnapshotCreation(SnapshotInfo snapshot) {
  updateLocationTypeInDb(snapshot);
  if (snapshot.getLocationType() == Snapshot.LocationType.SECONDARY) {
    // remove the snapshot on primary storage
    try {
      snapshotSvr.deleteSnapshot(snapshot);
    } catch (Exception e) {
      s_logger.warn("Failed to clean up snapshot '" + snapshot.getId() + "' on primary storage: " + e.getMessage());
    }
  }
}
origin: apache/cloudstack

private void verifyLocationType(SnapshotInfo snapshotInfo) {
  VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
  if (snapshotInfo.getLocationType() == Snapshot.LocationType.SECONDARY && volumeInfo.getFormat() != ImageFormat.VHD) {
    throw new CloudRuntimeException("Only the '" + ImageFormat.VHD + "' image type can be used when 'LocationType' is set to 'SECONDARY'.");
  }
}
origin: apache/cloudstack

@Override
public SnapshotInfo backupSnapshot(SnapshotInfo snapshotInfo) {
  Preconditions.checkArgument(snapshotInfo != null, "'snapshotInfo' cannot be 'null'.");
  if (snapshotInfo.getLocationType() != Snapshot.LocationType.SECONDARY) {
    markAsBackedUp((SnapshotObject)snapshotInfo);
    return snapshotInfo;
  }
  // At this point, the snapshot is either taken as a native
  // snapshot on the storage or exists as a volume on the storage (clone).
  // If archive flag is passed in, we should copy this snapshot to secondary
  // storage and delete it from primary storage.
  HostVO host = getHost(snapshotInfo.getVolumeId());
  boolean canStorageSystemCreateVolumeFromSnapshot = canStorageSystemCreateVolumeFromSnapshot(snapshotInfo.getBaseVolume().getPoolId());
  if (!canStorageSystemCreateVolumeFromSnapshot) {
    String msg = "Cannot archive snapshot: 'canStorageSystemCreateVolumeFromSnapshot' was false.";
    s_logger.warn(msg);
    throw new CloudRuntimeException(msg);
  }
  boolean computeClusterSupportsResign = clusterDao.getSupportsResigning(host.getClusterId());
  if (!computeClusterSupportsResign) {
    String msg = "Cannot archive snapshot: 'computeClusterSupportsResign' was false.";
    s_logger.warn(msg);
    throw new CloudRuntimeException(msg);
  }
  return snapshotSvr.backupSnapshot(snapshotInfo);
}
origin: apache/cloudstack

Snapshot.LocationType locationType = snapshotInfo.getLocationType();
org.apache.cloudstack.engine.subsystem.api.storageSnapshotInfogetLocationType

Popular methods of SnapshotInfo

  • getId
  • getBaseVolume
  • getDataStore
  • getHypervisorType
  • getName
  • getTO
  • getVolumeId
  • getAccountId
  • getDataCenterId
  • getParent
  • getSize
  • getUuid
  • getSize,
  • getUuid,
  • addPayload,
  • getChild,
  • getFullBackup,
  • getPath,
  • getPayload,
  • processEvent,
  • delete

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collectors (java.util.stream)
  • JCheckBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now