use of org.ovirt.engine.core.compat.Guid in project ovirt-engine by oVirt.
the class RemoveCpuQosCommand method executeCommand.
@Override
protected void executeCommand() {
List<Guid> vmIds = vmSlaPolicyUtils.getRunningVmsWithCpuQos(getQosId());
super.executeCommand();
// After successful command, refresh qos
CpuQos unlimitedQos = new CpuQos();
unlimitedQos.setCpuLimit(100);
vmSlaPolicyUtils.refreshVmsCpuQos(vmIds, unlimitedQos);
}
use of org.ovirt.engine.core.compat.Guid in project ovirt-engine by oVirt.
the class GetProviderByIdQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Guid id = getParameters().getId();
Provider<?> provider = dao.get(id);
getQueryReturnValue().setReturnValue(provider);
}
use of org.ovirt.engine.core.compat.Guid in project ovirt-engine by oVirt.
the class UpdateDiskProfileCommand method executeCommand.
@Override
protected void executeCommand() {
// Chcek if qos has changed
Guid oldQos = diskProfileDao.get(getProfileId()).getQosId();
Guid newQos = getProfile().getQosId();
super.executeCommand();
// QoS did not change
if (Objects.equals(oldQos, newQos)) {
return;
}
// Profile changes are already persisted in the database
if (getSucceeded()) {
vmSlaPolicyUtils.refreshRunningVmsWithDiskProfile(getProfileId());
}
}
use of org.ovirt.engine.core.compat.Guid in project ovirt-engine by oVirt.
the class CreateOvfVolumeForStorageDomainCommand method logFailure.
private void logFailure() {
Guid createdDiskId = getActionReturnValue();
if (createdDiskId != null) {
addCustomValue("DiskId", createdDiskId.toString());
auditLogDirector.log(this, AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_FAILED);
} else {
auditLogDirector.log(this, AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_INITIATE_FAILED);
}
}
use of org.ovirt.engine.core.compat.Guid in project ovirt-engine by oVirt.
the class OvfHelper method readVmFromOvf.
/**
* parses a given ovf to a vm, initialize all the extra data related to it such as images, interfaces, cluster,
* LUNS, etc..
*
* @return FullEntityOvfData that represents the given ovf data
*/
public FullEntityOvfData readVmFromOvf(String ovf) throws OvfReaderException {
VM vm = new VM();
FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm);
ovfManager.importVm(ovf, vm, fullEntityOvfData);
// add images
vm.setImages((ArrayList) fullEntityOvfData.getDiskImages());
// add interfaces
vm.setInterfaces(fullEntityOvfData.getInterfaces());
// add disk map
Map<Guid, List<DiskImage>> images = ImagesHandler.getImagesLeaf(fullEntityOvfData.getDiskImages());
for (Map.Entry<Guid, List<DiskImage>> entry : images.entrySet()) {
List<DiskImage> list = entry.getValue();
vm.getDiskMap().put(entry.getKey(), list.get(list.size() - 1));
}
fullEntityOvfData.getLunDisks().forEach(lunDisk -> vm.getDiskMap().put(lunDisk.getId(), lunDisk));
return fullEntityOvfData;
}
Aggregations