StoragePool.getPodId
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.cloud.storage.StoragePool.getPodId(Showing top 14 results out of 315)

origin: apache/cloudstack

  private void sendModifyStoragePoolCommand(ModifyStoragePoolCommand cmd, StoragePool storagePool, long hostId) {
    Answer answer = _agentMgr.easySend(hostId, cmd);

    if (answer == null) {
      throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command (" + storagePool.getId() + ")");
    }

    if (!answer.getResult()) {
      String msg = "Unable to attach storage pool " + storagePool.getId() + " to host " + hostId;

      _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, storagePool.getDataCenterId(), storagePool.getPodId(), msg, msg);

      throw new CloudRuntimeException("Unable to establish a connection from agent to storage pool " + storagePool.getId() + " due to " + answer.getDetails() +
        " (" + storagePool.getId() + ")");
    }

    assert (answer instanceof ModifyStoragePoolAnswer) : "ModifyStoragePoolAnswer expected ; Pool = " + storagePool.getId() + " Host = " + hostId;

    s_logger.info("Connection established between storage pool " + storagePool + " and host + " + hostId);
  }
}
origin: apache/cloudstack

public boolean shouldAvoid(StoragePool pool) {
  if (_dcIds != null && _dcIds.contains(pool.getDataCenterId())) {
    return true;
  }
  if (_podIds != null && _podIds.contains(pool.getPodId())) {
    return true;
  }
  if (_clusterIds != null && _clusterIds.contains(pool.getClusterId())) {
    return true;
  }
  if (_poolIds != null && _poolIds.contains(pool.getId())) {
    return true;
  }
  return false;
}
origin: apache/cloudstack

protected VolumeVO duplicateVolumeOnAnotherStorage(Volume volume, StoragePool pool) {
  Long lastPoolId = volume.getPoolId();
  String folder = pool.getPath();
  // For SMB, pool credentials are also stored in the uri query string.  We trim the query string
  // part  here to make sure the credentials do not get stored in the db unencrypted.
  if (pool.getPoolType() == StoragePoolType.SMB && folder != null && folder.contains("?")) {
    folder = folder.substring(0, folder.indexOf("?"));
  }
  VolumeVO newVol = new VolumeVO(volume);
  newVol.setInstanceId(null);
  newVol.setChainInfo(null);
  newVol.setPath(null);
  newVol.setFolder(folder);
  newVol.setPodId(pool.getPodId());
  newVol.setPoolId(pool.getId());
  newVol.setLastPoolId(lastPoolId);
  newVol.setPodId(pool.getPodId());
  return volDao.persist(newVol);
}
origin: apache/cloudstack

  private ModifyStoragePoolAnswer sendModifyStoragePoolCommand(ModifyStoragePoolCommand cmd, StoragePool storagePool, long hostId) {
    Answer answer = agentMgr.easySend(hostId, cmd);

    if (answer == null) {
      throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command for storage pool: " + storagePool.getId());
    }

    if (!answer.getResult()) {
      String msg = "Unable to attach storage pool " + storagePool.getId() + " to the host " + hostId;

      alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, storagePool.getDataCenterId(), storagePool.getPodId(), msg, msg);

      throw new CloudRuntimeException(msg);
    }

    assert (answer instanceof ModifyStoragePoolAnswer) : "ModifyStoragePoolAnswer not returned from ModifyStoragePoolCommand; Storage pool = " +
      storagePool.getId() + "; Host = " + hostId;

    LOGGER.info("Connection established between storage pool " + storagePool + " and host " + hostId);

    return (ModifyStoragePoolAnswer)answer;
  }
}
origin: apache/cloudstack

Long oldPoolId = volumeVO.getPoolId();
volumeVO.setPath(volumeTo.getPath());
volumeVO.setPodId(pool.getPodId());
volumeVO.setPoolId(pool.getId());
volumeVO.setLastPoolId(oldPoolId);
origin: apache/cloudstack

@Override
public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, VolumeInfo volume, HypervisorType rootDiskHyperType, StoragePool storagePool) throws NoTransitionException {
  VirtualMachineTemplate rootDiskTmplt = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId());
  DataCenter dcVO = _entityMgr.findById(DataCenter.class, vm.getDataCenterId());
  Pod pod = _entityMgr.findById(Pod.class, storagePool.getPodId());
  ServiceOffering svo = _entityMgr.findById(ServiceOffering.class, vm.getServiceOfferingId());
  DiskOffering diskVO = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
  Long clusterId = storagePool.getClusterId();
  VolumeInfo vol = null;
  if (volume.getState() == Volume.State.Allocated) {
    vol = createVolume(volume, vm, rootDiskTmplt, dcVO, pod, clusterId, svo, diskVO, new ArrayList<StoragePool>(), volume.getSize(), rootDiskHyperType);
  } else if (volume.getState() == Volume.State.Uploaded) {
    vol = copyVolume(storagePool, volume, vm, rootDiskTmplt, dcVO, pod, diskVO, svo, rootDiskHyperType);
    if (vol != null) {
      // Moving of Volume is successful, decrement the volume resource count from secondary for an account and increment it into primary storage under same account.
      _resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.secondary_storage, volume.getSize());
      _resourceLimitMgr.incrementResourceCount(volume.getAccountId(), ResourceType.primary_storage, volume.getSize());
    }
  }
  if (vol == null) {
    throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId());
  }
  VolumeVO volVO = _volsDao.findById(vol.getId());
  if (volVO.getFormat() == null) {
    volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
  }
  _volsDao.update(volVO.getId(), volVO);
  return volFactory.getVolume(volVO.getId());
}
origin: apache/cloudstack

