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

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

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

origin: apache/cloudstack

private void verifySnapshotType(SnapshotInfo snapshotInfo) {
  if (snapshotInfo.getHypervisorType() == HypervisorType.KVM && snapshotInfo.getDataStore().getRole() != DataStoreRole.Primary) {
    throw new CloudRuntimeException("For the KVM hypervisor type, you can only revert a volume to a snapshot state if the snapshot " +
      "resides on primary storage. For other snapshot types, create a volume from the snapshot to recover its data.");
  }
}
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

@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

if (HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType())) {
  computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());
else if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType()) || HypervisorType.KVM.equals(snapshotInfo.getHypervisorType())) {
  computeClusterSupportsVolumeClone = true;
createVolumeFromSnapshot(snapshotInfo);
if (HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType()) || HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
  keepGrantedAccess = HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType());
  if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
    extraDetails = new HashMap<>();
  if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
    String iqn = getSnapshotProperty(snapshotInfo.getId(), DiskTO.IQN);
if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
  String iqn = getSnapshotProperty(snapshotInfo.getId(), DiskTO.IQN);
origin: apache/cloudstack

private HostVO getHost(SnapshotInfo snapshotInfo) {
  HypervisorType hypervisorType = snapshotInfo.getHypervisorType();
  if (HypervisorType.XenServer.equals(hypervisorType)) {
    HostVO hostVO = getHost(snapshotInfo.getDataCenterId(), hypervisorType, true);
    if (hostVO == null) {
      hostVO = getHost(snapshotInfo.getDataCenterId(), hypervisorType, false);
      if (hostVO == null) {
        throw new CloudRuntimeException("Unable to locate an applicable host in data center with ID = " + snapshotInfo.getDataCenterId());
      }
    }
    return hostVO;
  }
  if (HypervisorType.VMware.equals(hypervisorType) || HypervisorType.KVM.equals(hypervisorType)) {
    return getHost(snapshotInfo.getDataCenterId(), hypervisorType, false);
  }
  throw new CloudRuntimeException("Unsupported hypervisor type");
}
origin: apache/cloudstack

boolean computeClusterSupportsVolumeClone = true;
if (HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType())) {
  computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());
volumeInfo = _volumeDataFactory.getVolume(volumeInfo.getId(), volumeInfo.getDataStore());
if (HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType()) || HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
  if (useCloning) {
    Map<String, String> extraDetails = null;
    if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
      extraDetails = new HashMap<>();
    if (HypervisorType.VMware.equals(snapshotInfo.getHypervisorType())) {
      disconnectHostFromVolume(hostVO, volumeInfo.getPoolId(), volumeInfo.get_iScsiName());
    hostVO = getHost(snapshotInfo.getDataCenterId(), snapshotInfo.getHypervisorType(), false);
else if (HypervisorType.KVM.equals(snapshotInfo.getHypervisorType())) {
  VolumeObjectTO newVolume = new VolumeObjectTO();
origin: apache/cloudstack

hostVO = getHost(snapshotInfo.getDataCenterId(), snapshotInfo.getHypervisorType(), false);
if (HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType())) {
  copyCmdAnswer = performCopyOfVdi(volumeInfo, snapshotInfo, hostVO);
origin: apache/cloudstack

private void handleCreateNonManagedVolumeFromManagedSnapshot(SnapshotInfo snapshotInfo, VolumeInfo volumeInfo,
                               AsyncCompletionCallback<CopyCommandResult> callback) {
  if (!HypervisorType.XenServer.equals(snapshotInfo.getHypervisorType())) {
    String errMsg = "Creating a volume on non-managed storage from a snapshot on managed storage is currently only supported with XenServer.";
origin: apache/cloudstack

if (action == StorageAction.TAKESNAPSHOT) {
  SnapshotInfo snapshotInfo = (SnapshotInfo)object;
  if (snapshotInfo.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
    VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();
    VirtualMachine vm = volumeInfo.getAttachedVM();
org.apache.cloudstack.engine.subsystem.api.storageSnapshotInfogetHypervisorType

Popular methods of SnapshotInfo

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

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Option (scala)
  • Top plugins for Android Studio
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