VirtualMachine.getTemplateId
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.cloud.vm.VirtualMachine.getTemplateId(Showing top 5 results out of 315)

origin: apache/cloudstack

@Override
public VirtualMachineTemplate getTemplate() {
  if (_template == null && _vm != null) {
    _template = s_entityMgr.findByIdIncludingRemoved(VirtualMachineTemplate.class, _vm.getTemplateId());
  }
  return _template;
}
origin: apache/cloudstack

@Override
public long getTemplateId() {
  return _vm.getTemplateId();
}
origin: apache/cloudstack

@Override
public void generateUsageEvent(VirtualMachine vm, boolean isDisplay, String eventType){
  ServiceOfferingVO serviceOffering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId());
  if (!serviceOffering.isDynamic()) {
    UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(),
        vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm.getHypervisorType().toString(),
        VirtualMachine.class.getName(), vm.getUuid(), isDisplay);
  }
  else {
    Map<String, String> customParameters = new HashMap<String, String>();
    customParameters.put(UsageEventVO.DynamicParameters.cpuNumber.name(), serviceOffering.getCpu().toString());
    customParameters.put(UsageEventVO.DynamicParameters.cpuSpeed.name(), serviceOffering.getSpeed().toString());
    customParameters.put(UsageEventVO.DynamicParameters.memory.name(), serviceOffering.getRamSize().toString());
    UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(),
        vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm.getHypervisorType().toString(),
        VirtualMachine.class.getName(), vm.getUuid(), customParameters, isDisplay);
  }
}
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

VMTemplateVO template = ApiDBUtils.findTemplateById(vm.getTemplateId());
if (template != null) {
  vmResponse.setTemplateId(template.getUuid());
com.cloud.vmVirtualMachinegetTemplateId

Popular methods of VirtualMachine

  • getId
  • getHostId
  • getGuestOSId
    returns the guest OS ID
  • getInstanceName
  • getState
  • getHostName
  • getAccountId
  • getDataCenterId
  • getLastHostId
  • getType
  • getUuid
  • getHypervisorType
  • getUuid,
  • getHypervisorType,
  • getServiceOfferingId,
  • getDomainId,
  • getPodIdToDeployIn,
  • getPrivateIpAddress,
  • isDisplay,
  • getCreated,
  • getUpdated

Popular classes and methods

  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • requestLocationUpdates (LocationManager)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • TimeZone (java.util)
    TimeZone represents a time zone, primarily used for configuring a Calendar or java.text.SimpleDateF
  • TreeMap (java.util)
    A map whose entries are sorted by their keys. All optional operations such as #put and #remove are s
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Pattern (java.util.regex)
    Emulation of the Pattern class, uses RegExp as internal implementation.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ

For IntelliJ IDEA and
Android Studio

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