private String getVnfcId() { for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) { for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) { if (this.vnfcInstance.getVc_id().equals(vnfcInstance.getVc_id())) { return vnfcInstance.getId(); } } if (vnfcInstance.getId() != null) { return vnfcInstance.getId(); } } return null; }
log.debug( "Removing VM with ExtId: " + vnfcInstance.getVc_id() + " from VimInstance " + vimInstance.getName()); try { client.deleteServerByIdAndWait(vimInstance, vnfcInstance.getVc_id()); log.info( "Removed VM with ExtId: " + vnfcInstance.getVc_id() + " from VimInstance " + vimInstance.getName()); log.error( "Not removed VM with ExtId " + vnfcInstance.getVc_id() + " successfully from VimInstance " + vimInstance.getName() log.error( "Not removed VM with ExtId " + vnfcInstance.getVc_id() + " successfully from VimInstance " + vimInstance.getName() + vnfcInstance.getVc_id() + " successfully from VimInstance " + vimInstance.getName()
@Override @Async public Future<Void> operate( BaseVimInstance vimInstance, VirtualDeploymentUnit vdu, VNFCInstance vnfcInstance, String operation) throws VimException { switch (operation) { case "rebuild": String imageId = this.chooseImage(vdu.getVm_image(), vimInstance); try { client.rebuildServer(vimInstance, vnfcInstance.getVc_id(), imageId); } catch (VimDriverException vde) { throw new VimException( "Not rebuild VM with ExtId " + vnfcInstance.getVc_id() + " successfully from VimInstance " + vimInstance.getName() + ". Caused by: " + vde.getMessage(), vde); } break; default: log.error("Operation not supported"); break; } return new AsyncResult<>(null); }
VNFCInstance instance = futureInstance.get(); virtualDeploymentUnit.getVnfc_instance().add(instance); ids.add(instance.getVc_id()); log.debug("Launched VM with id: " + instance.getVc_id()); Map<String, String> floatingIps = new HashMap<>(); for (VNFDConnectionPoint connectionPoint : instance.getVnfComponent().getConnection_point()) {
userdata, keys); log.debug("Launched VM with id: " + vnfc.getVc_id()); Map<String, String> floatingIps = new HashMap<>(); for (VNFDConnectionPoint connectionPoint : vnfc.getVnfComponent().getConnection_point()) { log.debug("Real FloatingIPs: " + vnfc.getFloatingIps()); log.info("Finished deploying VMs with external id: " + vnfc.getVc_id()); return new AsyncResult<>(vnfc);
private NFVMessage handleVimException(VimException e) { e.printStackTrace(); log.error(e.getMessage()); HistoryLifecycleEvent lifecycleEvent = new HistoryLifecycleEvent(); lifecycleEvent.setEvent(Event.ERROR.name()); SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd'-'HH:mm:ss:SSS'-'z"); lifecycleEvent.setExecutedAt(format.format(new Date())); lifecycleEvent.setDescription(e.getMessage()); VNFCInstance vnfcInstance = e.getVnfcInstance(); if (vnfcInstance != null) { log.info("The VM was not correctly deployed. ExtId is: " + vnfcInstance.getVc_id()); log.debug("Details are: " + vnfcInstance); for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) { if (vdu.getId().equals(e.getVirtualDeploymentUnit().getId())) { if (vdu.getVnfc_instance() == null) { vdu.setVnfc_instance(new LinkedHashSet<>()); } vdu.getVnfc_instance().add(vnfcInstance); log.debug("Found VDU and set vnfcInstance"); } } } virtualNetworkFunctionRecord.getLifecycle_event_history().add(lifecycleEvent); try { saveVirtualNetworkFunctionRecord(); } catch (NotFoundException e1) { log.error(e1.getLocalizedMessage()); } return new OrVnfmErrorMessage(virtualNetworkFunctionRecord, e.getMessage()); }
vnfcInstance_nfvo.setVc_id(vnfcInstance_manager.getVc_id()); vnfcInstance_nfvo.setVnfComponent(vnfcInstance_manager.getVnfComponent()); vnfcInstance_nfvo.setConnection_point(
new HashMap<>(), new HashSet<>()); String expectedId = id.get().getVc_id(); log.debug(expectedId + " == " + environment.getProperty("mocked_id")); Assert.assertEquals(expectedId, environment.getProperty("mocked_id"));