@Override
public boolean hostConnect(long hostId, long poolId) {
  StoragePool pool = (StoragePool) this.dataStoreMgr.getDataStore(poolId, DataStoreRole.Primary);
  StoragePoolHostVO storagePoolHost = storagePoolHostDao.findByPoolHost(poolId, hostId);
  HostVO host = _hostDao.findById(hostId);
  if (storagePoolHost == null) {
    storagePoolHost = new StoragePoolHostVO(poolId, hostId, "");
    storagePoolHostDao.persist(storagePoolHost);
  }
  StoragePoolVO poolVO = storagePoolDao.findById(pool.getId());
  if(poolVO.isManaged() && (host.getHypervisorType() != HypervisorType.KVM)){
    return true;
  }
  ModifyStoragePoolCommand cmd = new ModifyStoragePoolCommand(true, pool);
  final Answer answer = agentMgr.easySend(hostId, cmd);
  if (answer == null) {
    throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command" + pool.getId());
  }
  if (!answer.getResult()) {
    String msg = "Unable to attach storage pool" + poolId + " to the host" + hostId;
    alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,pool.getDataCenterId(), pool.getPodId(), msg, msg);
    throw new CloudRuntimeException("Unable establish connection from storage head to storage pool " + pool.getId() + " due to " + answer.getDetails() + pool.getId());
  }
  assert (answer instanceof ModifyStoragePoolAnswer) : "Well, now why won't you actually return the ModifyStoragePoolAnswer when it's ModifyStoragePoolCommand? Pool=" + pool.getId() + "Host=" + hostId;
  s_logger.info("Connection established between " + pool + " host + " + hostId);
  return true;
}
origin: apache/cloudstack

  volumeVo.setChainInfo(chainInfo);
volumeVo.setPodId(destPool.getPodId());
volumeVo.setPoolId(destPool.getId());
volumeVo.setLastPoolId(oldPoolId);
origin: apache/cloudstack

alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, pool.getDataCenterId(), pool.getPodId(), msg, msg);
throw new CloudRuntimeException("Unable establish connection from storage head to storage pool " + pool.getId() + " due to " + answer.getDetails() +
  pool.getId());
origin: apache/cloudstack

volumeVO.setPodId(storagePool.getPodId());
volumeVO.setPoolId(storagePool.getId());
volumeVO.setLastPoolId(oldPoolId);
origin: apache/cloudstack

Long rootVolPodId = pool.getPodId();
Long rootVolClusterId = pool.getClusterId();
if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) {
origin: apache/cloudstack

if (destPool.getPodId() != null && !destPool.getPodId().equals(vm.getPodIdToDeployIn())) {
  final DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), destPool.getPodId(), null, null, null, null);
  final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, null, null, null, null);
  _networkMgr.reallocate(vmProfile, plan);
vm.setPodIdToDeployIn(destPool.getPodId());
origin: apache/cloudstack

if (!avoid.shouldAvoid(pool)) {
  long exstPoolDcId = pool.getDataCenterId();
  long exstPoolPodId = pool.getPodId() != null ? pool.getPodId() : -1;
  long exstPoolClusterId = pool.getClusterId() != null ? pool.getClusterId() : -1;
  boolean canReusePool = false;
origin: apache/cloudstack

final Long rootVolPodId = pool.getPodId();
final Long rootVolClusterId = pool.getClusterId();
if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) {
com.cloud.storageStoragePoolgetPodId

Popular methods of StoragePool

  • getId
  • getPoolType
  • getDataCenterId
  • getPath
  • getClusterId
  • getHostAddress
  • getName
  • getUuid
  • getPort
  • isManaged
  • getCapacityBytes
  • getHypervisor
  • getCapacityBytes,
  • getHypervisor,
  • getStatus,
  • isInMaintenance,
  • isShared,
  • getCapacityIops,
  • getStorageProviderName,
  • getUserInfo,
  • isLocal

Popular classes and methods

  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
  • runOnUiThread (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • String (java.lang)
    An immutable sequence of characters/code units ( chars). A String is represented by array of UTF-16
  • Thread (java.lang)
    A Thread is a concurrent unit of execution. It has its own call stack for methods being invoked, the
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)