Search in sources :

Example 1 with VmBase

use of org.ovirt.engine.core.common.businessentities.VmBase in project ovirt-engine by oVirt.

the class InstanceTypeManager method updateFildsAfterOsChanged.

public void updateFildsAfterOsChanged() {
    deactivateAndStartProgress();
    VmBase vmBase = getSource();
    maybeSetSingleQxlPci(vmBase);
    updateWatchdog(vmBase, false);
    updateBalloon(vmBase, false);
    maybeSetSelectedItem(model.getUsbPolicy(), vmBase.getUsbPolicy());
    activate();
}
Also used : VmBase(org.ovirt.engine.core.common.businessentities.VmBase)

Example 2 with VmBase

use of org.ovirt.engine.core.common.businessentities.VmBase in project ovirt-engine by oVirt.

the class AddVmPoolCommand method updateVmInitPassword.

@Override
protected void updateVmInitPassword() {
    // so we need to update the VmInit password from its template.
    if (getParameters().getVmStaticData().getVmInit() != null && getParameters().getVmStaticData().getVmInit().isPasswordAlreadyStored()) {
        VmBase temp = new VmBase();
        temp.setId(getParameters().getVmStaticData().getVmtGuid());
        vmHandler.updateVmInitFromDB(temp, false);
        getParameters().getVmStaticData().getVmInit().setRootPassword(temp.getVmInit().getRootPassword());
    }
}
Also used : VmBase(org.ovirt.engine.core.common.businessentities.VmBase)

Example 3 with VmBase

use of org.ovirt.engine.core.common.businessentities.VmBase in project ovirt-engine by oVirt.

the class GetEntitiesWithLeaseByStorageIdQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Guid domainId = getParameters().getId();
    List<VmBase> entities = new ArrayList<>();
    entities.addAll(vmStaticDao.getAllWithLeaseOnStorageDomain(domainId));
    entities.addAll(vmTemplateDao.getAllWithLeaseOnStorageDomain(domainId));
    getQueryReturnValue().setReturnValue(entities);
}
Also used : VmBase(org.ovirt.engine.core.common.businessentities.VmBase) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid)

Example 4 with VmBase

use of org.ovirt.engine.core.common.businessentities.VmBase in project ovirt-engine by oVirt.

the class EmulatedMachineUtilsTest method testEffectiveEmulatedMachineWithCustomSet.

@Test
public void testEffectiveEmulatedMachineWithCustomSet() {
    final VmBase vmBase = new VmBase();
    final Cluster cluster = new Cluster();
    cluster.setEmulatedMachine("cluster-pc-i440fx-rhel7.3.0");
    vmBase.setCustomEmulatedMachine("testpc-i440fx-rhel7.3.0");
    assertEquals("testpc-i440fx-rhel7.3.0", EmulatedMachineUtils.getEffective(vmBase, () -> cluster));
}
Also used : VmBase(org.ovirt.engine.core.common.businessentities.VmBase) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Test(org.junit.Test)

Example 5 with VmBase

use of org.ovirt.engine.core.common.businessentities.VmBase in project ovirt-engine by oVirt.

the class EmulatedMachineUtilsTest method testEffectiveEmulatedMachineWithoutCustomSet.

@Test
public void testEffectiveEmulatedMachineWithoutCustomSet() {
    final VmBase vmBase = new VmBase();
    final Cluster cluster = new Cluster();
    cluster.setEmulatedMachine("cluster-pc-i440fx-rhel7.3.0");
    assertEquals("cluster-pc-i440fx-rhel7.3.0", EmulatedMachineUtils.getEffective(vmBase, () -> cluster));
}
Also used : VmBase(org.ovirt.engine.core.common.businessentities.VmBase) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Test(org.junit.Test)

Aggregations

VmBase (org.ovirt.engine.core.common.businessentities.VmBase)38 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)15 Guid (org.ovirt.engine.core.compat.Guid)11 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)9 VM (org.ovirt.engine.core.common.businessentities.VM)8 HashSet (java.util.HashSet)7 List (java.util.List)7 Set (java.util.Set)7 HashMap (java.util.HashMap)6 Collection (java.util.Collection)5 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)5 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)5 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)5 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)5 Collections (java.util.Collections)4 Map (java.util.Map)4 Collectors (java.util.stream.Collectors)4 VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)4 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)4