Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing OS Compute Hypervisors list request #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class NeutronQoSExecutor implements Runnable {
private String token;
private Map<String, String> creds;
private List<org.openstack4j.model.network.Port> portList;
private Map<String, String> computeNodeMap;
private Map<String, String> hostComputeNodeMap;
private String delimiter_line;

Expand All @@ -79,7 +78,6 @@ public NeutronQoSExecutor(
VimInstance v,
Map<String, String> creds,
List<org.openstack4j.model.network.Port> portList,
Map<String, String> computeNodeMap,
Map<String, String> hostComputeNodeMap) {
this.vnfrs = vnfrs;
this.logger = LoggerFactory.getLogger(this.getClass());
Expand All @@ -88,7 +86,6 @@ public NeutronQoSExecutor(
this.v = v;
this.creds = creds;
this.portList = portList;
this.computeNodeMap = computeNodeMap;
this.hostComputeNodeMap = hostComputeNodeMap;
}

Expand Down Expand Up @@ -120,15 +117,12 @@ public void run() {
+ " -> "
+ r.getQuality()
+ " -> "
+ hostComputeNodeMap.get(vnfr.getName())
+ " -> "
+ computeNodeMap.get(hostComputeNodeMap.get(vnfr.getName())));
+ hostComputeNodeMap.get(vnfr.getName()));
} catch (Exception e) {
logger.warn(" Problem checking on compute node for " + r.getIp());
logger.debug("/////////////////////////////////////");
logger.debug(hostComputeNodeMap.toString());
logger.debug("/////////////////////////////////////");
logger.debug(computeNodeMap.toString());
}
}
}
Expand Down
31 changes: 1 addition & 30 deletions src/main/java/org/openbaton/nse/beans/core/CoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,6 @@ private String getNeutronEndpoint(OSClient os, VimInstance vimInstance, String t
return null;
}

private Map<String, String> getComputeNodeMap(OSClient os) {
Map<String, String> computenode_ip_map = new HashMap<String, String>();
for (Hypervisor h : os.compute().hypervisors().list()) {
computenode_ip_map.put(h.getHypervisorHostname(), h.getHostIP());
}
return computenode_ip_map;
}

private Map<String, String> getVnfHostNameComputeNodeMap(
OSClient os, Set<VirtualNetworkFunctionRecord> vnfrs) {
Expand Down Expand Up @@ -440,7 +433,6 @@ private void startOpenStackNeutronQoSTask(
v,
creds,
portList,
this.getComputeNodeMap(os),
this.getVnfHostNameComputeNodeMap(os, vim_vnfrs_map.get(key)));
qtScheduler.schedule(aqe, 1, TimeUnit.SECONDS);
}
Expand Down Expand Up @@ -512,27 +504,6 @@ private void updateOpenStackOverview() {
for (VNFCInstance vnfci : vdu.getVnfc_instance()) {
VimInstance tmp_vim = this.getVimInstance(nfvo_nsr_req, vnfci.getVim_id());
OSClient tmp_os = getOSClient(tmp_vim);
Map<String, String> tmp_computeNodeMap = getComputeNodeMap(tmp_os);
if (tmp_computeNodeMap != null) {
// We collect all involved compute nodes
for (String key : tmp_computeNodeMap.keySet()) {
boolean node_found = false;
for (int i = 0; i < complete_computeNodeMap.size(); i++) {
if (complete_computeNodeMap.get(i).get("name").equals(key)) {
node_found = true;
}
}
if (!node_found) {
HashMap<String, Object> tmp_node_entry = new HashMap<String, Object>();
//tmp_node_entry.put(key, tmp_computeNodeMap.get(key));
tmp_node_entry.put("vnfs", new ArrayList<HashMap<String, String>>());
tmp_node_entry.put("node_ip", tmp_computeNodeMap.get(key));
tmp_node_entry.put("name", key);

complete_computeNodeMap.add(tmp_node_entry);
}
}
}

Map<String, String> tmp_vnf_computeNodeMap =
getVnfHostNameComputeNodeMap(tmp_os, nsr.getVnfr());
Expand Down Expand Up @@ -566,7 +537,7 @@ private void updateOpenStackOverview() {
// "Entry "
// + vnfci.getHostname()
// + " already added to "
// + current_compute_node);
// + current_compute_node);
} else {
//logger.debug(
// "adding " + vnfci.getHostname() + " to " + current_compute_node);
Expand Down