use of org.ovirt.engine.core.common.businessentities.storage.FullEntityOvfData in project ovirt-engine by oVirt.
the class ExportVmCommand method updateVmInSpm.
protected void updateVmInSpm() {
Map<Guid, KeyValuePairCompat<String, List<Guid>>> metaDictionary = new HashMap<>();
ovfUpdateProcessHelper.loadVmData(getVm());
FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(getVm());
fullEntityOvfData.setClusterName(getVm().getClusterName());
fullEntityOvfData.setDiskImages(ovfUpdateProcessHelper.getVmImagesFromDb(getVm()));
ovfUpdateProcessHelper.buildMetadataDictionaryForVm(getVm(), metaDictionary, fullEntityOvfData);
ovfUpdateProcessHelper.executeUpdateVmInSpmCommand(getVm().getStoragePoolId(), metaDictionary, getParameters().getStorageDomainId());
}
use of org.ovirt.engine.core.common.businessentities.storage.FullEntityOvfData in project ovirt-engine by oVirt.
the class CreateOvaCommand method executeCommand.
@Override
protected void executeCommand() {
Map<DiskImage, DiskImage> diskMappings = getParameters().getDiskInfoDestinationMap();
Collection<DiskImage> disks = diskMappings.values();
Map<Guid, String> diskIdToPath = prepareImages(disks);
fillDiskApparentSize(disks);
VM vm = getParameters().getVm();
vmHandler.updateNetworkInterfacesFromDb(vm);
vmHandler.updateVmInitFromDB(vm.getStaticData(), true);
vmDeviceUtils.setVmDevices(vm.getStaticData());
fixDiskDevices(vm, diskMappings);
FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm);
fullEntityOvfData.setDiskImages(new ArrayList<>(disks));
fullEntityOvfData.setInterfaces(vm.getInterfaces());
String ovf = ovfManager.exportOva(vm, fullEntityOvfData, vm.getCompatibilityVersion());
log.debug("Exporting OVF: {}", ovf);
boolean succeeded = runAnsiblePackOvaPlaybook(vm.getName(), ovf, disks, diskIdToPath);
teardownImages(disks);
setSucceeded(succeeded);
}
Aggregations