Search in sources :

Example 1 with CreateCloneOfTemplateParameters

use of org.ovirt.engine.core.common.action.CreateCloneOfTemplateParameters in project ovirt-engine by oVirt.

the class AddVmFromTemplateCommand method buildDiskCreationParameters.

@Override
protected CreateCloneOfTemplateParameters buildDiskCreationParameters(DiskImage disk) {
    DiskImageBase diskInfo = getParameters().getDiskInfoDestinationMap().get(disk.getId());
    CreateCloneOfTemplateParameters params = new CreateCloneOfTemplateParameters(disk.getImageId(), getParameters().getVmStaticData().getId(), diskInfo);
    params.setStorageDomainId(diskInfoSourceMap.get(disk.getId()));
    params.setDestStorageDomainId(retrieveDestinationDomainForDisk(disk.getId()));
    params.setDiskAlias(diskInfoDestinationMap.get(disk.getId()).getDiskAlias());
    params.setVmSnapshotId(getVmSnapshotId());
    params.setParentCommand(ActionType.AddVmFromTemplate);
    params.setParentParameters(getParameters());
    params.setEntityInfo(getParameters().getEntityInfo());
    params.setQuotaId(diskInfoDestinationMap.get(disk.getId()).getQuotaId() != null ? diskInfoDestinationMap.get(disk.getId()).getQuotaId() : null);
    params.setDiskProfileId(diskInfoDestinationMap.get(disk.getId()).getDiskProfileId());
    return params;
}
Also used : DiskImageBase(org.ovirt.engine.core.common.businessentities.storage.DiskImageBase) CreateCloneOfTemplateParameters(org.ovirt.engine.core.common.action.CreateCloneOfTemplateParameters)

Aggregations

CreateCloneOfTemplateParameters (org.ovirt.engine.core.common.action.CreateCloneOfTemplateParameters)1 DiskImageBase (org.ovirt.engine.core.common.businessentities.storage.DiskImageBase)1