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

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

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

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

private boolean isForVMware(DataObject dataObj) {
  if (dataObj instanceof VolumeInfo) {
    return ImageFormat.OVA.equals(((VolumeInfo)dataObj).getFormat());
  }
  if (dataObj instanceof SnapshotInfo) {
    return ImageFormat.OVA.equals(((SnapshotInfo)dataObj).getBaseVolume().getFormat());
  }
  return dataObj instanceof TemplateInfo && HypervisorType.VMware.equals(((TemplateInfo)dataObj).getHypervisorType());
}
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

public SnapshotObjectTO(SnapshotInfo snapshot) {
  this.path = snapshot.getPath();
  this.setId(snapshot.getId());
  VolumeInfo vol = snapshot.getBaseVolume();
  if (vol != null) {
    this.volume = (VolumeObjectTO)vol.getTO();
    this.setVmName(vol.getAttachedVmName());
  }
  SnapshotInfo parentSnapshot = snapshot.getParent();
  ArrayList<String> parentsArry = new ArrayList<String>();
  if (parentSnapshot != null) {
    this.parentSnapshotPath = parentSnapshot.getPath();
    while(parentSnapshot != null) {
      parentsArry.add(parentSnapshot.getPath());
      parentSnapshot = parentSnapshot.getParent();
    }
    parents =  parentsArry.toArray(new String[parentsArry.size()]);
    ArrayUtils.reverse(parents);
  }
  this.dataStore = snapshot.getDataStore().getTO();
  this.setName(snapshot.getName());
  this.hypervisorType = snapshot.getHypervisorType();
  this.quiescevm = false;
}
origin: apache/cloudstack

CreateSnapshotContext<CommandResult> context = new CreateSnapshotContext<CommandResult>(null, snap.getBaseVolume(), snapshotOnPrimary, future);
AsyncCallbackDispatcher<SnapshotServiceImpl, CreateCmdResult> caller = AsyncCallbackDispatcher.create(this);
caller.setCallback(caller.getTarget().createSnapshotAsyncCallback(null, null)).setContext(context);
origin: apache/cloudstack

@Override
public EndPoint select(DataObject srcData, DataObject destData, StorageAction action) {
  s_logger.error("IR24 select BACKUPSNAPSHOT from primary to secondary " + srcData.getId() + " dest=" + destData.getId());
  if (action == StorageAction.BACKUPSNAPSHOT && srcData.getDataStore().getRole() == DataStoreRole.Primary) {
    SnapshotInfo srcSnapshot = (SnapshotInfo)srcData;
    VolumeInfo volumeInfo = srcSnapshot.getBaseVolume();
    VirtualMachine vm = volumeInfo.getAttachedVM();
    if (srcSnapshot.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
      if (vm != null && vm.getState() == VirtualMachine.State.Running) {
        return getEndPointFromHostId(vm.getHostId());
      }
    }
    if (srcSnapshot.getHypervisorType() == Hypervisor.HypervisorType.VMware) {
      if (vm != null) {
        Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
        if (hostId != null) {
          return getEndPointFromHostId(hostId);
        }
      }
    }
  }
  return select(srcData, destData);
}
origin: apache/cloudstack

@Override
public void revertSnapshot(SnapshotInfo snapshot, SnapshotInfo snapshot2, AsyncCompletionCallback<CommandResult> callback) {
  VolumeInfo volumeInfo = snapshot.getBaseVolume();
  VolumeVO volumeVO = volumeDao.findById(volumeInfo.getId());
  if (volumeVO == null || volumeVO.getRemoved() != null) {
    String errMsg = "The volume that the snapshot belongs to no longer exists.";
    CommandResult commandResult = new CommandResult();
    commandResult.setResult(errMsg);
    callback.complete(commandResult);
    return;
  }
  SolidFireUtil.SolidFireConnection sfConnection = SolidFireUtil.getSolidFireConnection(volumeVO.getPoolId(), storagePoolDetailsDao);
  long sfVolumeId = Long.parseLong(volumeInfo.getFolder());
  SnapshotDetailsVO snapshotDetails = snapshotDetailsDao.findDetail(snapshot.getId(), SolidFireUtil.SNAPSHOT_ID);
  long sfSnapshotId = Long.parseLong(snapshotDetails.getValue());
  SolidFireUtil.rollBackVolumeToSnapshot(sfConnection, sfVolumeId, sfSnapshotId);
  SolidFireUtil.SolidFireVolume sfVolume = SolidFireUtil.getVolume(sfConnection, sfVolumeId);
  updateVolumeDetails(volumeVO.getId(), sfVolume.getTotalSize(), sfVolume.getScsiNaaDeviceId());
  CommandResult commandResult = new CommandResult();
  callback.complete(commandResult);
}
origin: apache/cloudstack

@Override
public boolean revertSnapshot(SnapshotInfo snapshotInfo) {
  VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
origin: apache/cloudstack

VolumeInfo volumeInfo = snapshot.getBaseVolume();
StoragePool store = (StoragePool)volumeInfo.getDataStore();
origin: apache/cloudstack

VolumeInfo volumeInfo = snapshot.getBaseVolume();
volumeInfo.stateTransit(Volume.Event.SnapshotRequested);
SnapshotResult result = null;
origin: apache/cloudstack

VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
VolumeVO volumeVO = volumeDao.findById(volumeInfo.getId());
origin: apache/cloudstack

SnapshotInfo snapshotInfo = (SnapshotInfo)object;
if (snapshotInfo.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
  VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
  VirtualMachine vm = volumeInfo.getAttachedVM();
  if ((vm != null) && (vm.getState() == VirtualMachine.State.Running)) {
origin: apache/cloudstack

SnapshotDataStoreVO parentSnapshotOnBackupStore = snapshotStoreDao.findLatestSnapshotForVolume(snapshot.getVolumeId(), DataStoreRole.Image);
SnapshotDataStoreVO parentSnapshotOnPrimaryStore = snapshotStoreDao.findLatestSnapshotForVolume(snapshot.getVolumeId(), DataStoreRole.Primary);
HypervisorType hypervisorType = snapshot.getBaseVolume().getHypervisorType();
if (parentSnapshotOnPrimaryStore != null && parentSnapshotOnBackupStore != null && hypervisorType == Hypervisor.HypervisorType.XenServer) { // CS does incremental backup only for XenServer
origin: apache/cloudstack

@Override
@DB
public SnapshotInfo takeSnapshot(SnapshotInfo snapshotInfo) {
  VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
org.apache.cloudstack.engine.subsystem.api.storageSnapshotInfogetBaseVolume

Popular methods of SnapshotInfo

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top Vim 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