if (clusterDao.getSupportsResigning(clusterId)) { return host;
if (ResourceState.Enabled.equals(host.getResourceState())) { if (computeClusterMustSupportResign) { if (clusterDao.getSupportsResigning(cluster.getId())) { return Optional.of(host);
if (host.getResourceState() == ResourceState.Enabled) { if (computeClusterMustSupportResign) { if (clusterDao.getSupportsResigning(cluster.getId())) { return host; } else {
@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); }
/** * Storage plug-ins for managed storage can be designed in such a way as to store a template on the primary storage once and * make use of it via storage-side cloning. * * This method determines how many more bytes it will need for the template (if the template is already stored on the primary storage, * then the answer is 0). */ private long getAskingSizeForTemplateBasedOnClusterAndStoragePool(Long templateId, Long clusterId, StoragePoolVO storagePoolVO) { if (templateId == null || clusterId == null || storagePoolVO == null || !storagePoolVO.isManaged()) { return 0; } VMTemplateVO tmpl = _templateDao.findByIdIncludingRemoved(templateId); if (tmpl == null || ImageFormat.ISO.equals(tmpl.getFormat())) { return 0; } HypervisorType hypervisorType = tmpl.getHypervisorType(); // The getSupportsResigning method is applicable for XenServer as a UUID-resigning patch may or may not be installed on those hypervisor hosts. if (_clusterDao.getSupportsResigning(clusterId) || HypervisorType.VMware.equals(hypervisorType) || HypervisorType.KVM.equals(hypervisorType)) { return getBytesRequiredForTemplate(tmpl, storagePoolVO); } return 0; }
computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());
computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());
boolean computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(volumeStoragePoolVO.getClusterId());
computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());
HostVO hostVO = getHost(volumeInfo.getId()); computeClusterSupportsVolumeClone = clusterDao.getSupportsResigning(hostVO.getClusterId());