use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class AddVmCommandTestBase method initVM.
protected void initVM() {
vm = new VM();
VmDynamic dynamic = new VmDynamic();
VmStatic stat = new VmStatic();
stat.setVmtGuid(Guid.newGuid());
stat.setName("testVm");
stat.setPriority(1);
stat.setMemSizeMb(MEMORY_SIZE);
stat.setMaxMemorySizeMb(MAX_MEMORY_SIZE);
vm.setStaticData(stat);
vm.setDynamicData(dynamic);
vm.setSingleQxlPci(false);
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class RestoreAllSnapshotsCommandTest method mockDynamicVmDao.
private void mockDynamicVmDao() {
VmDynamic mockDynamicVm = getVmDynamic();
when(vmDynamicDao.get(vmId)).thenReturn(mockDynamicVm);
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class GetVdsCertificateSubjectByVmIdQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
// Initially we set the command as failed:
QueryReturnValue queryReturnValue = getQueryReturnValue();
queryReturnValue.setSucceeded(false);
// Check if the virtual machine is running on a host, and if does then retrieve the host and copy the subject
// of the certificate to the value returned by the query:
Guid vmId = getParameters().getId();
if (vmId != null) {
VmDynamic vm = vmDynamicDao.get(vmId);
if (vm != null) {
Guid vdsId = vm.getRunOnVds();
if (vdsId != null) {
VdsStatic vds = vdsStaticDao.get(vdsId);
queryReturnValue.setSucceeded(true);
queryReturnValue.setReturnValue(CertificateSubjectHelper.getCertificateSubject(vds.getHostName()));
}
}
}
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmHandler method updateCurrentCd.
public void updateCurrentCd(VM vm, String currentCd) {
VmDynamic vmDynamic = vm.getDynamicData();
vmDynamic.setCurrentCd(currentCd);
vdsBrokerFrontend.runVdsCommand(VDSCommandType.UpdateVmDynamicData, new UpdateVmDynamicDataVDSCommandParameters(vmDynamic));
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmHandler method checkStatusAndLockVm.
/**
* Lock VM after check its status, If VM status is locked, we throw an exception.
*
* @param vmId
* - The ID of the VM.
*/
public void checkStatusAndLockVm(Guid vmId) {
VmDynamic vmDynamic = vmDynamicDao.get(vmId);
checkStatusBeforeLock(vmDynamic.getStatus());
lockVm(vmId);
}
Aggregations